The CSS padding properties are used to generate space around content.The padding clears an area around the content (inside the border) of an element.





Individual Sides in padding:-

CSS has properties for specifying the padding for each side of an element are as follows:-
  1. padding-top
  2. padding-right
  3. padding-bottom
  4. padding-left
All the padding properties can have the following values:-

  1. length - specifies a padding in px
  2. % - specifies a padding in %
  3. inherit - specifies that the padding should be inherited from the parent element
The following example sets different padding for all sides of a <p> element:-

{
    padding-top: 50px;
    padding-right: 30px;
    padding-bottom: 50px;
    padding-left: 80px;
}

Shorthand Property:-

To shorten the code, it is possible to specify all the padding properties in one property.The padding property is a shorthand property for the following individual padding properties:

padding-top padding-right padding-bottom padding-left


Example:-

{
    padding: 50px 30px 50px 80px;
}

All CSS Padding Properties:-


PropertyDescription
paddingA shorthand property for setting all the padding properties in one declaration
padding-bottomSets the bottom padding of an element
padding-leftSets the left padding of an element
padding-rightSets the right padding of an element
padding-topSets the top padding of an element

IF you have any question about this lecture you can comment blow. feel free to contact me.

0 comments:

Post a Comment

Thanks

 
Blogger Templates1 school © 2013. All Rights Reserved. Powered by Blogger
Top