On Wed, 10 May 2006 16:54:18 +0100 Alan Silver <al*********@nospam.thanx.invalid> wrote:
| In article <e3*********@news3.newsguy.com>,
ph**************@ipal.net
| writes
| <snip>
|>| Any explanation? TIA
|>
|>If you keep shrinking the width of the columns at what point does it work
|>OK in IE?
|
| 1.8% was the point where it started working in IE. I tried 1.9%, but
| that didn't work either.
What I meant was to shrink the columns themselves, not the gutter.
But at least this tells you that the rounding errors totaled too high
in your case.
|> And check to be sure it works with varying window sizes and
|>with varying user font sizes.
|
| Yup, done that. It seems pretty consistent, at least until you get to
| extreme combinations ;-)
Well, when the font is so large and the window is so small that you can
only get 1 or 2 letters on a page, it's not likely very many people will
be tolerating that in general.
|>Also, do it with the total adding up to slightly less than 100% to account
|>for "slop" (an extra pixel due to rounding up when calculating pixel counts
|>could end up with the total being 1 or 2 pixels over). 99% should do it.
|
| That's what I thought, but it's not that simple. I had to reduce my
| total width to 99.6% instead of 100%. At 1280x1024 (my screen
| resolution), that .4% comes out at just over 5 pixels. That's quite a
| lot of rounding errors!!
It's possible for it to come out with one pixel more for each object if
you're quite unlucky. And some viewers will end up with that.
|>You _may_ have to end up using tables. And CSS tables are unknown to IE
|>so you'd have to end up using HTML tables.
|
| Nah, I can live with the few pixels discrepancy between the spaces, I
| just wondered if there was some rational explanation, or simple
| workaround for the problem.
This is the best I know of without going to tables.
|>| Disclaimer: I know that semantically speaking, col1, col2 and col3 are
|>| not good names for the divs as they reflect a presentational aspect, not
|>| a semantic one. They were used here as I was experimenting with CSS, so
|>| wanted to ensure that I knew which was which. I promise not to do this
|>| on a real page!!
|>
|>The names are whatever you mean for them to be. Maybe "left", "center",
|>and "right" might be better?
|
| No, because the HTML shouldn't contain presentational code. What if I
| decided to shift the columns around? The names would become meaningless
| then.
So try changing it from 3 columns to 4 columns ... in the CSS.
You can't really remove every last bit of presentation from the HTML.
Of course if what you have are a number of blocks of text, and the column
position doesn't matter, then you could let them float where they will
and the end user viewing it can arrange as desired.
It just depends on whether _your_ content needs to have a certain kind of
presentation or not. If you are concerned about the right block falling
down to the next row, then maybe your content does need a specific
presentation.
|>There has to be some aspect of presentation in the HTML markup just to mark
|>what goes where.
|
| Why? Surely the HTML should be marked up to make sense of the structure
| of the document. The CSS then works with that and adds presentation.
If all you have is a sequence of unclassified DIV elements, how are you
going to arrange that into a layout of 3 columns, or 4 columns, just in
the CSS alone? Of course you can let them float and they will form the
column layout that best fits. And in many cases that's all one needs.
But if you must have 3 columns, you have to structure your content markup
to indicate what is in each column, such as in the form of 2 levels of
DIV elements with 3 children at the 2nd level for each 1st level. Ask
yourself if that column arrangement is what you mean for the content.
|> Meanings change from page to page, and if you want to use
|>the same CSS to create a layout applicable to many _different_ page meanings,
|>then you have to use something which ends up having no meaning besides what
|>goes where in the presentation.
|
| On the contrary, you should use names that reflect the nature of the
| content. That way, the names have meaning wherever they are used. For
| example, a div name like "sitelinks" always means the same. If one CSS
| file decides to place the links in this div across the top of the page,
| and another CSS file puts them down the left margin, well that's a
| presentational issue. The HTML shouldn't reflect that.
You can't do all possible things in the presentation style. It is bound
by the order of things in the content. Try swapping the 1st column with
the 3rd column from your 3 column layout by only changing CSS.
--
-----------------------------------------------------------------------------
| Phil Howard KA9WGN |
http://linuxhomepage.com/ http://ham.org/ |
| (first name) at ipal.net |
http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------