This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > November 2004 > CSS Fonts: Detect Font DPI use specific CSS





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author CSS Fonts: Detect Font DPI use specific CSS
David Jubinville

2004-11-18, 11:15 pm

Hi All,

I've run into a bit of an interesting problem with CSS and font DPI and
would certainly welcome help.

Problem:
Page layout defined in CSS has font size issues (overlapping frames, text
overflowing out of popup window, etc) on a windows systems using 120dpi
fonts (large fonts), but everything looks perfect in 96dpi small fonts.

My question is this, is there a way to detect system font size and select an
appropriate CSS style for each case? The deployment is a "slideshow" like
courseware solution that is displayed in a popup window - overflow is not an
option as the window can not scroll.

Fonts sized at 8.5pt display perfectly in 96dpi but are much too large in
120dpi. The reason for using absolute a.o.2 relative type size is that
..bodycopy defines core type site-wide. If it is set to relative, type gets
insanely small in some cases.

If anyone knows of a solution or a possible method of detecting system font
dpi - not resolution - I would be very grateful.

Thanks in advance!

David


Brian

2004-11-18, 11:15 pm

C A Upsdell wrote:

> I solved this problem (type gets insanely small) some time ago,


There was no problem until you created one by specifying font size in
the first place.

> I instead use the standard CSS font sizes xx-small, x-small, small,
> medium, large, x-large, and xx-large. The default font size is medium
> (except for IE, for which it is small, but which can be circumvented
> using CSS trickery),


There is no need for such trickery. This is one part of css that is
pretty easy to nail. The only bug to worry about is margins, widths,
etc. specified in em units, and that only affects MSIE/Win. The solution
is to explicitly declare the correct font size for body:

body { font-size: 100% }

> and smaller sizes can be produced by dropping down to small, x-small,
> etc.


There is little need for any font size less than 100%, except perhaps
for legalese. And for that, you need not try to figure out css keywords.

..legalese { font-size: 90% }

--
Brian (remove "invalid" to email me)
kchayka

2004-11-18, 11:15 pm

C A Upsdell wrote:
> "kchayka" <usenet@c-net.us> wrote in message
> news:2vstebF2oggguU1@uni-berlin.de...
>
> Wrong. Once upon a time, I did use % units, and I did have endless
> shrinking text size problems


Caused by using a body text size smaller than 100%?

Doctor, it hurts when I do this...

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Neal

2004-11-18, 11:15 pm

C A Upsdell wrote:
> "Beauregard T. Shagnasty" wrote
> 90%, that is.
> Not if it is nested, which what the OP was concerned with. 90% of 90% of
> 90% ... can quickly become too small to read ...


So, apply font-size more logically.

Do you need to apply a 90% in a 90% in a 90%, ever? Normally, I set
font-size for the body (at 100%) and set special things at say 90%. If you
never nest this upon itself, you avoid the problem.

think you're inventing an unrealistic problem.
Christoph Paeper

2004-11-18, 11:15 pm

*brucie* <shit@usenetshit.info>:
> Christoph Paeper said:
>
>
> theres nothing wrong with my font size. whats wrong is authors telling
> me should really be 10% smaller.


Nobody (serious) advertised a font size smaller than 100% for the _main
text_. I would not support a font size smaller than about 90% of the
user's selected comfortable size for anything less important than the main
text.

> i don't like authors telling me what my font size should be (or how long
> the lines of text should be). stop trying to control me.


Not everything has to be the same size, but the text that matters should
be in the user's preferred size.

> you have a killfile,


No, I don't.

--
Useless Fact #1:
Barbie's measurements if she were life size: 39-23-33 [99-58-84].
C A Upsdell

2004-11-18, 11:15 pm

"Neal" <neal413@yahoo.com> wrote in message
news:opshi9oyim6v6656@news.individual.net...
>C A Upsdell wrote:
>
>
> Which? I'd like to know, as I've never encountered such issues.


A very worthy question. Unfortunately I can't show you because I fixed all
my live sites using the technique I have described. I did find two old
sites -- shut down and no longer on the web, but still on my PC -- which use
the % technique and which have the shrinking text problem with NN4.80,
IE5.01, IE5.5, and IE6.0 ... but NOT with Opera or Mozilla. Moreover, the
nature of the % problems suggests that they resulted from improper handling
of inheritance by the troublesome browsers.

Although I can't show you the dead sites, I hope that you will believe me
when I say that I have re-confirmed that such % problems exists in the
sites, and that the problems occurred ONLY with certain browsers whose
compliance with standards is (ahem!) not admirable.



