CSS GUIDE · 35 SECTIONS · CHEAT SHEET

All essential properties of CSS3 with examples

Comprehensive interactive CSS reference manual for fast development: typography, spacing, positioning, Flexbox, Grid, responsiveness, and keyframe animations. Instant search and 1-click snippet copy.

35 SECTIONS
120+ PROPERTIES & RULES
Showing: 35 of 35 sections Press / for quick search focus
🔍

Nothing Found

No matching CSS properties found. Try adjusting your search query or reset the filters.

Typography

🅰️ Font

style.css CSS3
font-family: Arial, sans-serif; /* font family */
font-weight: bold; /* font weight: normal | bold | 100–900 */
font-style: italic; /* italic */
font-variant: small-caps; /* small caps */
Typography

📏 Text Size & Scale

style.css CSS3
font-size: 16px; /* font size */
line-height: 1.5; /* line height */
letter-spacing: 0.5px; /* letter spacing */
word-spacing: 2px; /* word spacing */
Typography

🎨 Color & Styling

style.css CSS3
color: black; /* text color: #ffffff */
text-shadow: 2px 2px 5px gray; /* text shadow */
Typography

📍 Alignment & Formatting

style.css CSS3
text-align: center; /* alignment: left | right | center | justify */
text-indent: 30px; /* first line indent */
text-transform: uppercase; /* text transform: uppercase | lowercase | capitalize */
direction: rtl; /* text direction: ltr (left to right), rtl (right to left) */
white-space: nowrap; /* prevent line wrap */
Typography

🔗 Link Styling & Underlines

style.css CSS3
text-decoration: underline; /* decoration: none | underline | line-through | overline */
text-decoration-color: red; /* decoration color */
text-decoration-style: wavy; /* decoration style: solid | double | dotted | dashed | wavy */
Flexbox

🔧 Flexbox

style.css CSS3
display: flex; /* enable flex container */
flex-direction: row; /* direction: row | column | row-reverse | column-reverse */
flex-wrap: wrap; /* wrap: nowrap | wrap | wrap-reverse */
justify-content: center; /* horizontal alignment: flex-start | flex-end | center | space-between | space-around | space-evenly */
align-items: center; /* vertical alignment: stretch | flex-start | flex-end | center | baseline */
align-content: space-between; /* multi-line alignment (on wrap) */
gap: 10px; /* gap between elements */
Flexbox

🧩 Child Elements (Items)

style.css CSS3
flex-grow: 1; /* flex grow — growth factor (1 = evenly) */
flex-shrink: 0; /* flex shrink — shrink factor */
flex-basis: 100px; /* base size */
flex: 1 1 100px; /* shorthand: grow shrink basis */
align-self: center; /* self alignment */
order: 2; /* display order */
Flexbox

💡 Usage Example (Flexbox)

style.css CSS3
.container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
Selectors

🧠 Pseudo-classes & Pseudo-elements

style.css CSS3
:hover        /* on hover */
:active       /* on active / click */
:focus        /* on focus (e.g. in input) */
:visited      /* visited link */
:checked      /* checked checkbox/radio */
:disabled     /* disabled element */
:enabled      /* enabled element */
:required     /* required form field */
:valid        /* valid form value */
:invalid      /* invalid */
Selectors

🔁 Logical & Positional Selectors

style.css CSS3
:first-child  /* first child of parent */
:last-child  /* last */
:nth-child(2) /* second */
:nth-child(odd) /* odd */
:not(.disabled) /* all except .disabled */
:has(input) /* if it contains an input (browser support varies) */
:empty /* empty element */
Selectors

🧩 Pseudo-elements

style.css CSS3
::before {
  content: ";★ ";;
  color: gold;
}

::after {
  content: "; →";;
  color: gray;
}
Selectors

💡 Usage Example (Selectors)

style.css CSS3
a:hover::after {
  content: "; (link)";;
  color: gray;
}
Colors & Background

🎨 Colors, Background & Borders

style.css CSS3
background-color: #f5f5f5; /* background color */
opacity: 0.8; /* opacity (0 — fully transparent, 1 — fully visible) */
Colors & Background

🖼 Background

style.css CSS3
background-image: url(";image.jpg";); /* background image */
background-size: cover; /* scaling: cover | contain */
background-repeat: no-repeat; /* repeat: repeat | no-repeat */
background-position: center center; /* position */
background-attachment: fixed; /* attachment: scroll | fixed */
Colors & Background

⏹ Borders

style.css CSS3
border: 1px solid black; /* shorthand property */
border-width: 2px; /* width / thickness */
border-style: dashed; /* style: solid | dashed | dotted | double | none */
border-color: red; /* color */
border-radius: 8px; /* border radius */
Colors & Background

📦 Shadow

style.css CSS3
box-shadow: 2px 2px 5px rgba(0,0,0,0.3); /* box shadow */
CSS Grid

🧱 CSS Grid

style.css CSS3
display: grid; /* enable grid */
grid-template-columns: 1fr 2fr; /* column widths: px, %, fr */
grid-template-rows: auto 100px; /* row heights */
grid-template-areas: /* named template areas */
  "header header"
  "sidebar main";

grid-gap: 10px; /* gap between rows and columns */
column-gap: 10px; /* column gap only */
row-gap: 20px; /* row gap only */
justify-items: center; /* horizontal alignment of cell content */
align-items: start; /* vertical */
CSS Grid

📦 Child Elements (Items)

style.css CSS3
grid-column: 1 / 3; /* start to end column (or span: span 2) */
grid-row: 2 / 4; /* similarly — rows */
grid-area: header; /* grid area placement */
justify-self: end; /* horizontal element alignment */
align-self: center; /* vertical alignment */
CSS Grid

💡 Usage Example (CSS Grid)

style.css CSS3
.container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
Responsive Design

📱 Responsive Design & Media Queries

style.css CSS3
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }
}
Responsive Design

🔍 Common Conditions

style.css CSS3
(min-width: 600px) /* from 600px and up */
(max-width: 1024px) /* up to 1024px */
(orientation: landscape) /* landscape orientation */
(pointer: coarse) /* coarse pointer devices (touch) */
Responsive Design

💻 Combining Conditions

style.css CSS3
@media (min-width: 768px) and (max-width: 1024px) {
  .menu {
    display: none;
  }
}
Cursors & Interaction

🧭 Navigation & Cursors

style.css CSS3
a {
  text-decoration: none; /* remove text decoration */
  color: inherit; /* inherit color */
  cursor: pointer; /* "pointer" cursor */
}
button {
  border: none; /* remove border */
  background: transparent; /* remove background */
  cursor: pointer;
}
Cursors & Interaction

🖱️ Cursor Types

style.css CSS3
cursor: pointer; /* pointer (on clickable elements) */
cursor: default; /* default cursor */
cursor: text; /* text cursor (I-beam) */
cursor: move; /* "move" cursor */
cursor: not-allowed; /* not-allowed */
cursor: grab; /* grabbing hand */
Sizes & Spacing

📐 Sizes, Spacing & Positioning

style.css CSS3
width: 200px; /* width */
height: 100px; /* height */
min-width: 100px; /* minimum width */
max-width: 500px; /* maximum width */
box-sizing: border-box; /* includes padding and border in width/height */
Sizes & Spacing

📦 Inner Spacing (Padding)

style.css CSS3
padding: 10px; /* padding on all sides */
padding: 10px 20px; /* top/bottom, left/right */
padding: 10px 15px 5px 20px; /* top, right, bottom, left */
Sizes & Spacing

📤 Outer Spacing (Margin)

style.css CSS3
margin: 0 auto; /* centered horizontally */
margin: 10px; /* all sides */
margin: 10px 20px; /* top/bottom, left/right */
margin: 10px 15px 5px 20px; /* top, right, bottom, left */
Sizes & Spacing

📌 Positioning

style.css CSS3
position: static; /* default */
position: relative; /* relative to normal position */
position: absolute; /* absolute (inside parent with relative/absolute) */
position: fixed; /* fixed to viewport */
position: sticky; /* "sticks" on scroll */
top: 10px; left: 20px; /* offsets */
z-index: 10; /* stacking order */
Sizes & Spacing

🧱 Display & Element Type

style.css CSS3
display: block; /* block element */
display: inline; /* inline element */
display: inline-block; /* inline-block element */
display: none; /* hide element */
visibility: hidden; /* hide but preserve layout space */
Sizes & Spacing

🧮 Overflow

style.css CSS3
overflow: visible; /* default */
overflow: hidden; /* clip overflow */
overflow: scroll; /* always show scrollbar */
overflow: auto; /* show scrollbar when needed */
Animations & Effects

🎞️ Animations & Transitions

style.css CSS3
transition: all 0.3s ease; /* property, duration, timing function */
transition-property: color, background; /* properties to animate */
transition-duration: 0.5s;
transition-timing-function: ease-in-out; /* timing: linear | ease | ease-in | ease-out | cubic-bezier(...) */
transition-delay: 0.2s; /* delay */
Animations & Effects

💡 Usage Example (Animations & Effects)

style.css CSS3
button {
  transition: background-color 0.3s ease;
}
button:hover {
  background-color: red;
}
Animations & Effects

🎬 Animations (@keyframes + animation)

style.css CSS3
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.element {
  animation-name: fadeIn;
  animation-duration: 1s;
  animation-delay: 0.2s;
  animation-iteration-count: infinite; /* or 1 */
  animation-direction: alternate; /* normal | reverse | alternate */
  animation-timing-function: ease-in;
  animation-fill-mode: forwards; /* forwards fill mode */
}

animation: fadeIn 1s ease-out forwards; /* shorthand */
Animations & Effects

🔄 Transforms

style.css CSS3
transform: scale(1.1); /* scale */
transform: rotate(45deg); /* rotate */
transform: translateX(100px); /* translate */
transform: skewX(10deg); /* skew */
Animations & Effects

🌫️ Effects & Filters

style.css CSS3
filter: blur(5px); /* blur */
filter: brightness(120%); /* brightness */
filter: grayscale(100%); /* grayscale */
Section code copied to clipboard!