CSS Padding-left

Please Share On:

Definition:

CSS padding-left applies padding to element’s left inside the defined border.

Syntax:

padding-left: 10px;

Source Code:

See the below example without and with padding-right property.

<!DOCTYPE html>
<html>
<head>
<style>
.paragraph1{
  border: 2px dashed red;
  background-color: pink;
  text-align:center;
}

.paragraph2{
  border: 2px dashed red;
  background-color: orange;
  text-align:center;
  padding-left: 10px;
}
</style>
</head>
 
<body>
<div class="paragraph1">This is a first paragraph without padding-left property; 
<div class="paragraph2">This is a second paragraph with Padding-left is 10px from the defined border; </div>
  
</body>
</html>

Output:



You may be interested in the following topics:

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright @2023. All Right Reserved.


Social media & sharing icons powered by UltimatelySocial