margin with Div tag in HTML and CSS

margin with Div tag in HTML and CSS
--------------------------------------------------
<html>
<head>
<style>
.xyz {
  border: 2px solid red;
  margin-top: 100px;
  margin-bottom: 100px;
  margin-right:350px;
  margin-left: 90px;
  background-color: lightblue;
  padding: 2%;
}

.batch{
 /* border: 2px solid red;*/
  margin-top: 300px;
  margin-bottom: 100px;
  margin-right:350px;
  margin-left: 90px;
  /*background-color: lightblue;*/
  padding: 2%;
}

</style>
</head>
<body>

<h2>Using individual margin properties</h2>

<div class="xyz">
<h1>head</h1>
<p>hello</p>
<img src="updated.jpg" width="25px" height="15px">

</div>

<div class="batch">
<h1>demo</h1>
<p>hello</p>
<img src="updated.jpg" width="25px" height="15px">

</div>


</body>
</html>

0 Comments