CSS3 Cheatsheet - CSS3 Properties & Layout Reference

For developers who write CSS by hand and want structured, responsive styling. The core skill is not memorizing every property but reasoning about the cascade, the box model, and when Flexbox versus Grid saves you layout pain. By the end you can center and align layouts confidently, build a responsive two-column page, and add purposeful transitions instead of guessing.

Web Services·47 commands·Last updated 2026-07-21

Selectors 8

.class
Class selector
#id
ID selector
div p
Descendant selector
div > p
Child selector
a:hover
Hover pseudo-class
::before / ::after
Pseudo-elements
[type="text"]
Attribute selector
nth-child(2n)
Even-child selector

Box Model 6

width / height
Content box size
padding
Inner spacing
border
Border
margin
Outer spacing
box-sizing: border-box
Include border & padding in size
border-radius
Rounded corners

Layout 8

display: block
Block-level box
display: inline-block
Inline but sizeable
display: flex
Flex container
display: grid
Grid container
display: none
Hide element (no box)
position: relative / absolute / fixed
Positioning context
float: left / right
Float
z-index
Stacking order

Colors & Background 7

color
Text color
background
Background shorthand
background-image: url()
Background image
background-size: cover
Cover container
opacity
Element transparency
box-shadow
Drop shadow
linear-gradient()
Gradient background

Text 6

font-size
Font size
font-weight
Font weight
text-align
Horizontal alignment
line-height
Line spacing
letter-spacing
Character spacing
white-space: nowrap
No wrapping

Transitions & Animations 6

transition: all 0.3s
Smooth transition
transform: translateX(10px)
Translate
transform: scale(1.2)
Scale
transform: rotate(45deg)
Rotate
@keyframes name { 0% {} 100% {} }
Define animation
animation: name 1s infinite
Apply animation

Responsive 6

@media (max-width: 768px) { }
Media query
max-width: 100%
Max width
min-width: 0
Min width
vw / vh / vmin / vmax
Viewport units
rem / em
Relative units
clamp(1rem, 2vw, 2rem)
Responsive value clamp

Tips

  • box-sizing: border-box makes width/height include border and padding — more intuitive.
  • Flex fits one-dimensional layouts (row or column); Grid fits two-dimensional (rows and columns together).
  • Mobile-first: write small-screen styles first, then extend with @media (min-width).

Official References

Each command links to its official documentation below, so you can verify the latest usage and read deeper.

Maintained by LaoHand

Publicly updated on Jul 21, 2026, continuously proofread against official docs.

Contact Us

Wrong command or description? Send us corrections, business inquiries or product feedback by email.

Contact Us