|
Posted by Ben C on April 27, 2008, 1:17 pm
Please log in for more thread options > Scripsit Ben C:
>
>> [...]
>>> The <div> markup only means a block. When the end tag </div> is
>>> encountered, a line break is generated
>>
>> Loosely speaking I suppose this is OK, but </div>'s effect on text is
>> more like a paragraph separator than a line break.
>
> No, it's strictly so that <div> specifies a block, and this means line
> breaks before and after and no other default effect on rendering. The
> HTML 4.01 specification says this poorly but clearly enough:
>
> "The DIV and SPAN elements, in conjunction with the id and class
> attributes, offer a generic mechanism for adding structure to documents.
> These elements define content to be inline (SPAN) or block-level (DIV)
> but impose no other presentational idioms on the content."
> http://www.w3.org/TR/REC-html40/struct/global.html#edef-DIV
The reason I say it's more like a paragraph separator than a line-break
is because of the bidi algorithm.
A line-break (or a BR) doesn't pop embedding levels for example but
starting a new DIV does.
>>> Tables have their own rendering rules, including the fact that flow
>>> does not continue from one cell to another. I think there's nothing
>>> in the specifications that says this explicitly, but this is clearly
>>> the intent and it's how browsers work.
>>
>> The CSS spec says that a table cell is a "block formatting context".
>> This means that the flow inside the table cell is not affected by any
>> floats originating outside it, and also that no floats originating
>> inside a table cell affect the flow of anything outside it.
>
> That's undoubtedly the idea, but I was unable to find it stated
> explicitly.
It's all in there, but I have put it more clearly :)
|