HTML Form How to - Set padding and margin for input field








Question

We would like to know how to set padding and margin for input field.

Answer


<!--from  ww  w .j  av a  2s.c  o  m-->
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
input {
  padding: 5px 5px 5px 15px;
  margin: 20px;
}
</style>
</head>
<body>
  <input type="text" />
</body>
</html>

The code above is rendered as follows: