Graphics Programs Reference
In-Depth Information
Understanding Alternate Style Sheets
You follow a similar approach when creating alternate style sheets for a site. When you
create an alternate style sheet, the pages of the site must be linked to the alternate style
sheet in the same way that they were linked to the main style sheet. Remember, the code
to link a style sheet to a page is:
<linkƒhref=”stylesheets/nbf_styles.css”rel=”stylesheet”ƒ
type=”text/css”ƒ/>
When you use multiple style sheets, the link to the alternate style sheet is added
below the code to the primary style sheet. Also, the code to designate the media type
attribute is added at the end of the link code, as follows:
<linkƒhref=”stylesheets/nbf_styles.css”ƒrel=”stylesheet”ƒ
media=”all”ƒtype=”text/css”ƒ/>
<linkƒhref=”stylesheets/nbf_print_styles.css”ƒ
rel=”stylesheet”ƒmedia=”print”ƒtype=”text/css”ƒ/>
Notice that the link to the main style sheet (nbf_styles.css) is placed in the code before
the link to the alternate style sheet (nbf_print_styles.css).
Because you will create styles within the main style sheet for the NextBest Fest site,
you will not alter the link code in the site's pages.
Effectively Creating Alternate Styles for the Print Media Type
When creating alternate styles for print, keep in mind that no matter what you do, you
do not have complete control over how a page prints. For example, the user controls
whether the background color or image prints. Because you cannot override the control,
make sure that all the content in the print style sheet is visible on a white background.
Also keep in mind that different browsers and different printers might interpret styles
with slight variations.
The following guidelines help ensure that Web pages print cleanly and clearly:
• Designate a page width using inches as the unit of measure. A good standard width
for print is 7 inches.
• Designate font sizes in points. A good size for general content is 10 or 12 points.
Headings should be slightly larger.
• Remove the background color and background images. Users print pages for infor-
mation and excessive color wastes ink. Also, this standardizes the look of the printed
page for all users whether or not they choose to print the background image or color.
• Remove elements that are not useful in the print version of the page. For example, ele-
ments such as large images, interactive components, or navigation bars can often be
removed. To remove an element from the print version of the page, set the element's
Display property to none in the alternate style.
Creating Alternate Styles
You will customize the way the pages of the NextBest Fest site display in the print media
type by creating alternate styles. You will explore several different ways to create new
styles in the style sheet. First, you will create a rule that changes the font color of all text
to black for the print media.
Search WWH ::




Custom Search