Padding is a property used in CSS to fix the content of the division at a particular distance from the borders.
Lets take up a simple example :
Lets take up a simple example :
.padd{
border:3px solid red;
}
A bit altered :
border:3px solid red;
}
The above code's result will be like this.
.padd{
border:3px solid red;
padding:10px;
}
border:3px solid red;
padding:10px;
}
The above code's result will be like this. Here the content is 10px away from each border.
.padd{
border:3px solid red;
padding:20px 10px;
}
Therefore,
padding has four attributes :border:3px solid red;
padding:20px 10px;
}
The above code's result will be like this. Here the content is 10px away from left and right borders and 20px away from top and bottom borders. Changing the places of 10 and 20 px in the code would get a reverse effect.
- padding-top
- padding-bottom
- padding-left
- padding-right
No comments :
Post a Comment