Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

CSS: Fonts and Text : Page 3

Learn all kinds of things about altering fonts and text.


advertisement
Font Family: {font-family: name,name generic name}
The font-family property lets you specify a font for the element's text. To display, the font must be on the reader's system folder.

Example: This sets a style rule making paragraphs appear in Helvetica:

p {font-family: helvetica}



If you are using a CSS-enabled browser and your computer has the helvetica font, this paragraph appears in helvetica.

You can list several different families. The browser will look for the faces in order until it finds a match in the system font list.

Example: If the reader's computer doesn't have helvetica, the browser will look for arial.

p {font-family: helvetica, arial}

If you are using a CSS-enabled browser and your computer has the helvetica font, this paragraph appears in helvetica. If it doesn't have helvetica, it will appear in arial.

As a last resort, you can include a generic name as well. The generic names are: serif, sans-serif, cursive, fantasy, monospace.

Example: If the reader's computer doesn't have helvetica, the browser will look for arial, if it doesn't find arial it will use any sans-serif face it can find.

p {font-family: helvetica, arial sans-serif}

Font Style: {font-style: normal/italic/oblique}
The font-style property lets you select an italic or oblique stye of your font. This property works hand-in-hand with the font-family property.

Example: If you wanted to specify the font palatino italic for the blockquote, you'd create two rules—one for font family and one for font style:

blockquote {font-family: palatino serif; font-style: italic}

If you have palatino italic on your system, that's the face in which you'll see this example text.


Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date