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

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


advertisement
 

CSS: Fonts and Text : Page 3

Learn all kinds of things about altering fonts and text.


advertisement

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


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
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date