CSS Padding



css padding property is used to add some space between the elements content and the elements border its called csss padding.

CSS Padding Properties

css padding

individual padding properties are ca be declared.

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

Example

<!DOCTYPE html>  
    <html>  
    <head>  
    <style>  
    p {  
        background-color: lightblue;  
    }  
    p.padding {  
        padding-top: 50px;  
        padding-right: 100px;  
        padding-bottom: 150px;  
        padding-left: 200px;  
    }  
    </style>  
    </head>  
    <body>  
    <p>This is a paragraph with no specified padding.</p>  
    <p class="padding">This is a paragraph with specified paddings.</p>  
    </body>  
    </html>  
    
     
    


Click on the "Run This Code" button to see how it works.




CSS

Welcome CSS Syntax CSS Selectors CSS ADD css CSS Borders CSS Backgrounds CSS Colors CSS Padding CSS Margin CSS Fonts CSS Text CSS Outline CSS Box-Model CSS Height&Width CSS Icons CSS Links CSS Lists CSS Display CSS Tables CSS Position CSS Overflow CSS Align CSS Float CSS Inline-block CSS Opacity CSS Image-Gallery CSS Navigation Bar CSS Dropdowns CSS Cursors CSS Forms CSS Pseudo-classes CSS Pseudo-elements

CSS3 FEATURES

CSS Gradients CSS shadows CSS 2D Transforms CSS 3D Transforms CSS Animations CSS Media Queries CSS Flexbox CSS important CSS Units