Reputation: 469
I do have a table data as shown below:
<td>
<label for="title">Title : </label>
<textarea rows="5" id="title" name="title"></textarea>
</td>
the default location for the label is at the bottom. How will I place the label aligned with the top of the text area?
Upvotes: 32
Views: 63243
Reputation: 19
Use br tag.
<td>
<label for="title">Title : </label>
<br>
<textarea rows="5" id="title" name="title"></textarea>
</td>
Upvotes: 0
Reputation: 4275
@Bazmegakapa Great answer! We can also do it this way
label{display:block; float:left;}
fiddle demo: http://jsfiddle.net/kaMqg/1/
Upvotes: 2
Reputation: 78671
With the following CSS:
textarea { vertical-align: top; }
vertical-align
on MDN:
The vertical-align CSS property specifies the vertical alignment of an inline or table-cell element.
Upvotes: 68