Book Image

Professional CSS3

By : Piotr Sikora
Book Image

Professional CSS3

By: Piotr Sikora

Overview of this book

CSS is the preferred technology to design modern web pages. Although CSS is often perceived as a simple language, applying modern styles to web pages with CSS and maintaining the code for larger websites can be quite tricky. We will take you right from understanding CSS to designing high-quality web pages in CSS3. We'll quickly take you through CSS3's features, and show you how to resolve common issues so you can build your basic framework. Finally, you will learn about code architecture and CSS methodologies used in scalable apps and you'll explore the various new features of CSS3, such as FlexBox, to help you create the most modern layout methodologies. By the end of the book, you will be a master at creating pure CSS web pages and will know sophisticated web design techniques, giving you an edge over other web designers.
Table of Contents (21 chapters)
Professional CSS3
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Targeting specific devices through media queries


To build a bulletproof mailer, you will need to use specific code for some specific e-mail clients and devices. This is more difficult to do because of the problems with debugging (there is no good debugger/inspector to check behaviors live). Which devices do we need? Let's create a list:

  • iPad or iPhone with retina and non-retina display

  • Android devices with:

    • Low density (pixel ratio smaller than 1)

    • Medium density (pixel ratio equal to 1)

    • High density (pixel ratio greater than 1)

      @media only screen and (max-device-width: 480px) {
      }

This set with which you will match tablets and small screens:

@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
}

Retina display is known from iOS devices such as iPhones, iPods, and iPads. These devices can be targeted with this media query:

@media only screen and (-webkit-min-device-pixel-ratio: 2) {
}

Target low density Android layouts:

@media only screen and (-webkit-device-pixel-ratio: ...