// Master HTML, CSS, responsive design, and accessibility to create beautiful, inclusive user interfaces that work across all devices.
| name | responsive-design |
| description | Master HTML, CSS, responsive design, and accessibility to create beautiful, inclusive user interfaces that work across all devices. |
Build beautiful, accessible interfaces with semantic HTML and modern CSS.
<!-- Good: Semantic markup -->
<header>
<nav>Navigation</nav>
</header>
<main>
<article>
<h1>Article Title</h1>
<section>Content</section>
</article>
</main>
<footer>Footer content</footer>
ARIA Attributes
Semantic Elements
<button> not <div onclick><nav>, <main>, <footer>WCAG 2.1 Levels
Specificity Calculation
Inheritance
inherit and initial keywordsFlexbox (1D Layout)
.container {
display: flex;
justify-content: space-between; /* Horizontal alignment */
align-items: center; /* Vertical alignment */
gap: 1rem;
}
.item {
flex: 1; /* Grow equally */
}
CSS Grid (2D Layout)
.grid {
display: grid;
grid-template-columns: repeat(12, 1fr);
gap: 1rem;
}
.card {
grid-column: span 4;
}
Mobile-First Approach
/* Base styles for mobile */
.container { width: 100%; }
/* Tablet and up */
@media (min-width: 768px) {
.container { width: 750px; }
}
/* Desktop and up */
@media (min-width: 1024px) {
.container { width: 960px; }
}
Flexible Units
:root {
--primary-color: #3498db;
--spacing: 1rem;
}
.button {
background: var(--primary-color);
padding: var(--spacing);
}
.button {
transition: background-color 0.3s ease;
}
.button:hover {
background-color: #2980b9;
}
@keyframes slideIn {
from { transform: translateX(-100%); }
to { transform: translateX(0); }
}
.modal {
animation: slideIn 0.3s ease;
}
Reduce Repaints & Reflows
Font Optimization
Image Optimization