Home > Web Front-end > CSS Tutorial > Using margin-right property in CSS

Using margin-right property in CSS

WBOY
Release: 2023-08-27 11:37:09
forward
1506 people have browsed it

在 CSS 中使用 margin-right 属性

margin-right Specifies the right margin of the element. Its value can be length, %, or auto. You can try running the following code to set the right margin -

Example

<html>
   <head>
   </head>
   <body>
      <p style = "margin-right: 10px; border:2px solid red;">
         This is a paragraph with a specified right margin
      </p>
      <p style = "margin-right: 10%; border:2px solid green;">
         This is another paragraph with a specified right margin in percent
      </p>
   </body>
</html>
Copy after login

The above is the detailed content of Using margin-right property in 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