Sent by Gunlaug_Sørtun on 15 May 2005 16:04
Leo Smith wrote:
> When using EM values for font sizes, it seems optimal to then use EM
> values for any margin-top, padding-top, margin-bottom, or
> padding-bottom values for the content elements (p, ul, ol, etc). This
> way, when text is resized, the vertical distance between content
> elements increases proportionately.
Vertical space between paragraphs should grow with font-resizing (I
think), so I use EM on top and bottom margins here and there. However,
not even vertical space may need to grow proportionally for optimal
result. This can be solved by using paddings in px and margins in EM on
paragraphs. The space grows and shrinks, but not proportional.
> But, what about right and left margins and padding. Is it also
> optimal to use EM values for those as well, so that any horizontal
> spacing also increases proportionately with resized text?
I don't think so.
> Similarly, would it be better to use EM values for the widths of
> fluid column divs, rather than percentage values?
Most often not.
--------------------
Read the following as: "I don't think there's an optimal choice of unit".
There is however more optimal results with some unit-combinations than
with others, and a small series of tests across browser-land will give
you an "optimal" set to use for your pages.
---
We have basically 3 options for layout:
1: fixed width (width is predefined, and all resizing is vertical)
2: fluid width (width self-adjust to browser-window and content resize
vertically)
3: flexible = proportional (width and height resizes independent of
browser-window). That's equal to your third paragraph.
A multitude of mixes between these 3 options in any given layout, makes
"general optimal rules" a bit too restrictive.
Columns that fall down when font is resized, is often caused by using
EM for width and spacing. May be useful at times, but most often not
what we want
Solving this by using option 3: setting the page-width in EM, may create
some unwanted sideways scrolling if one wants to bump up font-size a bit.
Guess that's why Opera 8 is given the option to "kill" width-definitions
in any page. :-)
I don't find *proportional rivers of vertical whitespace* all that
useful, so I don't use EM all that much for width and sideways
margins/spacing.
There has to be enough whitespace in a page for ease of reading, but not
necessarily proportional when scaled. It's about balance.
---
Since I'm using mostly option 2 (fluid) for a page as a whole, and
options 1, 2 and 3 for parts (columns/areas) of a page, it seems to
become most robust with a mix of EM, %, px, auto-margins and
min/max/auto width.
The optimal result is achieved (IMO) by using all available options and
learn how they interact with each other and are treated across browser-land.
It is fun to make a mix of px, EM and percentages add up perfectly,
regardless of browser-width and scale.
The solution in most cases is called "auto". :-)
Then it is up to our visitors if they like the result, or not.
Pretty broad answer to a simple question, but a more narrow response
would "deprecate" some really useful options.
I'd rather deprecate "limitations" in web design. ;-)
regards
Georg
--
http://www.gunlaug.no
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/