What does padding do in the HTML page?

Query By: AJAY SINGH

A

Anurag

Technically padding created an inner border around the elements, it seems like there is a defined gap around the element with respect to other elements. Padding can be defined based on sides line top, bottom, left, and right. 

for example - 

<div class="div1">

   <div class="div2"></div>

</div>


<style type="text/css">

 .div1

{

width:400px;

height:300px;

background-color:red;

padding-left:100px;

padding-top:70px;

}

 .div12

{

width:200px;

height:160px;

background-color:blue;

}

</style>


Result - in the above example div2 will appear 70px away from top and 100px away from left from in div1

0 votes

Your Answer

Email Us: advertise@gdatamart.com

Donate Us: Support to GDATAMART

LifeStyle & Fun

© 2024 GDATAMART.COM (All Rights Reserved)