Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

W3.CSS Padding


w3-padding-large

I have 12px top and bottom padding and 24px left and right padding.


W3.CSS Padding Number Classes

The w3-padding-number classes add top and bottom padding to any HTML element:

Class Defines
w3-padding-16 Adds 16px top and bottom padding to an element
w3-padding-24 Adds 24px top and bottom padding to an element
w3-padding-32 Adds 32px top and bottom padding to an element
w3-padding-48 Adds 48px top and bottom padding to an element
w3-padding-64 Adds 64px top and bottom padding to an element

Examples:

w3-padding-16

I have 16px top and bottom padding

w3-padding-24

I have 24px top and bottom padding

w3-padding-32

I have 32px top and bottom padding

w3-padding-48

I have 48px top and bottom padding

w3-padding-64

I have 64px top and bottom padding

Example

<div class="w3-panel w3-padding-16">
  <p>I have 16px top and bottom padding.</p>
</div>
Try It Yourself »


W3.CSS Padding Size Classes

The w3-padding-size classes add top, bottom, right, and left padding to any HTML element:

Class Defines
w3-padding Adds 8px top and bottom, and 16px left and right padding
w3-padding-small Adds 4px top and bottom, and 8px left and right padding
w3-padding-large Adds 12px top and bottom, and 24px left and right padding

Examples:

w3-padding-small

I have 4px top and bottom padding and 8px left and right padding.

w3-padding

I have 8px top and bottom padding and 16px left and right padding.

w3-padding-large

I have 12px top and bottom padding and 24px left and right padding.

Example

<div class="w3-panel w3-padding-large">
  <p>I have 12px top and bottom padding and 24px left and right padding.</p>
</div>
Try It Yourself »

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
[email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
[email protected]

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.