brucie

2004-11-18, 11:15 pm

In comp.infosystems.www.authoring.stylesheets C A Upsdell said:

[color=darkred]
[color=darkred]
> A very worthy question. Unfortunately I can't show you because I fixed all
> my live sites using the technique I have described.


just whip up a quick demo. heres the IE ems bug when the font size is
set to 'smallest':
http://moreshit.usenetshit.info/ick...ize-thingy.shit

for those that don't have IE this is what it looks like:
http://moreshit.usenetshit.info/ick...size-thingy.png [1k]

what its supposed to look like:
http://moreshit.usenetshit.info/yum...size-thingy.png [1k]


--
the facts and opinions expressed by brucies
l i t t l e v o i c e s
are not necessarily the same as those held by brucie.
Neal

2004-11-18, 11:15 pm

C A Upsdell wrote:
> "Neal" wrote
>
> A very worthy question. Unfortunately I can't show you... I hope that
> you will believe me
> when I say that I have re-confirmed that such % problems exists in the
> sites, and that the problems occurred ONLY with certain browsers whose
> compliance with standards is (ahem!) not admirable.


See, I use % exclusively, and I've never had such issues. I'd like to
believe you, but my experience tells me otherwise.

Perhaps you can go into the kitchen and whip up a little demo?

Neal

2004-11-18, 11:15 pm

On Tue, 16 Nov 2004 03:46:42 -0500, Neal <neal413@yahoo.com> wrote:

> 1) and 2), and 3) and 4), should be the same size, one calculated in the
> browser, the other calculated by hand and set as a direct size.


Correction - 1 and 2 should be the same, and 4 and 5 should be the same.
Lauri Raittila

2004-11-19, 4:15 am

in comp.infosystems.www.authoring.stylesheets, brucie wrote:
> In comp.infosystems.www.authoring.stylesheets C A Upsdell said:


>
> sounds like an inheritance issue with your css. i've never had any
> problems using %.


That is because you have not been stupid enaugh to use unclosed P
elements and different than 100% font for in NN4. Irrelevant today, of
course...



--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Nisse Engström

2004-11-19, 4:15 am

C A Upsdell<cupsdell0311XXX@-> wrote:
> "kchayka" <usenet@c-net.us> wrote in message
> news:2vstebF2oggguU1@uni-berlin.de...
>
> Wrong. Once upon a time, I did use % units, and I did have endless
> shrinking text size problems (at least with some browsers), and switching to
> small, x-small, etc. stopped this problem for good.


I just discovered that my barely used copy of IE 5.5
treats the following selector:

.footnote > * { font-size: 90%; }

as:

* { font-size: 90%; }

