<< The CSS Learning Group

Discussion Area

ask questions, discuss topics, solve problems

Discussion Home | About | Threads By Date | Search

New member with question


Thread posted 11/22/09 by okcss last edited 11/22/09
8,860 views, 1 comments.

Title
New member with question

Content

Hi, my name is Keith and my background is in journalism and Web design. I'm trying to move back into Web design by learning CSS.

My first question involves this rule I created. The size and color work fine but the Helvetica value does not. Can't figure it out...

p.fnt1 {color: green; font-size: 130%; font: Helvetica;}

Entire style sheet attached.

Comments

posted 11/23/09 by Ida Engmark | Report Abuse

<p>The correct way to define a font in CSS is the font-family tag.</p> <p>So:</p> <p>p.fnt1 {color: green; font-size: 130%; font-family: Helvetica;}</p> <p>On a side note. Don't use only one font for the family definition, Helvetica is not a system font on windows based systems, and if you haven't defined a substitute font it will substitue with the browser default (often times / times new roman).</p> <p>The better way to write the rule would be:</p> <p>p.fnt1 {color: green; font-size: 130%; font-family: Helvetica, Arial, sans-serif;}</p> <p>That way the browser will use the Arial font if Helvetica is not available and will use an other sans serif font if it can't find either Arial nor Helvetica.</p> <p>/Ida</p>