05.12.98 CSS & Design Spec [ Rookie Query ]

Thomas Dowling tdowling at ohiolink.edu
Tue May 12 08:22:52 EDT 1998


> I have been using CSS style sheets for about three or four  months now.
> I have read many things on this list about styles and there use.
> I have  questions.
>
> In all the books I've read and site I've gone to usually it's described
> that you use the descriptive size when giving a size. On a
> couple of sites
> I've found that when you do a style sheet and you open a page let's say
> Netscape a site will look one way. Take that same page open it in IE the
> site looks different the fonts are usually larger on one vs
> the other. Now i know that for the most part people say we are
> not looking
> for exact sizes here we want a "feeling" the reason for the CSS
> is to add
> consistancy not to get the "printed page" [ we have DHTML  &
> XML for that
> ". ]

I'm not familiar with the term "descriptive size" in CSS, but it sounds
like what the spec refers to as relative size.

Netscape's current implementation of CSS is substantially buggier than
Microsoft's; among the problems reported is that Netscape miscalculates
relative font sizes specified by percentage.  Try this sample markup:

<hr>
<div style="font-size: 10pt">
<p>10pt text</p>
<p><span style="font-size: 12pt">12pt text</span></p>
<p><span style="font-size: 120%">12pt text?</span></p>
</div>
<hr>

Last time I checked, 10 * 120% = 12, and my copy of IE correctly renders
the second and third line at the same size.  Netscape 4.05 makes the third
line larger than the second.  Here's hoping Mozilla gets it right; they've
promised to do so.


>
> Also take the same site and open it on a macintosh type size will look
> larger or smaller depening on the orginal platform the site was created
> on. My question is when validated "font-size=9pt" pulls back
> and error but
> the spec says that that is a valid value. to use pt, em ect. If one can
> prove that one brower and one platform has a consistant behavior vs
> another and adjust for that via SSI  is it not prudent to do so.


Given the same font at the same point size, the Mac has always had a
smaller on-screen rendering than Windows.  That's just how it is, and
probably always will be until Stevie and Mikey learn to play nice
together.

For this and several other reasons--notably accessibility--it is usually
unwise to specify absolute font sizes.  (Although doing so in CSS instead
of FONT tags probably makes it easier for a user to bypass your font
settings in favor of their own.)


>
> Or is it not prudent to design to such specific needs even though it is
> possible. I hope this makes sence what i am asking. Your pages are
> probably hit more, by all kinds of stuff out there. What are your design
> requirements? How do you develop a CSS spec and how tight or
> loose is the
> design it caters to?
>

Take advantage of CSS but don't rely on it for any specific appearance.
It cannot be used to force a browser into doing anything; it's just a more
flexible language for describing and suggesting the author's preferred
presentation.  The two problems you report make it sound like you can use
neither relative font sizes nor absolute font sizes with total accuracy.
Of the two, I'd stick with relative sizes.  When they're wrong, they're
less likely to screw up your page, and the underlying bug is more likely
to be fixed in the foreseeable future.


Thomas Dowling
OhioLINK - Ohio Library and Information Network
tdowling at ohiolink.edu



More information about the Web4lib mailing list