HTML Form How to - Set padding left value for input field








Question

We would like to know how to set padding left value for input field.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.testStyle {<!--  ww  w  .  ja va 2s . c  o m-->
  padding-left: 30px
}
</style>
</head>
<body>
  <input type="text" class="testStyle">
</body>
</html>

The code above is rendered as follows: