- Responsive Web Design with HTML5 and CSS3(Second Edition)
- Ben Frain
- 388字
- 2021-07-16 20:33:57
Chapter 3. Fluid Layouts and Responsive Images
Eons ago, in the mists of time (well the late 1990s), websites were typically built with their widths defined as percentages. These percentage-based widths fluidly adjusted to the screen viewing them and became known as fluid layouts.
In the years shortly after, in the mid to late 2000s, there was an intervening fixation on fixed width designs (I blame those pesky print designers and their obsession with pixel perfect precision). Nowadays, as we build responsive web designs we need to look back to fluid layouts and remember all the benefits they offer.
In Chapter 2, Media Queries – Supporting Differing Viewports, we ultimately conceded that while media queries allowed our design to adapt to changing viewport sizes, by snapping from one set of styles to another, we needed some ability to flex our design between the 'break points' that media queries provided. By coding a 'fluid' layout, we can facilitate this need perfectly; it will effortlessly stretch to fill the gaps between our media query break points.
In 2015, we have better means to build responsive web sites than ever. There is a new CSS layout module called Flexible Box (or Flexbox as it is more commonly known) that now has enough browser support to make it viable for everyday use.
It can do more than merely provide a fluid layout mechanism. Want to be able to easily center content, change the source order of markup, and generally create amazing layouts with relevant ease? Flexbox is the layout mechanism for you. The majority of this chapter deals with Flexbox, covering all the incredible capabilities it has to offer.
There is another key area to responsive web design we can address better now than ever before and that's responsive images. There are now specified methods and syntax for sending devices the most relevant version of an image for their viewport. We will spend the last section of this chapter understanding how responsive images work and how we can make them work for us.
In this chapter we will cover:
- How to convert fixed pixel sizes to proportional sizes
- Consider existing CSS layout mechanisms and their shortfalls
- Understand the Flexible Box Layout Module and the benefits it offers
- Learn the correct syntax for resolution switching and art direction with responsive images
- The Supervised Learning Workshop
- Python概率統計
- PHP 7底層設計與源碼實現
- 單片機C語言程序設計實訓100例:基于STC8051+Proteus仿真與實戰
- 看透JavaScript:原理、方法與實踐
- Oracle 12c中文版數據庫管理、應用與開發實踐教程 (清華電腦學堂)
- Building Mobile Applications Using Kendo UI Mobile and ASP.NET Web API
- Oracle數據庫從入門到運維實戰
- Scratch真好玩:教小孩學編程
- concrete5 Cookbook
- Django 3.0入門與實踐
- .NET Standard 2.0 Cookbook
- ASP.NET 4.0 Web程序設計
- 零基礎學SQL(升級版)
- Linux Networking Cookbook