Sorry, I'm really newbie on this. If you believe that, for answering this
questions, you will need to explain what CSS actually IS or something like
that, don't bother. :)
You said that:
"Goes better with font-size/line-height. Font-size/line-height
defaults differ across browser-land, which is basically what caused the "1px
off" problem in the first place."
But: I haven't use font-size/line-height (I believe)... So the 1px off
problem should came from other things? Or not?
"By letting all browsers know that they should calculate dimensions
to font-size no matter what that font-size actually is, they'll cover up for
their differences."
But I thought that let the browsers do the calculations was a BAD thing...
" The right line-height automatically introduces vertical adjustment
to text in those short "lines", so adjusting the text with vertical paddings
becomes unnecessary."
Ok. So why browsers do it right with "line-height" and they don't do it
right with "vertical-padding"? It's because, for some reason, on
vertical-padding they add that to the height value, and when they add that
value to the height value they do some rounded calculations, while when then
use the line-height they add nothing to the height?
"Pixel and restricted height rarely ever go well together with
font-size and line-height."
But in the code I gave you, I don't recall having mixed Pixel and restricted
height with "font-size and line-height"...
About the em and the pixel...
Without changing the pixel to em, but doing the other changes that you have
said, I get this page that doesn't look good, BUT, looks equal on all pages:
http://www.cantinho.org/test4.html
So, in principle, the fixed pixel should be accurate if we have the "right
math" hm?
I'm not yet getting why we should use em over pixel. You have state that:
"Em are most often better suited when dealing with text in tight line-ups,
since they reflect font-size",
what do you mean by reflect font-size?
I'm really sorry about all this questions, the code will work as you said,
I'm sure of it, but I'd like to know "how this works" so I can understand
instead of just copying it.
Thanks once again,
Márcio
-----Original Message-----
From: Gunlaug Sørtun [mailto:[EMAIL PROTECTED]
Sent: segunda-feira, 3 de Novembro de 2008 19:43
To: MEM
Cc: [email protected]
Subject: Re: [css-d] The 1 px terror - Help.
MEM wrote:
> Thanks. I will give a try on your solution. I will see what do I get
> after the changes.
I know what you'll get if you do it right: the intended line-up.
I test before responding :-)
> And... With all the margin and padding and height and pixel and em...
> maybe what you have said: " Also: avoid values that you see
> introduce rounding-differences in your range of browsers", leads me
> to a math problem. :)
The math is most often best left to the browser-engines. Most of them
are better at it, and they are doing the rendering-jobs anyway. So
you're right about you having a "math problem".
Pixel and restricted height rarely ever go well together with
font-size and line-height. Pixel are fixed - font-size and line-height
are not. Em are most often better suited when dealing with text in tight
line-ups, since they reflect font-size.
So, if you get your numbers right you can play with em and pixel mixes
on various declarations on same or related elements, and all browsers
will play nicely along. If you get numbers and/or units wrong, or simply
don't include all variables that affect elements' line-up, you're likely
to end up with a mess.
regards
Georg
--
http://www.gunlaug.no
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/