On 14/10/2010 09:09, Stephan Soller wrote:

There is no confusion, I know "the "position" property does not
influence how large an element is". I don't care how big or small the
inner div is, I just want it to be contained in the parent div. I just
mentioned the 'position' property because if position is 'fixed', it
does make sense for that div not to be considered as contained in the
parent div. But not so for other values of position (at least for the
default one).


Sorry, look like I got confused then. :)

I'm still not sure if I understand your point correctly. Do you mean
that it's inconsistent that some positioning models take the element out
of the document flow?


Not exactly. My problem is that when an element is taken out of the flow (such as with "float:left"), it means the element no longer needs to be contained in the parent div. I think that model is very unhelpful. Although I'm no expert in HTML coding, I would venture that in at least 90% of the cases that's what you want (for the element to be contained in the parent, if its position is not 'fixed'). Otherwise this brings up several problems: it messes up the layout of the elements right after the parent div. Or it messes up the area for the background/border colors of the parent div. However if a clearer div works without additional problems, I'm probably happy with that, even if its more verbose.


But all this does not change the fact that
using floats for column layouts is still nothing else than a workaround
for the missing column layout model in the early days.

For many page layouts this actually isn't needed but especially people
used to use tables for layouts often try to use this technique because
it mimics tables more or less. With CSS tables you don't have to use
floats any more since you have all the power of tables in CSS now (with
less markup in most cases). These however only work with IE 8 or newer
(I'm not sure if not already in IE 7) and I don't know about FF 2. If
you have to make pages that work in IE 6 and 7 you still have to use
floats though.


Well I would say some sort of "column layout model" (if understood your
term correctly) is pretty essential. You need something like that, or
something that can do the same job nearly as easily. So are you saying
its ok to use CSS tables now? (disregarding the issue with old browsers)
Because when I first learned about CSS and div layouts, the mantra was
"tables are evil, don't use tables".


I also heard/read that a lot when learning CSS. Using table _elements_
for layout is bad stuff since the table element in HTML indicates
tabular data. If you use it for layout the abstract content (or data) of
the page gets totally screwed up just for it to look right.

However the layout rules of tables are quite useful and so they found
their way into CSS. If you can properly separate data from presentation
you can use whatever layout rules you want. ;)

Basically don't use table _data_ to push elements around in HTML. Using
table layout rules in CSS is ok since it does not interfere with the
data of the page.


Ok, so it is as I thought, is is still "wrong"/unrecommended to use tables for layout. The recommended way to do column layouts is still with divs, right? By "column layouts" I don't mean tables, but stuff like a sidebar of any kind (the typical two or tree column layout).

--
Bruno Medeiros - Software Engineer

Reply via email to