HTML and CSS Reference
In-Depth Information
vents the collapsing of top margins. The content property does not require any
content within to work, but this method uses a space character to overcome an
Opera bug when used on elements that are editable.
This is how the clearfix class evolved! As you can see, a great deal of research
and development went into crafting the best clearfix class possible that would
work across dominant browser platforms.
What do the print styles do?
The HTML5 Boilerplate stylesheet comes with a set of styles that are useful defaults
when a user prints your page. Styling how a page would appear in print is something
that most of us do not consider while designing a web page, and HTML5 Boilerplate
gives you a set of good defaults, so you do not have to consider it most of the time
(however, it would be good practice to do so).
Print media query
We have inlined all our print styles within a CSS media query called "print". This me-
dia query is matched whenever a user selects a page for printing, and these style
rules will be applied in that case. We declare all of our rules within the @media
print query as shown in the following code snippet:
@media print {
a, a:visited { text-decoration: underline; }
/* More Styles below */
}
Optimizing colors and backgrounds
We then make sure we optimize the page to appear most readable when printed and
also ensure we are not wasting too much printing ink printing superfluous images,
colors, and text. This means we make sure we remove all background images or
images, which are just of a slightly different shade of white or transparent for all ele-
ments. We also make sure all of the colors are black as it means the printer does not
have to mix any ink and hence can print faster. We also remove shadows, as that
would make the text less readable.
Search WWH ::




Custom Search