Reader small image

You're reading from  Less Web Development Essentials (Second Edition)

Product typeBook
Published inApr 2015
Publisher
ISBN-139781783554072
Edition1st Edition
Tools
Right arrow
Author (1)
Bass Jobsen
Bass Jobsen
author image
Bass Jobsen

Bass Jobsen has been programming the web since 1995, ranging from C to PHP. He has a special interest in the processes between designer and programmer. He works on the accessibility of Bootstrap and his JBST WordPress starters theme. With over 5 years of experience with Bootstrap, Bass has been actively contributing to the community with his blogs and Git repos.
Read more about Bass Jobsen

Right arrow

Media queries and responsive design


Media queries is a CSS3 module and a W3C candidate recommendation since June 2012. The media queries module add the possibility to apply a style sheet to CSS only when a media query is evaluated as true. So, a media query has a condition that will be evaluated by the browser; you can compare this evaluation with an if…then statement.

A media query evaluates device's types and its features. Device's types are screen, speech, and print, among others, and its features are width, device-width, and resolution, among others.

Nowadays, the screen type and device's width play an important role in responsive web design. With the use of media queries, someone can restrict the CSS rules to a specified screen width, and thus, change the representation of a website with varying screen resolutions.

A typical media query will look like the following line of code:

@media  condition { ... }

For instance, the following media query sets the font color to black when viewport's...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Less Web Development Essentials (Second Edition)
Published in: Apr 2015Publisher: ISBN-13: 9781783554072

Author (1)

author image
Bass Jobsen

Bass Jobsen has been programming the web since 1995, ranging from C to PHP. He has a special interest in the processes between designer and programmer. He works on the accessibility of Bootstrap and his JBST WordPress starters theme. With over 5 years of experience with Bootstrap, Bass has been actively contributing to the community with his blogs and Git repos.
Read more about Bass Jobsen