which should do nicely to produce insanely small text. It
works as intended (or at least doesn't fail catastrophically)
if the selector is:

.footnote>* { font-size: 90%; }


--n
Brian

2004-11-19, 7:16 pm

Nisse Engström wrote:

> I just discovered that my barely used copy of IE 5.5 treats the
> following selector:
>
> .footnote > * { font-size: 90%; }


MSIE/Win does not understand child selectors, treating them as
descendent selectors instead. So this is parsed as

..footnote * { font-size: 90%; }


> as:
>
> * { font-size: 90%; }


Erm, not sure about that.

> which should do nicely to produce insanely small text.


Perhaps. Without testing, it seems that .footnote * would produce 90% in
the child of .footnote, and 90% of 90% in the grandchild, etc.

> It works as intended (or at least doesn't fail catastrophically) if
> the selector is:
>
> .footnote>* { font-size: 90%; }


What you mean is that it does not work at all, that it has no effect,
when you use that selector. That's because, as I wrote above, MSIE/Win
does not parse child selector. Thus, the ">" in that selector could be
any character, and MSIE seems to treat this as one string, as if it were
looking for an element where class="footnote>*".

--
Brian (remove "invalid" to email me)
Nisse Engström

2004-11-19, 7:16 pm

Brian<usenet3@julietremblay.com.invalid> wrote:
> Nisse Engstr=F6m wrote:
>=20
>=20
> Erm, not sure about that.


Test case:
<http://home.swipnet.se/sigsegv/tmp/...d-selector.html>
Screen shot:
<http://home.swipnet.se/sigsegv/tmp/...ld-selector.png>

>=20
> What you mean is that it does not work at all, that it has no effect,
> when you use that selector.


You're right there. I didn't test this much, which is
why I added the parenthesis above.

--n
Nisse Engström

2004-11-19, 7:16 pm

Nisse Engstr=F6m<PvovotkNOSPAM@tele2.se> wrote:
>=20
> I just discovered that my barely used copy of IE 5.5
> treats the following selector:


It seems I wasn't telling the whole truth there. That
should have been IE 5.0. The 5.5 was on some other computer.

Sorry about that.

--n
C A Upsdell

2004-11-20, 12:15 pm

"Brian" <usenet3@julietremblay.com.invalid> wrote in message
news:3x8md.911038$Gx4.375633@bgtnsc04-news.ops.worldnet.att.net...
>C A Upsdell wrote:
>
>
> There was no problem until you created one by specifying font size in
> the first place.
>
>
> There is no need for such trickery. This is one part of css that is
> pretty easy to nail. The only bug to worry about is margins, widths,
> etc. specified in em units, and that only affects MSIE/Win. The solution
> is to explicitly declare the correct font size for body:
>
> body { font-size: 100% }


> There is little need for any font size less than 100%, except perhaps
> for legalese. And for that, you need not try to figure out css keywords.


Wrong. There can be many valid reasons to use a font size other than 100%.
Legalese might be one of these reasons. Other good reasons could be:
superscripts, subscripts, small caps text, text to stand out by being
larger, footnotes, sidenotes, sidebars, menus, captions, advertising, dense
tables, etc., etc., etc.

> .legalese { font-size: 90% }


Which can result in the 'type gets insanely small' problem; whereas my
equivalent suggestion -- .legalese { font-size:small; } -- does not.

IMO the important things are to (a) have font sizes that are scaled to the
user's default font size, and (b) have font sizes that are readable.




brucie

2004-11-20, 12:15 pm

In comp.infosystems.www.authoring.stylesheets C A Upsdell said:
[color=darkred]

whats wrong with 100% and the other text 110%. why do people insist on
making text smaller than what the visitor prefers. could it be because
people are more concerned with how it looks rather than how readable it
is.

--
the facts and opinions expressed by brucies
l i t t l e v o i c e s
are not necessarily the same as those held by brucie.
Brian

2004-11-20, 7:15 pm

Nisse Engström wrote:
> Brian<usenet3@julietremblay.com.invalid> wrote:
>
>
>
> Test case:
> <http://home.swipnet.se/sigsegv/tmp/...d-selector.html>


I don't doubt that the fonts get progressively smaller. What I'm saying
is that .footnote > * is treated as .footnote *. That's different then
what you wrote, * .footnote, which would match <element
class="footnote"> where <element> was not the root, right?

BTW, I looked at your test case, but don't see any class="bogus". Have I
missed something?

> Screen shot:
> <http://home.swipnet.se/sigsegv/tmp/...ld-selector.png>


Yep, I see it. (And thanks for making the screenshot small; I'm on
dialup, so large screenshots can be sort of a drag.) I was only
clarifying what MSIE parses.

--
Brian (remove "invalid" to email me)
Lauri Raittila

2004-11-20, 11:14 pm

in comp.infosystems.www.authoring.stylesheets, Neal wrote:
> C A Upsdell wrote:
>
>
> Which? I'd like to know, as I've never encountered such issues.


NN4. Unclosed P elements and percentage size.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Nisse Engström

2004-11-21, 7:15 am

Brian<usenet3@julietremblay.com.invalid> wrote:
> Nisse Engstr=F6m wrote:
>=20
> I don't doubt that the fonts get progressively smaller. What I'm saying
> is that .footnote > * is treated as .footnote *. That's different then
> what you wrote, * .footnote, which would match <element
> class=3D"footnote"> where <element> was not the root, right?


No, that's not quite what I wrote.=20

> BTW, I looked at your test case, but don't see any class=3D"bogus". Have =

I
> missed something?


IF ".bogus > *" is treated as ".bogus *", then, unless
I'm irrevocably confused, the selector would match any
/descendant of .bogus/. But there /is no/ element with that
class, and the selector /still matches/.
It seems to me that the selector matches /every/ element,
which is what I wrote upthread.

The ".bogus *" selector renders quite differently:
<http://home.swipnet.se/sigsegv/tmp/...d-selector.html>
<http://home.swipnet.se/sigsegv/tmp/...nd-selector.png>

>=20
> Yep, I see it. (And thanks for making the screenshot small; I'm on
> dialup, [...]


Me too. But even if I weren't, I would still make an
effort to reduce their size. It's probably more pedantry
than courtesy. :-)

--n
Christoph Paeper

2004-11-21, 12:17 pm

*brucie* <shit@usenetshit.info>:
>
>
> whats wrong with 100% and the other text 110%.


The preferred font size set in the browser (100%) is for main text, that's
what matters. I don't like bigger than necessary (main) text either.

> why do people insist on making text smaller
> than what the visitor prefers.


My feeling is you set your preferred font size too low, maybe to your
minimal comfortable reading size. That would be your fault.

> could it be because people are more concerned with how it looks
> rather than how readable it is.


That's the people using 'font-size' with pixel values or 'body', 'p' etc.
below 100%/1em/medium. You are once again over-sensitive.

Btw.: Using all lowercase and not the appropriate punctuation marks (for
questions) doesn't enhance readability as well.

--
"Try to learn something about everything and everything about something."
Thomas H. Huxley
brucie

2004-11-21, 12:17 pm

In comp.infosystems.www.authoring.stylesheets Christoph Paeper said:

[color=darkred]
> My feeling is you set your preferred font size too low,


theres nothing wrong with my font size. whats wrong is authors telling
me should really be 10% smaller. if i wanted it 10% smaller i would make
it 10% smaller.

> maybe to your minimal comfortable reading size. That would be your
> fault.


its the authors fault specifying 10% smaller than what i prefer, i know
what i prefer and its not 10% smaller than what i have. stop trying to
blame me.

> You are once again over-sensitive.


i don't like authors telling me what my font size should be (or how long
the lines of text should be). stop trying to control me.

> Btw.: Using all lowercase and not the appropriate punctuation marks (for
> questions) doesn't enhance readability as well.


you have a killfile, use it. usenet was much better once i killfiled
myself.

--
the facts and opinions expressed by brucies
l i t t l e v o i c e s
are not necessarily the same as those held by brucie.
C A Upsdell

2004-11-21, 7:16 pm

"kchayka" <usenet@c-net.us> wrote in message
news:2vstebF2oggguU1@uni-berlin.de...
>C A Upsdell wrote:
>
> You are mistaken. % units do not trigger the "insanely small" text size
> problem in WinIE. Only em units do.


Wrong. Once upon a time, I did use % units, and I did have endless
shrinking text size problems (at least with some browsers), and switching to
small, x-small, etc. stopped this problem for good.

> Keyword sizes are a worse alternative, because of the inconsistent
> rendering across browsers. Tis also a waste of time and effort to try to
> work around these differences with hacks.


The inconsistency is in IE, easily overcome. And the CSS trickery which
overcomes this inconsistency can be copied and pasted from site to site,
changing only the selectors, as needed.





Beauregard T. Shagnasty

2004-11-21, 11:18 pm

C A Upsdell wrote:

>
> Which can result in the 'type gets insanely small' problem; whereas my
> equivalent suggestion -- .legalese { font-size:small; } -- does not.


Sure does on my pages. 90%, that is.

If it fails for you, you may not have body set at 100%.

> IMO the important things are to (a) have font sizes that are scaled to the
> user's default font size, and (b) have font sizes that are readable.


...which is why we use percentages. A hundred of them. <g>

--
-bts
-This space intentionally left blank.
kchayka

2004-11-21, 11:18 pm

C A Upsdell wrote:
> "Brian" <usenet3@julietremblay.com.invalid> wrote in message
>
>
> Which can result in the 'type gets insanely small' problem; whereas my
> equivalent suggestion -- .legalese { font-size:small; } -- does not.


You are mistaken. % units do not trigger the "insanely small" text size
problem in WinIE. Only em units do.

Keyword sizes are a worse alternative, because of the inconsistent
rendering across browsers. Tis also a waste of time and effort to try to
work around these differences with hacks. % units work so nicely without
any special effort - they are the only sane solution.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
C A Upsdell

2004-11-21, 11:18 pm

"Beauregard T. Shagnasty" <a.nony.mous@example.invalid> wrote in message
news:az9md.9647$zk7.8184@twister.nyroc.rr.com...
>C A Upsdell wrote:
>
>
> Sure does on my pages. 90%, that is.


Not if it is nested, which what the OP was concerned with. 90% of 90% of
90% ... can quickly become too small to read, whereas font-size:small
font-size:small font-size:small ... does not.





Neal

2004-11-21, 11:18 pm

C A Upsdell wrote:

> Wrong. Once upon a time, I did use % units, and I did have endless
> shrinking text size problems (at least with some browsers)


Which? I'd like to know, as I've never encountered such issues.
kchayka

2004-11-21, 11:18 pm

C A Upsdell wrote:
> "kchayka" <usenet@c-net.us> wrote in message
> news:2vstebF2oggguU1@uni-berlin.de...
>
> Wrong. Once upon a time, I did use % units, and I did have endless
> shrinking text size problems


Caused by using a body text size smaller than 100%?

Doctor, it hurts when I do this...

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
brucie

2004-11-21, 11:18 pm

In comp.infosystems.www.authoring.stylesheets C A Upsdell said:

[color=darkred]
> Wrong.


i disagree. i'm always coming across sites with the IE em bug. set your
font size to 'smallest' and you'll see it for yourself. using the same
size specified with % and theres no problems.

> Once upon a time, I did use % units, and I did have endless
> shrinking text size problems (at least with some browsers),


sounds like an inheritance issue with your css. i've never had any
problems using %.

> and switching to small, x-small, etc. stopped this problem for good.


the problem with keywords is that browsers don't use the same base size.
just as kchayka said.

> The inconsistency is in IE, easily overcome. And the CSS trickery which
> overcomes this inconsistency can be copied and pasted from site to site,
> changing only the selectors, as needed.


or you could just use % and not fart around with unneeded hacks.

--
the facts and opinions expressed by brucies
l i t t l e v o i c e s
are not necessarily the same as those held by brucie.
Neal

2004-11-21, 11:18 pm

C A Upsdell wrote:
> "Beauregard T. Shagnasty" wrote
> 90%, that is.
> Not if it is nested, which what the OP was concerned with. 90% of 90% of
> 90% ... can quickly become too small to read ...


So, apply font-size more logically.

Do you need to apply a 90% in a 90% in a 90%, ever? Normally, I set
font-size for the body (at 100%) and set special things at say 90%. If you
never nest this upon itself, you avoid the problem.

think you're inventing an unrealistic problem.
brucie

2004-11-21, 11:18 pm

In comp.infosystems.www.authoring.stylesheets Christoph Paeper said:

> Nobody (serious) advertised a font size smaller than 100% for the _main
> text_.


you want the content easy to read at the visitors preferred size but not
the navigation?

> I would not support a font size smaller than about 90% of the user's
> selected comfortable size for anything less important than the main
> text.


thankfully i can specify a minimum font size (100%) so i can read all
the text. often it causes horizontal scrolling or the design falls apart
but at least i can read it.

> No, I don't.


oh, i'll just shut up then.


--
the facts and opinions expressed by brucies
l i t t l e v o i c e s
are not necessarily the same as those held by brucie.
C A Upsdell

2004-11-21, 11:18 pm

"kchayka" <usenet@c-net.us> wrote in message
news:2vt2frF2nis53U1@uni-berlin.de...
>C A Upsdell wrote:
>
> Caused by using a body text size smaller than 100%?
>
> Doctor, it hurts when I do this...


Then don't do this ...



C A Upsdell

2004-11-21, 11:18 pm

"brucie" <shit@usenetshit.info> wrote in message
news:1qb8jsffj7i1y.dlg@usenetshit.info...
> In comp.infosystems.www.authoring.stylesheets C A Upsdell said:
>
> the problem with keywords is that browsers don't use the same base size.
> just as kchayka said.


Please explain. Are you simply referring to the IE problem, which as I have
explained several times is easily overcome?

>
> or you could just use % and not fart around with unneeded hacks.


I could use %: but I would rather use something that works.




kchayka

2004-11-21, 11:18 pm

C A Upsdell wrote:
> "kchayka" <usenet@c-net.us> wrote in message
> news:2vt2frF2nis53U1@uni-berlin.de...
>
> Then don't do this ...


You think you're following your own advice?

You put a bandaid on it by using font-size keywords instead of %. But
you're only treating the symptoms, not the problem.

The symptoms are a progressively smaller font-size with nested elements.
The problem is setting explicit sizes less than 100%. Stop doing that
and the symptoms disappear. You won't need any silly hacks, either.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
C A Upsdell

2004-11-21, 11:18 pm

"Neal" <neal413@yahoo.com> wrote in message
news:opshi9oyim6v6656@news.individual.net...
>C A Upsdell wrote:
>
>
> Which? I'd like to know, as I've never encountered such issues.


A very worthy question. Unfortunately I can't show you because I fixed all
my live sites using the technique I have described. I did find two old
sites -- shut down and no longer on the web, but still on my PC -- which use
the % technique and which have the shrinking text problem with NN4.80,
IE5.01, IE5.5, and IE6.0 ... but NOT with Opera or Mozilla. Moreover, the
nature of the % problems suggests that they resulted from improper handling
of inheritance by the troublesome browsers.

Although I can't show you the dead sites, I hope that you will believe me
when I say that I have re-confirmed that such % problems exists in the
sites, and that the problems occurred ONLY with certain browsers whose
compliance with standards is (ahem!) not admirable.



C A Upsdell

2004-11-21, 11:18 pm

"Neal" <neal413@yahoo.com> wrote in message
news:opshi9tiz46v6656@news.individual.net...
>C A Upsdell wrote:
>
> So, apply font-size more logically.
>
> Do you need to apply a 90% in a 90% in a 90%, ever? Normally, I set
> font-size for the body (at 100%) and set special things at say 90%. If you
> never nest this upon itself, you avoid the problem.
>
> think you're inventing an unrealistic problem.


Not inventing. Note my response to another of your messages in which I
confirmed the problem ... with some browsers.



C A Upsdell

2004-11-21, 11:18 pm

"kchayka" <usenet@c-net.us> wrote in message
news:2vtaduF2qu6i2U1@uni-berlin.de...
>C A Upsdell wrote:
> You put a bandaid on it by using font-size keywords instead of %. But
> you're only treating the symptoms, not the problem.


> The symptoms are a progressively smaller font-size with nested elements.
> The problem is setting explicit sizes less than 100%. Stop doing that
> and the symptoms disappear.


You misunderstand. The problem occurred only with sizes specified in %
units. And when I stopped using % units, in favour of my current method,
the problem disappeared. Moreover, the problem only occurred with certain
browsers (look for details in another of my messages on this thread), and
the pattern of the problems suggest that they were due to faulty handling of
inheritance by these browsers.



brucie

2004-11-21, 11:18 pm

In comp.infosystems.www.authoring.stylesheets C A Upsdell said:

[color=darkred]
[color=darkred]
> A very worthy question. Unfortunately I can't show you because I fixed all
> my live sites using the technique I have described.


just whip up a quick demo. heres the IE ems bug when the font size is
set to 'smallest':
http://moreshit.usenetshit.info/ick...ize-thingy.shit

for those that don't have IE this is what it looks like:
http://moreshit.usenetshit.info/ick...size-thingy.png [1k]

what its supposed to look like:
http://moreshit.usenetshit.info/yum...size-thingy.png [1k]


--
the facts and opinions expressed by brucies
l i t t l e v o i c e s
are not necessarily the same as those held by brucie.
Neal

2004-11-21, 11:18 pm

C A Upsdell wrote:
> "Neal" wrote
>
> A very worthy question. Unfortunately I can't show you... I hope that
> you will believe me
> when I say that I have re-confirmed that such % problems exists in the
> sites, and that the problems occurred ONLY with certain browsers whose
> compliance with standards is (ahem!) not admirable.


See, I use % exclusively, and I've never had such issues. I'd like to
believe you, but my experience tells me otherwise.

Perhaps you can go into the kitchen and whip up a little demo?

Neal

2004-11-21, 11:18 pm

On Mon, 15 Nov 2004 22:32:25 -0500, C A Upsdell
<cupsdell0311XXX@-@-@XXXrogers.com> wrote:

> "Neal" <neal413@yahoo.com> wrote in message
> news:opshi9tiz46v6656@news.individual.net...
>
> Not inventing. Note my response to another of your messages in which I
> confirmed the problem ... with some browsers.


I did a test - see http://users.rcn.com/neal413/fontsizetest.html - where
I compare calculated percentages to what it should be. In each section
we're comparing:

1) 81%
2) 90% nested in 90%
3) 100% (baseline)
4) 90% of 90% of 90%
5) 72.9%

1) and 2), and 3) and 4), should be the same size, one calculated in the
browser, the other calculated by hand and set as a direct size.

The three sections themselves are 200%, 150%, and 100%. As you would
expect, the browser has to do a lot of math to calculate a font size here.

Best results were seen in Firefox. I could not discern the direct
percentage from the calculated percentage.

Next best - surprise - IE6. In the 200% * 72.9% div, it looks too small as
compared to when IE calculate 200% * 90% * 90% * 90%. All others work out
fine.

The worst was Opera 7.23. Browser calculations nearly always rendered
smaller than the equivalent direct % size, the opposite of the one issue
in IE.

However, the nesting I have done is intentionally heavy. I imagine the
reasons for the size differences are due to how the browser rounds in its
math. The sizes are not so drastically different that I suspect there's
harm in my continuing to use % exclusively in my CSS font sizes. So long
as we avoid heavy nesting, it should work out.

I'm interested in the observations of others and results in other
browsers, or differences in the same browsers on other machines.
Neal

2004-11-21, 11:18 pm

On Tue, 16 Nov 2004 03:46:42 -0500, Neal <neal413@yahoo.com> wrote:

> 1) and 2), and 3) and 4), should be the same size, one calculated in the
> browser, the other calculated by hand and set as a direct size.


Correction - 1 and 2 should be the same, and 4 and 5 should be the same.
brucie

2004-11-21, 11:18 pm

In comp.infosystems.www.authoring.stylesheets Neal said:

> I did a test - see http://users.rcn.com/neal413/fontsizetest.html - where
> I compare calculated percentages to what it should be. In each section
> we're comparing:
>
> 1) 81%
> 2) 90% nested in 90%
> 3) 100% (baseline)
> 4) 90% of 90% of 90%
> 5) 72.9%
>
> 1) and 2), and 3) and 4), should be the same size, one calculated in the
> browser, the other calculated by hand and set as a direct size.
>
> The three sections themselves are 200%, 150%, and 100%. As you would
> expect, the browser has to do a lot of math to calculate a font size here.
>
> Best results were seen in Firefox. I could not discern the direct
> percentage from the calculated percentage.
>
> Next best - surprise - IE6. In the 200% * 72.9% div, it looks too small as
> compared to when IE calculate 200% * 90% * 90% * 90%. All others work out
> fine.


ummm.... thats just making my poor little head hurt. this is what it
looks like.

from left to right: opera7.6p3. FF1.0 and IE6
http://moreshit.usenetshit.info/font-size-thingy.png [11k]


--
the facts and opinions expressed by brucies
l i t t l e v o i c e s
are not necessarily the same as those held by brucie.
C A Upsdell

2004-11-22, 4:15 am

"Neal" <neal413@yahoo.com> wrote in message
news:opshjun4e06v6656@news.individual.net...
>
> I did a test - see http://users.rcn.com/neal413/fontsizetest.html - where
> I compare calculated percentages to what it should be. In each section
> we're comparing:
>
> 1) 81%
> 2) 90% nested in 90%
> 3) 100% (baseline)
> 4) 90% of 90% of 90%
> 5) 72.9%
>
> 1) and 2), and 3) and 4), should be the same size, one calculated in the
> browser, the other calculated by hand and set as a direct size.


> I'm interested in the observations of others and results in other
> browsers, or differences in the same browsers on other machines.


Okay, on my main PC: NN4.08 and 4.80 had major problems; Opera 7.54,
IE5.01, 5.5, and 6.0 had problems in the 3rd group; Mozilla was (to my eye)
perfect.

Which basically confirms my earlier assertion that the % unit causes
problems for some browsers. Though your point is well taken that it may
also depend on the PC.





news

2004-11-22, 4:15 am


"C A Upsdell" <cupsdell0311XXX@-@-@XXXrogers.com> wrote in message
news:NMCdnT4v_bCb0gTcRVn-qQ@rogers.com...
> "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> wrote in message
> news:az9md.9647$zk7.8184@twister.nyroc.rr.com...
>
> Not if it is nested, which what the OP was concerned with. 90% of 90% of
> 90% ... can quickly become too small to read, whereas font-size:small
> font-size:small font-size:small ... does not.
>

Wow, someone who actually is still paying attention to the actual problem at
hand a.o.2 ripping into eachother...

In most cases, all applicable for that matter, I use relative type sizes.
However, in this case I am working on a site designed by someone else - some
one who knew nothing about web design, as esp. CSS. There really is no easy
fix for this situation without re-codeing from scratch, something that is
not an option due to deadlines (this is internal corporate courseware).

This leaves me with the option that i've already reached - a user 'options'
screen allowing the user to select type sizes from a variety of CSS
documents (differing size/colour models). This is then set using JS and
served via a cookie. Easy, done.. dirty.

The reason it's done this way a.o.2 ASP or PHP site transformations is
because the courseware needs to operate as easily from a CD as from the
net - not possible with server technologies - so don't rag on me for that.

In the end, this is a quick fix better left to the annuls of time - the
whole thing is gonna get dropped into the template I've created for all
future projects.

Many thanks to those who remained somewhat on topic.

Regards,
David
>
>



Lauri Raittila

2004-11-22, 4:16 am

in comp.infosystems.www.authoring.stylesheets, brucie wrote:
> In comp.infosystems.www.authoring.stylesheets C A Upsdell said:


>
> sounds like an inheritance issue with your css. i've never had any
> problems using %.


That is because you have not been stupid enaugh to use unclosed P
elements and different than 100% font for in NN4. Irrelevant today, of
course...



--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Nisse Engström

2004-11-22, 11:22 pm

C A Upsdell<cupsdell0311XXX@-> wrote:
> "kchayka" <usenet@c-net.us> wrote in message
> news:2vstebF2oggguU1@uni-berlin.de...
>
> Wrong. Once upon a time, I did use % units, and I did have endless
> shrinking text size problems (at least with some browsers), and switching to
> small, x-small, etc. stopped this problem for good.


I just discovered that my barely used copy of IE 5.5
treats the following selector:

.footnote > * { font-size: 90%; }

as:

* { font-size: 90%; }

which should do nicely to produce insanely small text. It
works as intended (or at least doesn't fail catastrophically)
if the selector is:

.footnote>* { font-size: 90%; }


--n
Brian

2004-11-23, 4:23 am

Nisse Engström wrote:

> I just discovered that my barely used copy of IE 5.5 treats the
> following selector:
>
> .footnote > * { font-size: 90%; }


MSIE/Win does not understand child selectors, treating them as
descendent selectors instead. So this is parsed as

..footnote * { font-size: 90%; }


> as:
>
> * { font-size: 90%; }


Erm, not sure about that.

> which should do nicely to produce insanely small text.


Perhaps. Without testing, it seems that .footnote * would produce 90% in
the child of .footnote, and 90% of 90% in the grandchild, etc.

> It works as intended (or at least doesn't fail catastrophically) if
> the selector is:
>
> .footnote>* { font-size: 90%; }


What you mean is that it does not work at all, that it has no effect,
when you use that selector. That's because, as I wrote above, MSIE/Win
does not parse child selector. Thus, the ">" in that selector could be
any character, and MSIE seems to treat this as one string, as if it were
looking for an element where class="footnote>*".

--
Brian (remove "invalid" to email me)
Nisse Engström

2004-11-23, 4:23 am

Brian<usenet3@julietremblay.com.invalid> wrote:
> Nisse Engstr=F6m wrote:
>=20
>=20
> Erm, not sure about that.


Test case:
<http://home.swipnet.se/sigsegv/tmp/...d-selector.html>
Screen shot:
<http://home.swipnet.se/sigsegv/tmp/...ld-selector.png>

>=20
> What you mean is that it does not work at all, that it has no effect,
> when you use that selector.


You're right there. I didn't test this much, which is
why I added the parenthesis above.

--n
Nisse Engström

2004-11-23, 4:23 am

Nisse Engstr=F6m<PvovotkNOSPAM@tele2.se> wrote:
>=20
> I just discovered that my barely used copy of IE 5.5
> treats the following selector:


It seems I wasn't telling the whole truth there. That
should have been IE 5.0. The 5.5 was on some other computer.

Sorry about that.

--n
Nisse Engström

2004-11-27, 4:15 am

Brian<usenet3@julietremblay.com.invalid> wrote:
> Nisse Engstr=F6m wrote:
>=20
> I don't doubt that the fonts get progressively smaller. What I'm saying
> is that .footnote > * is treated as .footnote *. That's different then
> what you wrote, * .footnote, which would match <element
> class=3D"footnote"> where <element> was not the root, right?


No, that's not quite what I wrote.=20

> BTW, I looked at your test case, but don't see any class=3D"bogus". Have =

I
> missed something?


IF ".bogus > *" is treated as ".bogus *", then, unless
I'm irrevocably confused, the selector would match any
/descendant of .bogus/. But there /is no/ element with that
class, and the selector /still matches/.
It seems to me that the selector matches /every/ element,
which is what I wrote upthread.

The ".bogus *" selector renders quite differently:
<http://home.swipnet.se/sigsegv/tmp/...d-selector.html>
<http://home.swipnet.se/sigsegv/tmp/...nd-selector.png>

>=20
> Yep, I see it. (And thanks for making the screenshot small; I'm on
> dialup, [...]


Me too. But even if I weren't, I would still make an
effort to reduce their size. It's probably more pedantry
than courtesy. :-)

--n
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews