HTML Form How to - Position Label on top of text-area








Question

We would like to know how to position Label on top of text-area.

Answer


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

The code above is rendered as follows: