HTML and CSS Reference
In-Depth Information
2. Add the following style rules to set the width of figure box images to 5 inches and
the font size of captions to 20 points:
figure img {
width: 5in;
figure figcaption {
font-size: 20pt;
3. Finally, add the following style rule to avoid adding a page break after the last
figure box:
figure:last-of-type {
page-break-after: avoid;
Figure 8-44 highlights the newly added styles.
figure 8-44
figure box styles
always adds a
page break after
a figure element
avoids page
breaks within a
figure element
sets th e width of
printed images
sets th e font size
of figure captions
does not add a
page break after
the last figure box
4. Save your changes to the style sheet file.
5. Reload the treebook.htm file in your Web browser, and then either print the file
or view the file in a Print Preview window. Figure 8-45 shows a preview of the five
pages that should be in the printout.
figure 8-45
Printed output
Search WWH ::

Custom Search