Skip to content
CSS Reference — Complete Cheat Sheet, Properties & Browser Support

CSS Reference — Complete Cheat Sheet, Properties & Browser Support

DodaTech Updated Jun 6, 2026 9 min read

This is your complete CSS reference — a cheat sheet of selectors, properties, units, and tools for quick lookup. Bookmark this page and come back whenever you need to remember a syntax.

What You’ll Find

By the end of this reference, you’ll have a comprehensive catalog of CSS selectors (including modern ones like :has() and :is()), layout and box model properties, typography properties (font-family, font-size, text-align), animation properties, all CSS units, browser support for major features, and an overview of CSS frameworks and preprocessors (Sass, Less, PostCSS).

Prerequisite: This is a reference page — it assumes you already know CSS. Review the full CSS tutorial series if you’re a beginner.

Where This Fits

    flowchart LR
    A["All CSS Tutorials"] --> B["**CSS Reference**"]
    B --> C["Frameworks & Libraries"]
    C --> D["Frontend-Ready Developer"]
    style B fill:#f97316,stroke:#c2410c,color:#fff
    style A fill:#e5e7eb,stroke:#9ca3af,color:#374151
    style D fill:#22c55e,stroke:#16a34a,color:#fff
  

CSS Selectors Cheat Sheet

SelectorExampleWhat It Targets
** { }Every element
elementp { }All <p> elements
.class.card { }Elements with class="card"
#id#header { }Element with id="header"
[attr][disabled] { }Elements with that attribute
[attr="v"][type="text"] { }Exact attribute match
[attr^="v"][href^="https"] { }Attribute starts with value
[attr$="v"][src$=".jpg"] { }Attribute ends with value
[attr*="v"][class*="btn"] { }Attribute contains value anywhere
:hovera:hover { }Mouse is over the element
:focusinput:focus { }Element is focused (any method)
:focus-visiblebutton:focus-visible { }Focused via keyboard only
:nth-child(n)li:nth-child(2) { }Nth child of its parent
:nth-of-type(n)p:nth-of-type(2) { }Nth of that element type
:first-childli:first-child { }First child
:last-childli:last-child { }Last child
:not():not(.hidden) { }Negation
:has().card:has(img) { }Parent containing a child matching selector
:is():is(h1, h2) { }Group (forgiving)
:emptydiv:empty { }Element with no children
::before.note::before { }Insert content before element
::after.note::after { }Insert content after element
::placeholderinput::placeholder { }Placeholder text
::selection::selection { }User-selected text
(space)div p { }Descendant (any depth)
>div > p { }Direct child
+h2 + p { }Adjacent sibling
~h2 ~ p { }General sibling
,h1, h2, h3 { }Group multiple selectors

Properties Quick Reference

Layout

PropertyCommon Values
displayblock, inline, inline-block, flex, grid, none, contents
positionstatic, relative, absolute, fixed, sticky
top, right, bottom, left<length>, auto
z-index<number>
floatleft, right, none
clearleft, right, both, none
overflowvisible, hidden, scroll, auto, clip
overflow-x, overflow-yvisible, hidden, scroll, auto

Box Model

PropertyCommon Values
width, height<length>, auto, min-content, max-content, fit-content
min-width, max-width<length>
min-height, max-height<length>
padding<size> (shorthand: top, right, bottom, left)
margin<size>, auto
border<width> <style> <color>
border-radius<size> (up to 4 values for each corner)
box-sizingcontent-box, border-box

Typography

PropertyCommon Values
font-family<font-name>, serif, sans-serif, monospace, system-ui
font-size<size>, small, medium, large, larger, smaller
font-weightnormal, bold, 100-900
font-stylenormal, italic, oblique
line-height<number>, <length>, normal
text-alignleft, center, right, justify
text-decorationnone, underline, line-through, overline
text-transformuppercase, lowercase, capitalize, none
color<color>
letter-spacing<length>
word-spacing<length>
white-spacenormal, nowrap, pre, pre-wrap, pre-line
word-breaknormal, break-all, keep-all

Background & Visual

PropertyCommon Values
backgroundShorthand: <color> <image> <repeat> <position> / <size> <attachment>
background-color<color>, transparent
background-imageurl(...), linear-gradient(...), radial-gradient(...)
background-sizeauto, cover, contain, <length>
background-positioncenter, top left, <x> <y>
background-repeatno-repeat, repeat, repeat-x, repeat-y
box-shadow<x> <y> <blur> <spread> <color>, inset ...
text-shadow<x> <y> <blur> <color>
opacity0 to 1
filterblur(), brightness(), grayscale(), sepia(), saturate(), hue-rotate()
clip-pathcircle(), polygon(), inset(), url(...)

Flexbox

PropertyCommon Values
displayflex
flex-directionrow, row-reverse, column, column-reverse
flex-wrapnowrap, wrap, wrap-reverse
flex-flowShorthand: <direction> <wrap>
justify-contentflex-start, center, flex-end, space-between, space-around, space-evenly
align-itemsstretch, center, flex-start, flex-end, baseline
align-contentstretch, center, flex-start, flex-end, space-between, space-around
gap<size>
flexShorthand: <grow> <shrink> <basis>
flex-grow<number>
flex-shrink<number>
flex-basis<length>, auto
align-selfauto, stretch, center, flex-start, flex-end, baseline
order<number>

Grid

PropertyCommon Values
displaygrid
grid-template-columns<sizes>, repeat(n, size), auto-fill, auto-fit
grid-template-rows<sizes>
grid-template-areas"header header" "sidebar main"
gap<row-gap> <column-gap>
grid-column<start> / <end>
grid-row<start> / <end>
grid-area<name>, or <row-start> / <col-start> / <row-end> / <col-end>
place-items<align> <justify>
place-content<align> <justify>
place-self<align> <justify>

Animation

PropertyCommon Values
transitionShorthand: <property> <duration> <timing> <delay>
transition-propertyall, opacity, transform, background, color
transition-duration<time> (0.3s, 200ms)
transition-timing-functionease, linear, ease-in, ease-out, ease-in-out, cubic-bezier(n,n,n,n)
transformtranslate(x, y), rotate(deg), scale(n), skew(deg)
transform-origincenter, top left, <x> <y>
animationShorthand: <name> <duration> <timing> <delay> <count> <direction> <fill-mode>
animation-name@keyframes name
animation-duration<time>
animation-iteration-count<number>, infinite
animation-directionnormal, reverse, alternate, alternate-reverse
animation-fill-modenone, forwards, backwards, both
animation-play-staterunning, paused

CSS Units

UnitRelative ToBest For
pxScreen pixelBorders, small offsets, shadows
%Parent elementWidths, heights, padding/margin based on parent
emCurrent element’s font-sizePaddings that scale with text size
remRoot (<html>) font-sizeFont sizes, spacing, consistent across page
vwViewport width (1vw = 1%)Full-width sections, hero layouts
vhViewport height (1vh = 1%)Full-screen sections, sticky elements
vminSmaller viewport axisResponsive sizing that respects orientation
vmaxLarger viewport axisResponsive sizing
chWidth of “0” characterLine length limits (max-width: 60ch for readability)
frAvailable space in gridGrid track sizing
pt1pt = 1/72 inchPrint stylesheets

Browser Support

FeatureChromeFirefoxSafariEdgeNotes
FlexboxOld Safari needs -webkit-
GridIE11 partial
CSS VariablesNot in IE11
Container Queries105+110+16+105+Modern feature
:has()105+121+15.4+105+Parent selector
@property85+128+15.4+85+Houdini
backdrop-filter76+103+12.1+76+Glass effects
scroll-snapWell supported
subgrid117+71+16+117+Partial
aspect-ratioWell supported
accent-color93+92+15.4+93+Form controls

Check latest support at caniuse.com.


CSS Frameworks

FrameworkApproachBest For
BootstrapUtility + component classesRapid prototyping, consistent UI
Tailwind CSSUtility-firstCustom designs, small bundles
BulmaFlexbox-based, semanticClean, modern designs
FoundationResponsive frameworkEnterprise sites, email
Pure CSSMinimal, tinySmall projects
Open PropsDesign tokensCustom design systems

CSS Preprocessors

Sass / SCSS

$primary: #3498db;
$spacing: 16px;

.card {
  background: white;
  padding: $spacing;

  .title {
    color: $primary;
    font-size: 1.25rem;
  }

  &:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
}

Less

@primary: #3498db;

.card {
  background: white;

  .title { color: @primary; }
}

PostCSS

A tool for transforming CSS with plugins — Autoprefixer, nesting, future CSS syntax.


Common Mistakes Beginners Make

1. Skipping the Fundamentals

Many beginners jump straight to advanced topics without mastering the basics. Take time to understand the core concepts before moving on.

2. Not Practicing Enough

Reading tutorials without writing code leads to shallow understanding. Code along with every example and experiment on your own.

3. Ignoring Error Messages

Error messages tell you exactly what went wrong. Read them carefully — they usually point to the line and type of issue.

4. Copy-Pasting Without Understanding

It’s tempting to copy code from tutorials, but typing it yourself and understanding each line builds real skill.

5. Giving Up Too Early

Every developer hits frustrating bugs. Take breaks, ask for help, and remember that struggling is part of learning.

Practice Questions

Q1: What’s the difference between :nth-child and :nth-of-type?

:nth-child(2) selects the second child regardless of element type. :nth-of-type(2) selects the second element of that specific type.

Q2: Which units are best for responsive font sizes?

rem for consistent sizing across the page. clamp(min, preferred, max) for fluid typography. em for sizes relative to the current element.

Q3: What does box-sizing: border-box do?

Makes width and height include padding and border in their calculation, so a 100px-wide element stays 100px regardless of padding.

Q4: What’s the difference between transition and animation?

transition animates between two states (triggered by hover, focus, etc.). animation with @keyframes can define multiple steps and loop.

Q5: What’s a CSS preprocessor?

A tool that extends CSS with variables, nesting, mixins, and functions. Sass (SCSS) and Less are the most popular. They compile to standard CSS.


FAQ

{< faq >}

What is Css Reference?
Css Reference refers to the core concepts and practices used to build and manage modern web applications. Understanding it is essential for web developers.
Do I need prior experience to learn Css Reference?
Basic familiarity with web development concepts helps, but Css Reference can be learned step by step even as a beginner.
How long does it take to learn Css Reference?
With consistent practice, you can grasp the fundamentals in a few days to a week. Mastery takes ongoing practice and real-world projects.
Where can I use Css Reference in real projects?
Css Reference is used in a wide range of applications — from simple websites to complex enterprise systems, depending on the specific tools and technologies involved.
What are common tools used with Css Reference?
The specific tools depend on the technology stack, but version control (Git), package managers, and testing frameworks are commonly used alongside most development topics.

{< /faq >}

FAQ

What is Reference in CSS?
: Reference refers to the CSS properties and techniques used to control how elements are displayed on a webpage. Mastering it helps you build better, more responsive layouts.
Do I need to memorize all CSS properties?
: No. Focus on understanding the core concepts and use reference docs when needed. Practice is more important than memorization.
How do I debug Reference issues?
: Use browser DevTools (F12) to inspect elements, check computed styles, and experiment with values in real time.
Is Reference the same across all browsers?
: Most modern browsers support CSS standards consistently, but always test across browsers for edge cases.
What’s the best way to practice Reference?
: Build small projects and experiment with different values. Use online playgrounds like CodePen or JSFiddle for quick testing.

What’s Next?

You’ve completed the CSS module! Continue to:

What’s Next

Congratulations on completing this Css Reference tutorial! Here’s where to go from here:

  • Practice daily — Consistency is more important than long study sessions
  • Build a project — Apply what you learned by building something real
  • Explore related topics — Check out other tutorials in the same category
  • Join the community — Discuss with other learners and share your progress

Remember: every expert was once a beginner. Keep coding!

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro