Learning Center
Learning Center
  • HTML
  • CSS
  • JAVASCRIPT
  • Bootstrap
  • React
  • jQuery
  • NodeJs
  • Sql
  • MySql
  • Python
  • OpenVPN Setup
  • Log In
Coding Choice Home About Contact ☰

  1. You are here
  2. Home
  3. css
  4. responsive_web_design

Sidebar
  • Introduction to CSS
  • CSS Selectors
  • CSS Box Model
  • CSS Flexbox
  • CSS Grid
  • CSS Animations
  • Responsive Web Design
  • CSS Cheat Sheet
  • Share via
    • Share via...
    • Twitter
    • LinkedIn
    • Facebook
    • Pinterest
    • Telegram
    • WhatsApp
    • Yammer
    • Reddit
    • Teams
  • Send via e-Mail
  • Print
  • Permalink

Responsive Web Design

Media Queries

Media queries allow CSS to adapt styles based on screen size.

Example:

<!DOCTYPE html>
<html>
<head>
    <style>
        body {
            background-color: lightblue;
        }
        @media (max-width: 600px) {
            body {
                background-color: lightcoral;
            }
        }
    </style>
</head>
<body>
    <p>Resize the browser to see the background change.</p>
</body>
</html>