Computer >> Computer tutorials >  >> Programming >> Javascript

CSS padding-top property


The padding-top specifies the top padding of an element. It sets the top padding of an element. This can take a value in terms of length of %.

Example

<html>
   <head>
   </head>
   <body>
      <p style = "padding-top: 10px; border:1px solid red;">
         This is a paragraph with a specified top padding
      </p>
      <p style = "padding-top: 10%; border:1px solid red;">
         This is another paragraph with a specified top padding in percent
      </p>
   </body>
</html>