hello everybody. seems that I wasn't able to explain my problem in my previous topic, so I've made two example pages to properly illustrate what solution I'm looking for.
http://www.zone.ee/obmen/reference.htm - this is a visual example of what I'm trying to achive. There is a table of 3 cells: left and right cells have fixed width, center is not fixed and can be stretched according to contained data. all cells have different transparent png files on background.
http://www.zone.ee/obmen/test.htm - this is a what I'm getting when trying to achieve the same effect using floating divs. the main problem here is that transparent background of floating divs and div in center are overlapping.
how can this be done without tables?
1. the whole structure SHOULD NOT have fixed width.
2. display: table, display: table-cell, and so on, should not be used, as they fail in more complicated cases, because there are no rowspan and colspan for them.
I haven't looked at your
I haven't looked at your code, BUT
Have you tried putting a left and right margin on the center div to clear the width of the right and left divs?
Thanks for your answer, it
Thanks for your answer, it does really works fine!
But, it seems to me, that usage of margins in this case looks more like some dirty trick
Not at all, this is the way
Not at all, this is the way we all (I hope) do it. I suspect margins are the most commonly used feature of css when applied to block level elements.
Do, however, remember that different browsers apply different default margins.
I start my css with this:
thanks, seems like this is
thanks, seems like this is the only normal way to solve this problem.
btw, what does 'border-collapse:0' mean in your example? does the 'zero' ( value do the same thing as 'separated'?
Border-collapse (by definition) collapses adjacent borders.
Say you have two divs with no margin between them, and each has a 1px solid black border.
Where the two divs meet there will be a 2px border.
border-collapse collapses the duplicated border, so in this case there would only be a 1px border between the two elements.
And the use of margins isn't a dirty hack, it's the common methodology employed by most (if not all) CSS designers.
thanks for the
thanks for the answering.
according to this, zero is not a value for border-collapse property. am i right?
2. I didn't mean that margins themselves are a dirty hack
I just meant, that, as far as I understand, margins were not intended for clearing the space for floats. But, anyway, if this is done according to CSS2 specs, this is not hack.