Tailwind CSS
Display
-
box sizing
<div className="box-border h-32 w-32 p-4 border-4 ...">
<!-- ... -->
</div>
| Class | Properties |
|---|
box-border | box-sizing: border-box; |
box-content | box-sizing: content-box; |
-
display
<div>
When controlling the flow of text, using the CSS property
<span className="inline">display: inline</span>
will cause the text inside the element to wrap normally.
While using the property <span className="inline-block">display: inline-block</span>
will wrap the element to prevent the text inside from extending beyond its parent.
Lastly, using the property <span className="block">display: block</span>
will put the element on its own line and fill its parent.
</div>
| Class | Properties |
|---|
block | display: block; |
inline-block | display: inline-block; |
inline | display: inline; |
flex | display: flex; |
inline-flex | display: inline-flex; |
grid | display: grid; |
Flexbox
<div className="flex justify-center">
<div>01</div>
<div>02</div>
<div>03</div>
</div>
| Class | Properties |
|---|
justify-normal | justify-content: normal; |
justify-start | justify-content: flex-start; |
justify-end | justify-content: flex-end; |
justify-center | justify-content: center; |
justify-between | justify-content: space-between; |
justify-stretch | justify-content: stretch; |
<div className="h-56 grid grid-cols-3 gap-4 content-center">
<div>01</div>
<div>02</div>
<div>03</div>
<div>04</div>
<div>05</div>
</div>
| Class | Properties |
|---|
content-normal | align-content: normal; |
content-center | align-content: center; |
content-start | align-content: flex-start; |
content-end | align-content: flex-end; |
content-between | align-content: space-between; |
content-stretch | align-content: stretch; |
<div className="flex items-center">
<div className="py-4">01</div>
<div className="py-12">02</div>
<div className="py-8">03</div>
</div>
| Class | Properties |
|---|
items-start | align-items: flex-start; |
items-end | align-items: flex-end; |
items-center | align-items: center; |
items-baseline | align-items: baseline; |
items-stretch | align-items: stretch; |
Backgrounds
Borders
Interactivity
<button type="button" className="cursor-pointer">
Submit
</button>
| Class | Properties |
|---|
cursor-auto | cursor: auto; |
cursor-default | cursor: default; |
cursor-pointer | cursor: pointer; |