Usage of margin-right property with CSS

CSSWeb DevelopmentFront End Technology

The margin-right specifies the right margin of an element. It can have a value in length, % or auto. You can try to run 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>
raja
Published on 18-Apr-2018 06:29:30
Advertisements