3 replies [Last post]
blndcat
Offline
newbie
Last seen: 15 years 34 weeks ago
Timezone: GMT+9
Joined: 2004-07-05
Posts: 3
Points: 0

In trying to learn css from others, I have come across fonts being sized with:
font: 90%/175%

I have no idea what this means. Can someone enlighten me? I have tried searching the online resources but have drawn a blank, probably because it is such a hard search term to define and match.

blndcat
Offline
newbie
Last seen: 15 years 34 weeks ago
Timezone: GMT+9
Joined: 2004-07-05
Posts: 3
Points: 0

found out

Sorry for answering my own post but i finally figured out what it meant.

It is shorthand for setting font size and line height. In this case font size to 90% and line height to 175%

EssentialBuyerGuides
EssentialBuyerGuides's picture
Offline
Enthusiast
England
Last seen: 15 years 35 weeks ago
England
Joined: 2004-06-25
Posts: 91
Points: 0

what does "font: 90%/175%" mean?

Wow, does that mean that if you set that in the body{}, the lineheight would be 1 3/4 of the screen height? Shock

I've played with percentages a bit with sub-classes of things, like #navbar ul li {font-size: 60%};

It's just figuring out what it's actuall working out relative to. Smile

blndcat
Offline
newbie
Last seen: 15 years 34 weeks ago
Timezone: GMT+9
Joined: 2004-07-05
Posts: 3
Points: 0

relative to the base font size

it should be relative to the base font size. (which is of course different between browsers and platforms and user settings)

having said that having a font size 90% of the screen size and a line-height of 175% would look cool. Cool or maybe not... Laughing out loud

whoops forgot to mention that if you nest things, it can be relative to the parent. if if you set your divs to font size 90% and have a div inside that it would be 90% of 90% (81%). this might be relevant with nested uls. if this is not what you want to happen you can set

div div { font-size:100%}

if I'm wrong, someone correct me, thanks