Fonts and Typography in CSS


Fonts and Typography in CSS

Web design is also about anticipating what the site visitor will see. This is definitely true for fonts as not every computer or screen will render fonts the same way.

There are a few basics which are good to know when building your style-sheet and dealing with fonts.

1. Define Font Families

As web designers we cannot know the exact setup of each visitors computer but we know that not all our visitors are set up the same way. When defining fonts we therefore define font families, rather than defining just one single font.

Type

Type

Under the font-family call in CSS we can then list typefaces according to our priority, for example

font-family: Verdana, Arial, Tahoma, Helvetica, sans-serif;
This call means: show Verdana, if not available, show Tahoma, and if that’s not available, show Helvetica, and if even this is not available use the default sans-serif font of your installation. Your preferred font is the first one on the list.

Always define your font family before thinking about defining typeface, font size, spaces, line height or other type options.

2. Some Sample Style Listings

Serif for titles:

title { font-family : "Times New Roman", Times, serif; }

Sans-serif for body

body { font-family: Verdana, Geneva, Arial, sans-serif: }

Monospace for code

code { font-family: "Courier New", Courier, monospace: }

Script for Signatures

signature {font-family: Corsiva, "Lucida Handwriting", script: }

Fantasy for initial paragraph lettering

p:first-letter {"Comic Sans", sans-serif;}


Author: Yorgo Nestoridis, Media Marketing & Publishing, Founder of YORGOO Publishing, YORGOO Press and Semiomantics.

If you enjoyed reading the above, please consider following future tips and strategies by RSS reader, Email delivery, or Kindle subscription.

This page is wiki editable click here to edit this page.

More about this Topic

This entry was posted in Web Design, Web Design Basics, Web Design Fonts and Typography and tagged , , , , , , , , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

3 Comments

  1. Posted September 9, 2009 at 9:43 pm | Permalink

    Another good shot …:-)

  2. Posted September 10, 2009 at 7:21 pm | Permalink

    excuse me bill gates, i did not find this very helpful for my coursework. bye

  3. Posted September 10, 2009 at 7:46 pm | Permalink

    Sorry to hear, however there is more to it on other pages of the site.

One Trackback

  1. By Fonts and Typography in CSS | Web Design on September 9, 2009 at 12:29 pm

    [...] Original post: Fonts and Typography in CSS | Web Design [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>