← All tutorials

GoCareerGo Tutorials

CSS Tutorial

Selectors, box model, Flexbox, Grid, animation and responsive design.

Media Queries

Apply CSS rules conditionally based on viewport width, device type, or user preferences.

@media (max-width: 768px) {
  .sidebar { display: none; }
}

@media (prefers-color-scheme: dark) {
  body { background: #111; color: #eee; }
}
Tip

Mobile-first is the recommended approach: write base styles for mobile, then add min-width media queries for larger screens.