Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] Centering Input Fields

  • This topic is empty.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #179469
    Kingslayer
    Participant

    http://codepen.io/anon/pen/qJKes

    I have this Example i use the same technique earlier to center text within a div that has 100% width.

    Now when i try to center the 2 Form Elements, it does not work. The div that contains them is wider than its content, and i cant figure out where it inherits the width from.

    Can someone help me so this centers properly and so that between the 2 input fields is a 50px margin.

    #179471
    Paulie_D
    Member

    You really should be using <label> instead of span.

    Wrap each ‘row;’ in a div for a quick solution

    http://codepen.io/Paulie-D/full/IoGyL/

    #179474
    Kingslayer
    Participant

    would you be willing to show me the proper solution (or give me something to read up on ;)). I am trying to start something like a responsive layout, but having a hard time here.
    Also In your codepen another problem shows up text is not with the coresponding box.

    (Also why does the parent div in the initial example get the width it has. Nothing that it contains expands to this width ?

    #180001
    Kingslayer
    Participant

    @wolfcry911 thx for the solution =) !

    Now i wonder why does it start to break so early column_center has a width of 632 px

    but if the browser has a width of less than 1000ish pixels it breaks.

    #180002
    Paulie_D
    Member

    That would be partly due to the absolute positioning I guess

    Forked

    http://codepen.io/Paulie-D/pen/iGHqA

    #180003
    Kingslayer
    Participant

    i had this method at first but i have columns where i have text with text align left and they arent centered with this method and also when it breaks its not centered anymore =(

    #180004
    Paulie_D
    Member

    Perhaps you could make your own fresh Codepen (after incorporating some of the ideas here) so we can understand what the issue is but you’d probably just nee dto change some properties in a suitably defined media query

    #180005
    Kingslayer
    Participant

    didnt think it would be that much of a problem. will do that. but still trying to figure out some of the stuff on my own ;)

    This is what I am trying to do.

    http://abload.de/img/exampleaesys.png

    This is what i have so far.

    http://codepen.io/anon/pen/vhfCd

    I know its alot of code, but it does not work without the css reset …

    #180475
    Kingslayer
    Participant

    Howdy, still havent found a workarround so that the inputfields stay centered when they are placed underneath each other. Would be happy to to have some input, and does anyone know a could article maybe with some examples about responsive design and coding. I have searched the web found many read many but they contradict each other… =/

    #180476
    Paulie_D
    Member

    Like this…just use a media query.

    http://codepen.io/Paulie-D/pen/FeBtd

    #180486
    Kingslayer
    Participant

    Thx Paul =) i really appreciate your help !

Viewing 11 posts - 1 through 11 (of 11 total)
  • The forum ‘CSS’ is closed to new topics and replies.