Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learn HTML5 by Creating Fun Games

You're reading from   Learn HTML5 by Creating Fun Games Learning should be fun, especially when it comes to getting to grips with HTML5 Game Development. Each chapter of this book teaches a new concept for learning HTML5 by helping you develop a relevant game. It's education without the effort.

Arrow left icon
Product type Paperback
Published in Jun 2013
Publisher Packt
ISBN-13 9781849696029
Length 374 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Rodrigo Silveira Rodrigo Silveira
Author Profile Icon Rodrigo Silveira
Rodrigo Silveira
Arrow right icon
View More author details
Toc

Understanding media queries


Media queries have been around since HTML4 and CSS2. Originally, the CSS media attribute was used to specify a different stylesheet to be loaded based on the media type loading the page, such as screen, TV, projection, or handheld. In HTML5, media queries also allow for expressions that check for other properties of the user agent viewing the document such as viewport width, height, resolution, and so on.

A media query is made up of two parts, namely a media type declaration and one or more expressions that evaluate to either true or false. Any CSS rules contained nested within the media query declaration are applied whenever any of the media query expressions evaluate to true. Alternatively, every CSS rule inside a stylesheet referenced by a link tag whose media attribute contains a truthy media query expression is applied to the specified media type.

// ---------------------------------
// Media queries on the HTML file
// ---------------------------------
&lt...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image