tags:

views:

424

answers:

6

I have a the following html:

<label>blah</label>
<input type=text ... />

I want the label to be on one row, and below it the input box.

currently it is on the same line, do I have to use a clear?

+1  A: 

You could throw in a breakline (<br />) between them or put each in its own div.

orthod0ks
+3  A: 
<label>blah</label>
<br />
<input type=text ... />

Use a line break.

Brandon
+4  A: 

You can put a css class or style that would change display to block:

<label style="display:block">blah</label>
<input type=text ... />
Mike Hall
+1  A: 

The simplest way is to add a <br> after </label>.

Alternatively you could use div tags or a table with two rows.

Jon
+2  A: 
<label for="fldAge">Age:</label>
<p>
<input type="text" name="Age" id="fldAge" />
</p>

This also causes the browser to render text associated with an input with a focus rectangle, and enables the user to focus the field by clicking anywhere in the associated text instead of just the input field control.

Alex Pavlov
+2  A: 

Do it with CSS:

label { clear: both; }

Josh