Use of margin property in CSS
{margin-left : 20px;}
property value
<body>
<p type="submit" style="color:rgb(255, 255, 255);background-color: red;">
theDeveloperBrains Tutorial
</p>
<p type="submit" style="color:rgb(255, 255, 255);background-color: red;margin-left:50px">
theDeveloperBrains Tutorial
</p>
</body>
CSS3 margin property specifies a Shorthand property (all padding properties in one declaration)
<!DOCTYPE html>
<html>
<head>
<style>
.tdb-school{color:black;background-color:white;
margin:10px 35px 10px 35px;
padding:10px 20px;
border:none;
border-radius:5px}
.top{margin-top:50px}
.right{margin-right:50px}
.bottom{margin-bottom:50px}
.left{margin-left:50px}
div{background-color:black;
margin-bottom:5px}
</style>
</head>
<!--Body-->
<body>
<div><button type="submit" class="tdb-school margin">margin</button></div>
<div><button type="submit" class="tdb-school top">margin</button></div>
<div><button type="submit" class="tdb-school right">margin</button></div>
<div><button type="submit" class="tdb-school bottom">margin</button></div>
<div><button type="submit" class="tdb-school left">margin</button></div>
</body>
</html>
{margin : 10px 10px 10px 10px;}
property top right bottom left
<!DOCTYPE html>
<html>
<head>
<style>
.tdb-school{
color:black;
background-color:white;
padding:20px 20px 20px 20px;
margin:20px 20px 20px 20px;
border:none;
border-radius:5px;
}
div{background-color:black}
</style>
</head>
<;!--Body-->
<body>
<div>
<button type="submit" class="tdb-school padding">
Padding
</button>
<;/div>
<br><br>
</body>
</html>
Share TDB SCHOOL
Share this E-Learning Website on social media platforms with your friends and followers