css margin-left: code example

Example 1: css margin top

.yourClass {
  margin-top: 25px;
}

Example 2: how to add a left margin in css

<html>
   <head>
   </head>

   <body>
      <p style = "margin-left: 15px; border:1px solid black;">
         This is a paragraph with a specified left margin
      </p>
      
      <p style = "margin-left: 5%; border:1px solid black;">
         This is another paragraph with a specified top margin in percent
      </p>
   </body>
</html>

Example 3: css margin left

p.ex1 {
 margin-left: 30px;
 }

Example 4: css margin

#blockOrInline-Block {margin: 0px/*top*/ 0px/*right*/ 0px/*bottom*/ 0px/*left*/;}

Tags:

Misc Example