MEM wrote:
> 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. :)

CSS is a command-language we use to override and add to browsers own
defaults, and (hopefully) make them treat the source-code (HTML)
elements a bit more like we want them to.

All browsers have, or act as if they have, their own stylesheets with
what we refer to as "default styles". If we leave out something, they'll
fall back to the relevant "default", and no two browsers have the same
defaults all through.

> 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?

 From the browsers' default styles (see above). When you don't declare
font-size and/or line-height, all browsers will use their own default
values.

> "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...

They'll calculate and recalculate everything we do anyway - they got
rendering-engines, so we better give them something that adds up.

> " 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?

Browsers (at least try to) do what you tell them to, but, yes, there are
differences in at which point various browsers round up or down to meet
those screen-pixels or dpi.
Add in a variable like "font resizing at the user-end", and you'll see
why "pixel perfection" is an unreachable goal in web design.

> "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"...

You had a 'height:27px' on the container-div for that list, and that is
a restriction - a fixed height.

BTW: having a height there is necessary since the absolute positioned
child - the ul - takes up no space in that div. It is just a question of
having the right height, and pixel-values won't adjust to changed
conditions.

> 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

Yes. No point in changing one part of you don't change all parts involved.

> 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?

Actual font-size is always 1em of itself - and also 100% of itself if
that makes it any clearer, and that "reflection" doesn't change no
matter what the font-size actually is. A pixel on the other hand is a
fixed-size "design pixel" no matter what, and has no relation whatsoever
to 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.

That's the right attitude - I applaud that.

The learning curve for CSS can be pretty steep, but those who don't want
to climb it will always be limited to "copy-cat" type of designing.

Once you're up at a more leveled ground of basic understanding, you can
design almost whatever you want and get those browser to play along, and
you'll only have a slowly diminishing range of browser-bugs to battle.

This is probably the best place to "start climbing" the CSS ladder...
<http://www.w3.org/TR/2004/CR-CSS21-20040225/visuren.html>
...and from there you're probably best off by crating a few hundred (or
at least a few dozen) of your own minimal test-cases to test out and
fine-tune your basic understanding on - before going on to more advanced
levels.

Don't forget to test with all available browser-options while you're at
it, as they throw in loads of variables too. Too many designs break
because web designers ignore those browser-options, and it is a fact
that some end-users actually set their browser-options to something
other than defaults.

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/

Reply via email to