HTML and CSS Reference
In-Depth Information
color: blue; background-color: yellow;}
em {font-size: 2em; color: green;}
-->
</style>
Internet Explorer's conditional comments are also found in CSS for masking linked style
sheets for one browser or another. See entry on comments in the reference found in Chapter 3
for more details.
@charset
A single @charset rule can be used in an external sheet to define character set encoding of
the style rules and values.
Example
@charset "ISO-8859-1"
/* external style sheet rules follow below */
Note
• This rule should never be used in an embedded style sheet, as there are many other
ways to indicate character sets with a <meta> tag or an HTTP header.
@font-face
This “at” rule is used to associate a font name to be used in a style sheet with some
downloadable font. A font-family property is used within the rule to name the font
and a src property is associated with an external font name:
@font-face {font-family: fontname;
src: url(fontfile);}
Later, the font can be used as a name within properties like font-family and font ,
though you should specify other font names as a fallback in case downloadable font
technology is not supported or the font fails to load for some reason.
Examples
@font-face {font-family: "Mufferaw";
src: url(MUFFERAW.ttf);}
body {font-family: "Mufferaw", serif; font-size: 5em;}
It is also possible to set selection of a particular downloadable font when a particular font
characteristic like bold or italic is set, by adding the corresponding rule to the @font-face rule:
@font-face {font-family: "Mufferaw";
src: url(MUFFERAW.ttf);}
@font-face {font-family: "Mufferaw";
src: url(MUFFERAWBOLD.ttf);
font-weight: bold;}
p {font-family: "Mufferaw", serif; font-size: 5em;}
em {font-weight: bold;} /* would specify the Mufferaw bold font */
Search WWH ::




Custom Search