WHAT IS PADDING IN CSS (CASCADING STYLE SHEET) AND HOW TO USE IT ?

Abhishek Srivasatava

Total Post:70

Points:350
Posted by  Abhishek Srivasatava
CSS 
 328  View(s)
Ratings:
Rate this:
  1. Abhishek Srivasatava

    Post:70

    Points:350
    What is Padding in CSS (Cascading style Sheet) and how to use it ?

    It is to control the spaces around the content.

    there is two way by which we can declare this property:

    1st method

    p {
        padding-top: 80px;     padding-right: 60px;     padding-bottom: 40px; 
        padding-left: 10px;
        }
     

    2nd method

    p {
    padding: 50px 20px 80px 60px;
    }

    In the above example, if there is only three value. For example 

    p {
    padding: 50px 20px 80px;
    }

    Then top value will be  50px

    Left –right  value will be  20px

    And button 80px

    if there is only two value. for example

     p {
        padding: 50px 20px;
    }

    Then top & bottom value will be 50px

    And Left –right  value will be  20px

    If there is only one value. for example

    p {
        padding: 50px;
      }

    Then top bottom Left & right all have value 50px.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!