afterburner afterburner - 7 months ago 5
HTML Question

How to align Label of text area to top and right?

Here is my code:

.labelcss{
width: 180px;
display: inline-block;
text-align:right;
vertical- align: text-top;
}

<label class="labelcss" for="address">Address: </label>
<textarea name="address" id="address">


My address label is positioned inferiorly. I need to position it to the top and right, Just like this:

enter image description here

Answer

Use vertical-align:top;, not vertical- align:text-top;. This will make sure that your text is not aligned to the bottom, like it currently is.

.labelcss{
  width: 180px; 
  display: inline-block;
  text-align:right;
  vertical-align: top;
}
<label class="labelcss" for="address">Address: </label>
<textarea name="address" id="address">

Comments