Responsive Web Design - CSS
Until recently web pages were treated like print, with replicating Photoshop designs.
Fixed width pages as diapering but they can still be found...
Last year, mobiles overtook desktop in terms of accessing the internet.
You can utilise Google’s mobile-friendly checkers to check your code or get some pointers.
Mobile versus Responsive debate was prevalent a few years ago. The key problem with mobile is the screen size optimisation.
Catering for different device sizes:
WAP - ran on early featured phones
Dedicated mobile / desktop sites m.example.com
To quote Ethan Marcotte: “Rather than tailoring disconnected designs to each of an ever-increasing number of web devices, we can treat them as facets of the same experience. We can design for an optimal viewing experience, but embed standards-based technologies into our designs to make them not only more flexible, but more adaptive to the media that renders them.”
Techniques for responding include: resizing things; changing layout; show / hide stuff
Design can work bottom up, with mobile first but adding features. Going mobile first also forces you to focus on the key elements on the page, rather than adding garnish.
Graceful degradation
Design the full desktop site first
Successively takeaway features and change layout to cope with smaller screens and less capacble devices
Design the basic functionality first
Successively add features and change layout to make use of larger screens and more device capabilities
Viewports (browser window)
In the first instance a browser tries to show you the full scale of the website. You can adjust this via the viewport meta name.
Core techniques for responsive website design:
Fluid Layouts - for this you use em as units of measurements; fluid layouts specific the size of page elements in relative CSS units
Pages content adjusts to the viewport, whatever its size>
There are limitations though as you need content to re-order as scaling is not enough.
CSS media queries - set information for breakpoints and then specify the CSS for that screen size.
This is used to target different devices or buckets. It looks for consistent media types and adds an expression that check for the particular, featured such as width, orientation etc...
Each media query evaluated to true / false
- viewport widthand height (width=)
- screen width and height (device-width=)
- screen orientation (landscape portrait)
- aspect ratio
Media queries means that you divide all of the screen sizes into device classes or buckets. Breakpoints are adjusted for the different sizes. So a combination of this and fluid layout makes of the best results.
http://www.w3schools.com/cssref/css3_pr_mediaquery.asp
@mediavengers screen ‘and’ you can use other wording such as and; not; only; or doesn’t exist but can be specified as a comma. Only is often used to hide media queries from older browsers.
Many developers don’t build from scratch. Exmaples include
Whilst these can save time, they include a lot of code that isn’t needed for your website. They can often be difficult to extend or modify and witht he grid selectors mean they can be less effective for SEO.
It also means less creativity for the design, sites can get that Bootstrap look.
http://www.designyourway.net/blog/inspiration/the-case-against-using-bootstrap-to-design-websites/