HTML Form How to - Change label and textarea to block level element








Question

We would like to know how to change label and textarea to block level element.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
label {<!--from   www  . j av a  2s  . c  om-->
  display: block;
}

textarea {
  display: block;
}
</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: