HighDots Forums  

font-size : 0em

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss font-size : 0em in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Chimanrao
 
Posts: n/a

Default font-size : 0em - 09-14-2006 , 12:44 AM






hi

I have a style-sheet in which the font-size is specified as 0em.

IE renders it with very small font (like 1 pt size).
FireFox does not render the text at all.
Safari renders it with default system font.

Which browser is correct?
Does the CSS standard say anything about this?

Regards
Chiman


Reply With Quote
  #2  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: font-size : 0em - 09-14-2006 , 01:45 AM






Chimanrao <chimanrao (AT) gmail (DOT) com> scripsit:

Quote:
I have a style-sheet in which the font-size is specified as 0em.
Why? If you want to suggest that some text be not rendered at all, use
display: none.

Quote:
IE renders it with very small font (like 1 pt size).
FireFox does not render the text at all.
Safari renders it with default system font.

Which browser is correct?
All of them, as far as this behavior is considered.

Quote:
Does the CSS standard say anything about this?
There is no CSS standard. There is CSS 2.0 recommendation, which is not
really recommended by anyone, and there is the CSS 2.1 proposal, which says
that it is work in progress and should not be cited otherwise.

But the general principle is that a value may be "approximated":
"A used value is in principle the value used for rendering, but a user agent
may not be able to make use of the value in a given environment. For
example, a user agent may only be able to render borders with integer pixel
widths and may therefore have to approximate the computed width, or the user
agent may be forced to use only black and white shades instead of full
colour. The actual value is the used value after any approximations have
been applied."
http://www.w3.org/TR/CSS21/cascade.html#actual-value

(CSS 2.0 spec says explicitly, in the same context: "The actual value of
this property may differ from the computed value due a numerical value on
'font-size-adjust' and the unavailability of certain font sizes." It seems
that they just removed the sentence when removing font-size-adjust, but they
hardly meant to remove the idea that the actual size may differ from the
computed value due to "the unavailability of certain font sizes".)

The nature of "approximation" for font-size has not been defined. Thus, a
declared font size of zero might reasonably be implemented as such (i.e.,
characters are rendered as zero-size glyphs) or using the smallest available
actual font size. Using the default size is somewhat more eccentric
(assuming that there is some smaller size available) but might fit into a
liberal definition of "approximation". :-)

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/



Reply With Quote
  #3  
Old   
Warren Post
 
Posts: n/a

Default Re: font-size : 0em - 09-15-2006 , 04:13 PM



El Wed, 13 Sep 2006 21:44:31 -0700, Chimanrao escribió:

Quote:
I have a style-sheet in which the font-size is specified as 0em.

IE renders it with very small font (like 1 pt size). FireFox does not
render the text at all. Safari renders it with default system font.

Which browser is correct?
Does the CSS standard say anything about this?
If your interest is in predicting what the site visitor sees, recall that
many browsers (e.g. Firefox 1.5 and Opera 9.0) allow the user to specify a
minimum font size. Thus you can't count on font-size: 0em to not display.
Better, as Jukka points out, to use display: none.

--
Warren Post
Santa Rosa de Copán, Honduras
http://srcopan.vze.com/



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.