CSS Margins

Unique beauty

CSS Margins: 

The CSS margin properties are used to create space around elements, outside of any defined borders. With CSS, you have full control over the margins. There are properties for setting the margin for each side of an element (top, right, bottom, and left).

 If the margin property has four values:


➡margin: 10px 5px 15px 20px; top margin is  10px. right margin is 5px. bottom margin is 15px. left margin is 20px.

CSS Margins;



   CSS 
   <!DOCTYPE html>
<html>
    
<head>
    <style>
        p {
            margin: 80px 100px 50px 80px;
        }
    </style>
</head>
 
<body>
    <h1>
        Rose is beautiful flower
    </h1>
    <p> Margin properties </p>
</body>
 
</html>
 

Output:

Rose is beautiful flower 



                             Margin properties 

Our website uses cookies to enhance your experience. Learn More
Accept !

GocourseAI

close
send