If I have a form with

<input type="text"></input>

How do I make the label on a separate line from the inputs without adding a <br />?

I thought you can do it with css by making each element a block element, but I see people are making them on new lines without changing to block...

  • do you need the / in the br tag anymore? Numbers McPi almost 8 years ago
  • What's wrong with using display:block? Abinadi Ayerdis almost 8 years ago

2 answers

danwellman 5600
This was chosen as the best answer

You could also do it without explicitly setting them to display:block by floating them both left but adding clear:left to the input

Answered almost 8 years ago by danwellman

The display property will work

http://www.w3schools.com/cssref/pr_class_display.asp for more info

if you use the "display: inline-block;" on both LABEL and INPUT they will be next to each other, id you use "display: block;" on both, the label will be on one line and the input on the next line.

Answered almost 8 years ago by Eric (BookOfZeus)