CSS: font help

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

CSS: font help

Post by nigma »

Hey, I have the following css:
h2 { font: 21px/21px 600; }

Now, that looks fine, but I want the font weight a bit higher so I do:
h2 { font: 21px/21px 900; }

No effect, so I just ditch the font-weight element all together:
h2 {font: 21px/21px; }

Now the font weight is much bigger, but when I do specify a font-weight it appears to always stay the same weight.

Any idea why?
microthick
Forum Regular
Posts: 543
Joined: Wed Sep 24, 2003 2:15 pm
Location: Vancouver, BC

Post by microthick »

I've learned never to specify weights with numbers. It never comes out as I expect. So I just use bold or normal.
gbrussian
Forum Newbie
Posts: 3
Joined: Sun Nov 23, 2003 11:15 am

Post by gbrussian »

font-weight: bold;


whatabout that?
User avatar
uberpolak
Forum Contributor
Posts: 261
Joined: Thu Jan 02, 2003 10:37 am
Location: Next to the bar

Post by uberpolak »

I've had a similar problem, though I don't know what the cause is, I find that specifying the weight by using only the "font" attribute doesn't seem to work. It seems that when it's included, it forces the font to its default weight, whatever you set it to be.

Code: Select all

h2 { font-size: 21px/21px; font-weight: 900;}
That should get the effect you want.
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Post by nigma »

Thanks for your helpful replies.
Post Reply