|
Posted by fred.haab@gmail.com on 06/01/06 18:40
Ed Mullen wrote:
> I'm sure there's something horribly wrong with this but I tried it real
> fast just as an exercise. http://edmullen.net/temp/test2.html. It does
> validate, for what that's worth. I've shrunk the window, blown up and
> reduced the text, etc. and it seems to work well in Mozilla and IE. the
> worst thing that seems to happen is that the placement of the TITLE will
> shift noticeably right when the text is absurdly enlarged in Mozilla.
> There's probably some way to overcome that but nothing occurred to me in
> the brief time I spent on this.
Yes - that all works the way you describe it, but I will not have any
wrapping list items. You see, your fifth item forces the list to the
maximum width of the div that it's enclosed in. If you made that item
no bigger than, for example, the third item, you would see the problem
more clearly.
Then you'd adjust the widths of the margins to make it look right.
Then when you resized the window, you'd more clearly see the problem...
In my list, the options are short. I don't want them to wrap unless
they absolutely have to.
If I used a table data element, the element would expand when I
increased the font size up until the maximum it could be before
wrapping the list item.
Also, using the technique you used, without wrapping, you'd play with
the margins until it looked right for you and your browser window
size.... let's say you did a lowest common denominator and reasonably
assumed no less than a screen width of 800. So you adjust the margins
so it's reasonably centered (this is why it doesn't HAVE to be pixel
perfect, "reasonably" centered is just fine). So let's say you have
the margins set to 25%, so the content is 50%, aligned left.
Now you go up to 1280 width from 800. You've added over 50% more to
the width. Now your content box will still take up 50%, but if it
looked right before, it will now have a third of the right side taken
up by empty space.
In other words, your "box" is centered (be it a div or whatever), but
if you tweaked it so the content was centered for 800, it's not for
1280 (or even 1024). Moreover, it's worse if you built it for 1280 and
then shrink the window - now you will have all sorts of wrapping where
it's really unecessary, and there is technically plenty of horizontal
room for it.
So you might decide, then, to fix the width and "auto" the margins...
that would solve one problem, but cause another when the nearly blind
user (yes, I actually encounter them) increases the font size.
Do you see? CSS seems fine to center fixed width and sometimes
relatively sized content (relative to the window), but it seems to me
to fail for arbitrary, possibly dynamically changing sized content, as
is the case when the user changes font size, or the content contained
is unknown when the static portion of the page is written (php, asp...
scripting, like javascript makes it even worse - you have absolutely no
idea what the content might actually be).
I'm appreciating the replies and the work you put into it, but I'm
sorry I'm just not getting a solution to the problem. It's one of
those things that I can say "I can see the CSS way for 90% of the time,
but tables are still the best option the other 10%". I know that'll
make purists howl, but it works... and unlike some other "cheats",
tables are not, and won't be, deprecated.
Navigation:
[Reply to this message]
|