Connecting Tech Pros Worldwide Forums | Help | Site Map

Font Size

shapper
Guest
 
Posts: n/a
#1: Sep 13 '08
Hello,

I have something has follows:

<div>
...
<table>
...
</table>

</div>

My document font size is 1em.

My div font size is 1.4em.

What should be the font-size in my table to get back to the 1em of the
document?

Thanks,
Miguel

Roy A.
Guest
 
Posts: n/a
#2: Sep 13 '08

re: Font Size


On 13 Sep, 18:00, shapper <mdmo...@gmail.comwrote:
Quote:
Hello,
>
I have something has follows:
>
<div>
* ...
* <table>
* ...
* </table>
>
</div>
>
My document font size is 1em.
>
My div font size is 1.4em.
font-size: medium
Johannes Koch
Guest
 
Posts: n/a
#3: Sep 13 '08

re: Font Size


shapper schrieb:
Quote:
Hello,
>
I have something has follows:
>
<div>
...
<table>
...
</table>
>
</div>
>
My document font size is 1em.
>
My div font size is 1.4em.
>
What should be the font-size in my table to get back to the 1em of the
document?
1/1.4 = ?
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Roy A.
Guest
 
Posts: n/a
#4: Sep 14 '08

re: Font Size


On 13 Sep, 20:20, Johannes Koch <k...@w3development.dewrote:
Quote:
shapper schrieb:
>
>
>
>
>
Quote:
Hello,
>
Quote:
I have something has follows:
>
Quote:
<div>
* ...
* <table>
* ...
* </table>
>
Quote:
</div>
>
Quote:
My document font size is 1em.
>
Quote:
My div font size is 1.4em.
>
Quote:
What should be the font-size in my table to get back to the 1em of the
document?
>
1/1.4 = ?
..714285714em
Andy Dingley
Guest
 
Posts: n/a
#5: Sep 15 '08

re: Font Size


