welcome to tutorialfamily

css-padding

css padding used for applying space to element.

Padding work as a spacing inside area of element.


css padding

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


css padding


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


Run

css padding single property

we apply padding 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;
   padding-left: 20px;
   padding-right: 20px;
   padding-top: 20px;
   padding-bottom: 20px;
}
</style>
</head>
<body>
   <h1>my car</h1>
</body>
</html>


Run

Our Content