CSS font questions (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets



Message


owleyes -> CSS font questions (9/5/2003 8:42:13)

[8|] Trying hard to figure CSS font sizes out....

I am relatively new to CSS. Have several books on CSS (either those dedicated to CSS or including CSS along with HTML/XHTML.) Also I have visited several sites on the Web looking for information/clarification on this topic, including the W3C, Outfront, CNet Builder, W3C Schools, WebMonkey. In other words, I have truly tried to do my homework!

I am still at a loss, however, on the best way to specify font sizes using CSS.

Some folks say pixels are best because font sizes appear more uniform between Macs and PCs. Some say "no" because pixels do not print well and also because they don't allow a user as much control. Others advocate points, but then some say points and other absolute units also are buggy and again do not offer control.

Then there are those that say percentages, and others recommend ems. Those that suggest percentages say the ems are not supported by certain browsers (IE3 was mentioned). Others say to stay away from percentages -- that they are buggy, too.

One person said use pixels as a beginner and then when you are not a beginner use ems. (And how will I know when I have crossed the beginner line? I always feel like a beginner!) Another person said if you use ems be sure to put them inside font tags (huh? I thought font tags are deprecated.)

Then there is the added issue of inheritance and browser compatibility with font sizes. If I have a linked or an embedded stylesheet and use a list of selectors with a relative font-size, in some browsers it works just fine, but in others, NOT. In some cases the font just gets smaller and smaller. I use tables for layout mostly so almost everything on my page is enclosed in a td cell somewhere. Since I am using tables, if I don't specify some kind of list to give the font-size for the text within tables, then Netscape 4.X won't display the page properly.

Will folks kindly let me know your thoughts/methods of specifying the font-size? Obviously I want my pages to look good and to have clean code and also for them to be accessible.

Thanks in advance! This newbie appreciates your advice/feedback.




gorilla -> RE: CSS font questions (9/5/2003 17:05:17)

I so sympathise, it's one of those things that seem to generate "holy war" with shrieks of "flay the infidel" whenever diehard CSS gurus get together. I do what suits me for particular pages and "mix and match" - I use px for somethings and ems for everything else. I have noticed that I'm using ems and percentages more and more. The only time I now use pt is for printer friendly pages.

I found this from w3c was a great help:

http://www.w3.org/TR/REC-CSS2/fonts.html#propdef-font-size

and this tutorial was a complete godsend:

http://www.bigbaer.com/css_tutorials/css_font_size.htm

I hope this helped you a bit - bookmark bigbaer!


Rory Bunbarr

The single solitary United Kingdom Gorilla (also the newest one but ssssssshhhhh we don't want anyone to think that I'm not a truly stupendous alpha silverback male gorilla just like my sponsor (with a "K")[;)])

PS: Where's PreludeOK95? - I want to give her a demonstration of my invention the exploding pineapple in gratitude [:D] [sm=evileek.gif]

Copenhagen
Denmark
September 5th 2003

PS: IE3???? You've got to be joking! AFAIK it doesn't even support CSS. Look at your logs how many people are using IE3?

RB




slbergh -> RE: CSS font questions (9/5/2003 21:58:24)

By accessible, do you mean accessible for those with disabilities or accessible as in the page shows up when you enter a URL? I ask because if you're concerned with accessibility from a disability stance, you should steer clear of fixed width font sizes (pt, px, em). Consider using relative sizes (small, smaller, largest, etc.) or percentages instead.

(Using fixed width, those with low vision who prefer to increase the size of the screen font are unable to do so.)




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.078125