🎨

CSS3 Cheatsheet

Selectors

*
Selects all elements
.class
Selects all elements with class="class"
#id
Selects the element with id="id"
element
Selects all <element> elements
element, element
Selects all matching elements

Box Model

width
Sets the width of an element
height
Sets the height of an element
padding
Space between content and border
border
Border around the element
margin
Space outside the border

Text

color
Sets the color of text
text-align
Aligns the text (left, right, center)
text-decoration
Decorates text (none, underline)
font-family
Specifies the font family for text
font-size
Specifies the font size of text

Flexbox

display: flex;
Enables flexbox layout
flex-direction
Specifies the direction of flex items
justify-content
Aligns items horizontally
align-items
Aligns items vertically