HTML Form How to - Align label to match top of textarea








Question

We would like to know how to align label to match top of textarea.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
textarea {<!-- w  w w.  j a v  a  2  s .c  o m-->
  vertical-align: top;
}
</style>
</head>
<body>
  <label for="title">Title : </label>
  <textarea rows="5" id="title" name="title"></textarea>
</body>
</html>

The code above is rendered as follows: