17
Responsive Design and Media Queries
In today’s world, websites can be viewed on computers, tablets, phones, watches, glasses, or even kitchen appliances. It’s impossible to design for every single scenario, and that’s where responsive web design (RWD) comes in. RWD ensures that your website looks good no matter what device it’s viewed on.
This is achieved through media queries—we can write CSS that essentially asks the browser questions and then presents styles based on the answers.
Defining Media Queries
Unlike most of the CSS declarations you’ve seen so far, media queries aren’t just sets of properties ...
Get HTML and CSS: Visual QuickStart Guide, 9th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.