38
CHAPTER 3. CSS
say that the outer element (in this case the body element) is the parent and the
inner elements are the children. Many CSS styles are inherited by children.
For example, if you set the background color of the body to yellow, then all
elements in the body will also be yellow (unless explicitly specified otherwise).
3.3
The font Property
The font property accepts values that specify how the text that appears within
the element should be rendered. The minimal form of the font propery specifier
is
style="font: STYLE SIZE FAMILY ; .... "
where STYLE is typically bold , italic or simply omitted, SIZE is typically
expressed in points, e.g. 12pt, and FAMILY is one of the following standard font
families: serif, sans serif, cursive, fantasy, monospace. Thus, one could
create a heading with large sans serif letters as follows:
Intro to CSS
One can also specify that the font should be italic or bold and one can specify
the spacing between the lines along with the font size. For example, the follow
ing element defines a paragraph with a bold italic 12 point serif font, and the
paragraph is doubled spaced as the spacing between every two lines is 24 point.
"font: bold italic 12pt/24pt serif">
This is bold, italic font in a 12 point serif font
with 24 point interline spacing
The five font families listed above are supported on all CSS capable browsers,
but CSS allows the web designer to specify less common font families as well
(e.g. 'Helvetica'). One problem that may arise with this freedom is that there is
no guarantee that the browser that views your web page will have the font you
have specified. CSS compensates for this by allowing the designer to specify a
sequence of font families, separated by commas, ending with one of the standard
font families. A CSS capable browser will use the first font on that list which
is currently available, and in the worst case will just use one of the five generic
families. For example, the following heading specifies that the Irish Ultra font
should be used if possible, otherwise the browser should use ariel, or helvetica,
or if all else fails, sans serif.
"font: 60pt 'Irish Ultra',ariel,helvetica,sans serif">
CSS Fonts
Note that the single quotes around 'Irish Ultra' are needed because the font
name contains a space.
Php Web Hosting Introduction to Interactive Web Design Php Hosting
|
|
|
|
TotalRoute.net Business web hosting division of Vision Web Hosting Inc. All rights reserved. |