Many times we would need to set margin for our objects. This will set the left margin of the object. |
Usage: |
margin-left: 10px; margin-left: 10pt; margin-left: 10%; margin-left: auto; |
It takes the following values: |
|
The following CSS code example shows how to set the value of the left margin: |
<html> <head> <title>CSS margin example</title> <style type=”text/css”> .leftmargin { margin-left: 2cm } </style> </head><body> <p> This paragraph does not have a specified margin. </p> <p class=”leftmargin”> This paragraph has a left margin of 2cm. </p> </body> </html> |