CSS Margin and Padding Tutorial
HTML source code
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="style2.css">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div class="main">
<h1>Coding Discussion</h1>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Qui commodi sit dolorum facilis, iure molestias error amet pariatur voluptate est voluptates, culpa vitae neque cum nihil mollitia cumque delectus obcaecati?</p>
</div>
<h2 id="main">Coding Discussion</h2>
</body>
</html>
CSS source code
.main{
background-color: lightcoral;
}
h1{
padding: 25px;
}
p{
padding: 10px;
}
#main{
background-color: lightgreen;
/* padding-top: 20px;
padding-left: 30px;
margin: 20px; */
border: 3px solid red;
/* padding: top right bottom left; */
padding: 50px 10px 20px 30px;
margin: 5px 10px 20px 30px;
}
0 Comments
If you have any question , then please ask me