On 13 Sep, 17:00, shapper <mdmo...@gmail.comwrote:
Quote:
I have something has follows:
<div>
* ...
* <table>
* ...
* </table>
>
</div>
>
My document font size is 1em.
>
My div font size is 1.4em.
Try to avoid setting these very "broad" selectors such as
div { ... }
because (as you've noticed) this will affect _every_ <div>
The way CSS selectors work it's easy to "switch them on" for very
narrow scope, but hard to "switch them off" when you don't want them
to apply.

So rather than thinking "How do I reverse this?" try thinking "How can
I stop this happening in the first place?"


Quite possibly you really needed some markup like this:

<div class="loud-and-shouty" >Really Important Stuff!!!</div>

<div>
<table>
....
</table>
</div>


Where the CSS

..loud-and-shouty { font-size: 1.4em; }

would do what you _needed_, without the side-effect of changing the
behaviour for your <tableinside another anonymous <div>


Quote:
What should be the font-size in my table to get back to the 1em of the
document?
In that case, divide one by the other: 0.7em

Jukka K. Korpela
Guest
 
Posts: n/a
#6: Sep 15 '08

re: Font Size


Andy Dingley wrote:
Quote:
On 13 Sep, 17:00, shapper <mdmo...@gmail.comwrote:
Quote:
>I have something has follows:
[...]
Quote:
Quote:
>My document font size is 1em.
>>
>My div font size is 1.4em.
Sounds ominous, doesn't it?
Quote:
Try to avoid setting these very "broad" selectors such as
div { ... }
because (as you've noticed) this will affect _every_ <div>
Indeed. Besides, when there is a <tableinside a <div>, the font-size
property will be inherited into the table, unless some style sheet sets
font-size for the <tableelement or its descendants.
Quote:
The way CSS selectors work it's easy to "switch them on" for very
narrow scope, but hard to "switch them off" when you don't want them
to apply.
Right. In the general case, once you have set a property e.g. for a <div>
element, there is no way to say, at a later stage, "ignore that setting" or
"act as if I did not set that" or "use whatever defaults you would have
used". In the case of font-size, though, we can be relatively sure that
div { font-size: 100%; }
has such an effect, though of course a misguided user's style sheet _could_
set font-size for <divand we would then brutally override it.
Quote:
Quite possibly you really needed some markup like this:
>
<div class="loud-and-shouty" >Really Important Stuff!!!</div>
[...]
Quote:
Where the CSS
>
.loud-and-shouty { font-size: 1.4em; }
>
would do what you _needed_, without the side-effect of changing the
behaviour for your <tableinside another anonymous <div>
Logically, in that case, you should probably use

<div class="important"><strong>Really Important Stuff!!!</strong></div>

with

..important { font-size: 1.4em; font-weight: normal; }

(The latter declaration is there to prevent the default bolding of <strong>
in graphic presentation.)

With just <divmarkup, you are not saying anything semantically, and the
text will not be emphatic at all when CSS is off.
Quote:
Quote:
>What should be the font-size in my table to get back to the 1em of
>the document?
>
In that case, divide one by the other: 0.7em
No, it's not exact then, since 1.4 times 0.7 is 0.98, not 1. Using 0.714em
would probably be exact enough. But as you wrote, it's better to avoid
creating the problem.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

dorayme
Guest
 
Posts: n/a
#7: Sep 15 '08

re: Font Size


In article <F8wzk.66119$_03.59784@reader1.news.saunalahti.fi> ,
"Jukka K. Korpela" <jkorpela@cs.tut.fiwrote:
Quote:
Andy Dingley wrote:
>
Quote:

In that case, divide one by the other: 0.7em
>
No, it's not exact then, since 1.4 times 0.7 is 0.98, not 1. Using 0.714em
would probably be exact enough. But as you wrote, it's better to avoid
creating the problem.
You two old "Odd Couple" geysers occupy a little cosy isolated world?
Others (such as Koch and Roy A) have given exact figures ages ago in
this thread.

<g>

--
dorayme
Jukka K. Korpela
Guest
 
Posts: n/a
#8: Sep 15 '08

re: Font Size


dorayme wrote:
Quote:
In article <F8wzk.66119$_03.59784@reader1.news.saunalahti.fi> ,
"Jukka K. Korpela" <jkorpela@cs.tut.fiwrote:
>
Quote:
>Andy Dingley wrote:
>>
Quote:
>>>
>>In that case, divide one by the other: 0.7em
>>
>No, it's not exact then, since 1.4 times 0.7 is 0.98, not 1. Using
>0.714em would probably be exact enough. But as you wrote, it's
>better to avoid creating the problem.
>
You two old "Odd Couple" geysers occupy a little cosy isolated world?
Others (such as Koch and Roy A) have given exact figures ages ago in
this thread.
Actually, no _exact_ figures have been given.

And a mistake by a usually well-informed poster is usually worth being
corrected, anyway. I would surely welcome corrections to my postings if I
ever made a mistake.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

dorayme
Guest
 
Posts: n/a
#9: Sep 15 '08

re: Font Size


In article <7pAzk.66316$_03.26013@reader1.news.saunalahti.fi> ,
"Jukka K. Korpela" <jkorpela@cs.tut.fiwrote:
Quote:
dorayme wrote:
Quote:
In article <F8wzk.66119$_03.59784@reader1.news.saunalahti.fi> ,
"Jukka K. Korpela" <jkorpela@cs.tut.fiwrote:
Quote:
Andy Dingley wrote:
>
>>
>In that case, divide one by the other: 0.7em
>
No, it's not exact then, since 1.4 times 0.7 is 0.98, not 1. Using
0.714em would probably be exact enough. But as you wrote, it's
better to avoid creating the problem.
You two old "Odd Couple" geysers occupy a little cosy isolated world?
Others (such as Koch and Roy A) have given exact figures ages ago in
this thread.
>
Actually, no _exact_ figures have been given.
>
And a mistake by a usually well-informed poster is usually worth being
corrected, anyway. I would surely welcome corrections to my postings if I
ever made a mistake.
Well, Koch did say:

1/1.4 = ?

and Roy A replied:

..714285714em

and dorayme thought (silently) "better actually test this" (out of
curiosity on how accurate different browsers behaved) and discovered
(silently) that one decimal place was not good enough.

So I think your 3 places just about hits the practical sweet spot. You
are not wrong. And you were correct to correct Andy Dingley. But my post
was not quite about this.

--
dorayme
Andy Dingley
Guest
 
Posts: n/a
#10: Sep 16 '08

re: Font Size


On 15 Sep, 23:16, dorayme <doraymeRidT...@optusnet.com.auwrote:
Quote:
So I think your 3 places just about hits the practical sweet spot.
We're talking about 2% theoretical error.

On a font size.

Get a grip.
dorayme
Guest
 
Posts: n/a
#11: Sep 16 '08

re: Font Size


In article
<da33d52e-0572-4793-b1fe-9786d47347d5@z72g2000hsb.googlegroups.com>,
Andy Dingley <dingbat@codesmiths.comwrote:
Quote:
On 15 Sep, 23:16, dorayme <doraymeRidT...@optusnet.com.auwrote:
Quote:
So I think your 3 places just about hits the practical sweet spot.
>
We're talking about 2% theoretical error.
>
It was not a theoretical one. And it was not me who felt the need to
correct it. And you do not exhibit a fair context of my remarks, perhaps
taking JK's dictum that full quoting indicates lack of comprehensive
reading too far?
Quote:
On a font size.
>
Get a grip.
I can see that you are in a hard-hearted mood, bleeding not the
slightest for the pixel-perfect brigade. Do you realise what a couple of
decimal places can do to some of these folks? I have seen the human
results of this and they are not pretty. I have seen them in refuges,
men and woman who've had their lives ruined by drink! To which they
turned because of their frustration at things in their websites *not*
being exactly so.

Have you any idea at all what trouble a couple of dec places can cause
in this world. Maybe in your world, you can take them or leave them, but
not in the world of the families of spacecraft or Jumbo jets that have
come down because of what you call "theoretical errors".

Please be more compassionate and do not divide the world into the
theoretical and the practical in so simple a way.

--
dorayme
shapper
Guest
 
Posts: n/a
#12: Sep 17 '08

re: Font Size


On Sep 15, 12:42*pm, Andy Dingley <ding...@codesmiths.comwrote:
Quote:
On 13 Sep, 17:00, shapper <mdmo...@gmail.comwrote:
>
Quote:
I have something has follows:
<div>
* ...
* <table>
* ...
* </table>
>
Quote:
</div>
>
Quote:
My document font size is 1em.
>
Quote:
My div font size is 1.4em.
>
Try to avoid setting these very "broad" selectors such as
* * div { ... }
because (as you've noticed) this will affect _every_ <div>
The way CSS selectors work it's easy to "switch them on" for very
narrow scope, but hard to "switch them off" when you don't want them
to apply.
>
So rather than thinking "How do I reverse this?" try thinking "How can
I stop this happening in the first place?"
>
Quite possibly you really needed some markup like this:
>
<div class="loud-and-shouty" *>Really Important Stuff!!!</div>
>
<div>
* <table>
* * ....
* </table>
</div>
>
Where the CSS
>
.loud-and-shouty { font-size: 1.4em; }
>
would do what you _needed_, without the side-effect of changing the
behaviour for your <tableinside another anonymous <div>
>
Quote:
What should be the font-size in my table to get back to the 1em of the
document?
>
In that case, divide one by the other: 0.7em
I understand that ... But this markup is created by a JQuery Plugin
for a Date Picker so it would be hard to go around it ...
Andy Dingley
Guest
 
Posts: n/a
#13: Sep 17 '08

re: Font Size


On 17 Sep, 01:49, shapper <mdmo...@gmail.comwrote:
Quote:
I understand that ... But this markup is created by a JQuery Plugin
for a Date Picker so it would be hard to go around it ...
I don't think you even need to change the markup for this piece of the
code. Change the markup for the <divwhere you're after the enlarged
text, leave the nested table (for which you want default behaviour)
"unclassed" (which is the default markup).

As a general rule, avoid controls where you can't refer to their
generated markup. Even a single class or id on their outer container
is enough to work with, but totally anonymous markup is a pain. If you
don't get any help from the control itself, you can always wrap it in
<div class="from-this-control-so-might-need-tweaking" ... </div>
Closed Thread