Loading content…
Loading content…
CSS (Cascading Style Sheets) transforms plain HTML into beautiful, responsive designs. In 2026, modern CSS has evolved significantly—gone are the days of browser hacks and complex workarounds.
/* Element selector */
p { color: blue; }
/* Class selector */
.button { padding: 10px; }
/* ID selector (avoid in production) */
#header { background: white; }
/* Attribute selector */
input[type="email"] { border: 1px solid gray; }
/* Combinators */
nav > ul { list-style: none; }
article p { margin: 1rem 0; }
Senior Developer Wisdom
div {
width: 200px;
padding: 20px; /* Inside the box */
border: 1px solid;
margin: 10px; /* Outside the box */
}
/* Block, inline, inline-block */
div { display: block; }
span { display: inline; }
button { display: inline-block; }
/* Flexbox */
.container {
display: flex;
gap: 1rem;
align-items: center;
}
/* Grid */
.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 2rem;
}
Pro Tip
/* Mobile first */
body { font-size: 14px; }
/* Tablet and up */
@media (min-width: 768px) {
body { font-size: 16px; }
}
/* Desktop and up */
@media (min-width: 1024px) {
body { font-size: 18px; }
}
Common Pitfall
CSS Fundamentals Checklist
Marking it complete updates your roadmap progress percentage.