mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
3.2 KiB
3.2 KiB
| extends | title |
|---|---|
| _layouts.markdown | Padding |
Padding
Using
The syntax below is combined to create a system for padding and margins. For example, .pt-2 would add padding to the top of the element to the value of 0.5rem and .mx-0 would make the horizontal margin zero.
Class
p Paddingm Marginpull Negative MarginPosition (optional)
t Topr Rightb Bottoml Leftx Horizontaly VerticalSpace
0 01 0.25rem2 0.5rem3 0.75rem4 1rem6 1.5rem8 2remCustomizing the spacing scale
You can customize the margin and padding utilities using the @sizing-scale variable. Please note that the entire scale must be redefined. It's not possible to add a new value to the existing scale.
// Scale customization here
Responsive spacing utilities
The spacing utilities can also be used with responsive prefixes:
<div class="p-1 sm:p-2 md:p-3 lg:p-4"></div>
<div class="m-1 sm:m-2 md:m-3 lg:m-4"></div>
<div class="pull-1 sm:pull-2 md:pull-3 lg:pull-4"></div>
// Responsive example here