Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

font size=X equivalent in CSS, not px, pt, %. I need font size

Status
Not open for further replies.

sndkick

Programmer
Nov 1, 2000
71
0
0
US
I never really paid much attention until now but i have always used CSS to define my font size as either 10px or 12px. This seems to be the closest I can get to font size=1 and size=2 without being much different from Mac to PC and Netscape to IE.

What I have realized is that <font size=1> and <font size=2> are the same in IE and Netscape, regardless of whether it is a Mac or a PC. Using px comes across a little too big on Macs and pt is way too small.

I have tried every combination for font-size=:
px - smaller in Netscape on PC than IE, too big on Macs
pt - waaaay too small on Macs
60% or 75% - waaay too small on Mac
size=1 - defaults to pt i think... maybe px... too small
smaller, larger - different among all platforms

Using the <FONT> tags seems to be the only way to get a font the same across the board, but I need to be able to use CSS for site manageablity, so that I dont' have to go find every font tag in the site if I need to change it.

Has anyone found a good solution to this? I need to somehow make the CSS style declaration interpret the size the same as font size=1 or 2.

If not, what are common font setups that you are using for regular site content and for small content? I don't really ever have a need for anything bigger.

Thanks for any help.
 
Hi,

I usually use different style sheets for IE and NS and use javascript to select the correct one. You could add specific CSS for platforms.

Bye.
 
I've never tried this, but the CSS tutorial at Webmonkey says this will work for you. Here's a quote:

<<<<< Begin Quote >>>>>

If you don't like using those units, you can also declare text size through keywords, like so:



P { font-size: large }
There are seven keywords, and they correspond to the numerical values we're used to seeing with <FONT SIZE>:



xx-small
x-small
small
medium
large
x-large
xx-large
With these values, the Web browser is free to decide which exact font size is appropriate for each keyword. For example, x-large is displayed at 28 points in Netscape Communicator (Windows and Mac), 24 points in IE 4 (Windows and Mac), and 18 points in IE 3 for Windows 95.



You can also use two relative keywords:



smaller
larger
A value of smaller tells the browser to adjust the size of the current text down a notch on the keyword scale. For example, if large text has smaller applied, it will then be medium sized. The larger attribute works similarly.



(Note: IE 3 doesn't support the smaller or larger attributes.)

<<<<< End Quote >>>>>

The link to the tutorial:


Good Luck,
Todd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top