Reputation: 103507
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?
Upvotes: 3
Views: 25044
Reputation: 598
<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.
Upvotes: 3
Reputation: 1684
You could throw in a breakline (<br />
) between them or put each in its own div.
Upvotes: 1
Reputation: 63672
The simplest way is to add a <br>
after </label>
.
Alternatively you could use div tags or a table with two rows.
Upvotes: 1
Reputation: 1151
You can put a css class or style that would change display to block:
<label style="display:block">blah</label>
<input type=text ... />
Upvotes: 10
Reputation: 69983
<label>blah</label>
<br />
<input type=text ... />
Use a line break.
Upvotes: 5