HTML and CSS Reference
In-Depth Information
To hide the page header, navigation lists, and page footer:
◗
1.
Return to the
print.css
file in your text editor.
◗
2.
Add the following style rule as shown in Figure 8-38:
/* Hide page elements that will not be printed */
header, nav, footer {
display: none;
}
figure 8-38
hiding page elements in the printed output
does not display the
contents of the header,
nav, and f
o
oter elements
◗
3.
Save your changes to the file, and then reload
treebook.htm
in your Web
browser. Verify that the appearance of the page as displayed on your screen has
not changed.
◗
4.
Either print the Web page from within your browser, or use your browser's Print
Preview command to preview the printed version of the page. Figure 8-39 shows
how the initial page appears when printed.