Mark Rogers wrote:
On 12/05/11 11:29, MJ Ray wrote:
Excuse me for walking in part-way through, but have you tried putting the border and background on div#container instead of div#content? You may need to tweak background-position (IIRC) to get it just so.
I'm not sure I understand: the "border" is the line between the two "cells" so is not on any outer edge of div#container, but somewhere within it.
Yes, that's doable with a background image on top of a background colour. Or you can put a border on both the side bar and the content and position them to overlap. There are tons of ways to skin this kitty depending on exactly how long you want that fur stole to be.
If this were a table-based layout, the left and right "cells" would by-definition be the same height.
On some devices.
On "most" devices?
There's no proof of that.
Don't you love web tech? :-) This is where I earn my money. :-)
Absolutely!
What I find frustrating is that CSS was developed "with the benefit of hindsight" yet doesn't solve many of the layout problems that tables do solve.
I feel it solves most of the styling problems, but not necessarily in a narrow "my layout is the only layout" way.
Another example: Foo Bar FooFoo BarBar
How do I lay that out so that Bar/BarBar are aligned vertically, for any value of Foo/FooFoo? With a table this is easy. (Putting Foo/FooFoo in one div, floated left, and Bar/BarBar in another div, would work, but only if Foo/FooFoo/Bar/BarBar never individually exceed a single line, unless I don't care that FooFoo/BarBar are also horizontally aligned, which I do....
If you'd settle with them aligned only in some conditions (browser window the right size and shape) then that's do-able. One of the CSS grid systems should do it, although now I've just noticed that the latest version of cssgrid.net isn't scaling down for me :-/
If they really don't make sense if they're not aligned both ways, then that may well be a table and should be marked up as such.
If they make sense without alignment but you want to force them to be aligned even in non-ideal conditions, then... DON'T DO THAT! :)
Good luck,