Search code examples
cssformsalignmentjsfiddle

How to display form labels with more than one element per line? jsfiddle


I am trying to display my form labels above the form element, so I am using display:block in my CSS. However, I am not able to show more than 1 form element per line this way.

How can I update my CSS properly to show my labels above the form element, but be able to show more than one element per line? See this example:

http://jsfiddle.net/Mhu76/1/


Solution

  • Put divs around each group of span and input, and make those divs display:inline-block;. I tried it here: http://jsfiddle.net/Mhu76/4/