welcome to tutorialfamily

css margin

css margin used for applying space to element.

Margin work as a spacing outside area of element.


css margin

here we show you one way to apply margin to top,right,bottom,left spacing to element outside area.


css margin


						        
<!DOCTYPE html>
<html>
<head>
   <title>css tutorial</title>
<style>
h1{
   color: red;
   font-size: 40px;
   display: block;
   border: 1px solid #000;
   margin: 20px 40px 30px 50px;
}
</style>
</head>
<body>
   <h1>my car</h1>
</body>
</html>


Run

css margin single property

we apply margin also as per need like left, right, top, bottom.


single property


						        
<!DOCTYPE html>
<html>
<head>
   <title>css tutorial</title>
<style>
h1{
   color: red;
   font-size: 40px;
   display: block;
   border: 1px solid #000;
   margin-left: 20px;
   margin-right: 20px;
   margin-top: 20px;
   margin-bottom: 20px;
}
</style>
</head>
<body>
   <h1>my car</h1>
</body>
</html>


Run

Our Content