April 2013
Intermediate to advanced
264 pages
7h 44m
English
One sticking point I haven’t yet addressed is when you have objects on a page—notably images, but also plug-ins like video and Flash. You can’t do much with the latter (especially as Flash won’t be supported on most of your users’ mobile devices anyway), but images present a unique set of obstacles to building responsively, which I’ll come to shortly.
Resizing most objects with percentages (or viewport-relative units if you go that way) is not a problem; you could quite simply set the max-width property to 100 percent to prevent the object ever being wider than its container:
img {
height: auto;
max-width: 100%;
}
Notice that I also set the auto value on the height property to maintain the object’s original ...
Read now
Unlock full access