Media Queries

Responsive design with media queries

Nowadays, people use different devices to access websites: desktops, tablets, and mobile phones of all different sizes. Responsive design is a way to assemble a website so that it automatically scales its content and elements to match the viewer's screen size. It prevents images from being larger than the screen width, so visitors on mobile devices will also see a visually attractive website.

The primary way of making a responsive website is by writing custom CSS code that makes it so. This can be done using media queries: CSS instructions that only apply to certain screen sizes.

Learn more about Media Queries with this 5 minute YouTube video:

Learn more about media queries here:

Responsive Design

Use media queries for responsive design:

@media (max-width: 600px) {
    header {
        font-size: 1.2em;
    }
    .flex-container {
        flex-direction: column;
    }
}

Help us improve the content 🤩

You can leave comments here.

Last updated