Reputation: 293
When I add padding to my textarea then vertical-align top does not work.
Browser: Firefox
CSS:
.form-aligned textarea-label {
vertical-align: top;
display: inline-block;
width: 120px;
text-align: left;
}
textarea {
padding: 6px 12px;
}
I am looking for a result like this but with padding added to textarea:
It drives me crazy it should be simple :-)
Upvotes: 0
Views: 767
Reputation: 106
You need to use divs to separate the label from the textarea.
<div style="float:left;">
<label>Incident: </label>
</div>
<div style="float:left;">
<textarea id="txtIncident"></textarea>
</div>
label {
vertical-align: top;
width: 120px;
text-align: left;
}
textarea {
padding: 6px 12px;
}
https://jsfiddle.net/7z0uwtLu/
Upvotes: 1