Reputation: 5938
How can i align the label text in the middle of the div ?
what i'm seeking is something like
-----------
Name: | textbox |
-----------
Demo code: http://jsfiddle.net/53ALd/2053/
Upvotes: 0
Views: 4837
Reputation: 1605
I hope this will help you. Change the markup:
HTML:
<table>
<tr>
<td><label for='name'>Name:</label></td>
<td><textarea type='text' id='name'></textarea></td>
</tr>
</table>
CSS:
td {
border-right: 1px solid #F1F1F1;
border-top: 1px solid #F1F1F1;
border-bottom: 1px solid #F1F1F1;
border-left: 0px solid #F1F1F1;
padding: 2px;
margin: 0;
vertical-align: middle;
}
Upvotes: 1
Reputation: 3584
The following should do the job:
label, textarea {
vertical-align: middle;
}
Upvotes: 8