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

Using margin-right property in CSS

WBOY
WBOYforward
2023-08-27 11:37:091505browse

在 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>

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!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete