Home > Web Front-end > CSS Tutorial > Specify the top padding of an element using CSS

Specify the top padding of an element using CSS

WBOY
Release: 2023-08-29 22:53:02
forward
786 people have browsed it

Specify the top padding of an element using CSS

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: 15px; border:2px solid orange;">
         This is demo content.
      </p>
      <p style = "padding-top: 15%; border:2px solid orange;">
         This is another demo content.
      </p>
   </body>
</html>
Copy after login

The above is the detailed content of Specify the top padding of an element using CSS. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template