Fluid images
Making images scale with a fluid layout can be achieved simply for modern browsers (including IE 7+). It's as simple as declaring the following in the CSS:
img { max-width: 100%; }
This makes any images automatically scale to up to 100 percent of their containing element. Furthermore, the same attribute and property can be applied to other media. For example:
img,object,video,embed { max-width: 100%; }
And they will scale too, apart from a few notable exceptions such as <iframe>
videos from YouTube but we'll wrestle those into submission in Chapter 4, HTML5 for Responsive Designs. For now though, we'll concentrate on images as the principles are the same, regardless of the media.
There are some important considerations in using this approach. Firstly, it requires some forward planning—the images inserted must be large enough to scale to larger viewport sizes. This leads to a further, perhaps more important consideration. No matter the viewport size or device viewing the...