![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| ||||
| ||||
|
|
I'm trying to compose a list of items, each of which consists of text that wraps around a picture at the left margin. The examples I have seen tell me to do it like this: p><img src="xxxx.jpg" align="left" width=nn height=nn>zzz zzzzz zz zzzzz...</p |
|
In my case, since the wrapped text includes a headline, I assume I am supposed to do this: div img src="xxxx.jpg" align="left" width=nn height=nn h2>yyy yy yyyyyyyyy</h2 p>zzz zzzzz zz zzzzz...</p /div (In my actual code I am referring to a class in the stylesheet instead of using "align=left.") |
|
This does not work (in either case) when the picture is longer than the text. The next paragraph of text is spaced from the end of the preceding paragraph, even though the picture extends beyond that point. This makes sense in the first case (image inside a paragraph), but it puzzles me in the second case (headline, image and paragraph inside a <div>). What does HTML think the <div> is supposed to do, if text does not flow around it as a unit? |
|
I have found that I can get the result I want by putting the entire list of items in a table, with each item in a one-cell row. It seems to me that there must be an easier way, though, so I wonder if I'm missing something. |
#3
| ||||||||
| ||||||||
|
|
I'm trying to compose a list of items, each of which consists of text that wraps around a picture at the left margin. |
|
p><img src="xxxx.jpg" align="left" width=nn height=nn>zzz zzzzz zz zzzzz...</p |
|
In my case, since the wrapped text includes a headline, I assume I am supposed to do this: div img src="xxxx.jpg" align="left" width=nn height=nn h2>yyy yy yyyyyyyyy</h2 p>zzz zzzzz zz zzzzz...</p /div |
|
This does not work (in either case) when the picture is longer than the text. |
|
The next paragraph of text is spaced from the end of the preceding paragraph, even though the picture extends beyond that point. |
|
What does HTML think the <div> is supposed to do, if text does not flow around it as a unit? |
|
I have found that I can get the result I want by putting the entire list of items in a table, with each item in a one-cell row. |
|
It seems to me that there must be an easier way, though, so I wonder if I'm missing something. |
#4
| ||||
| ||||
|
|
I'm trying to compose a list of items, each of which consists of text that wraps around a picture at the left margin. In my case, since the wrapped text includes a headline, I assume I am supposed to do this: div img src="xxxx.jpg" align="left" width=nn height=nn h2>yyy yy yyyyyyyyy</h2 p>zzz zzzzz zz zzzzz...</p /div |
|
(In my actual code I am referring to a class in the stylesheet instead of using "align=left.") |
|
This does not work (in either case) when the picture is longer than the text. The next paragraph of text is spaced from the end of the preceding paragraph, even though the picture extends beyond that point. This makes sense in the first case (image inside a paragraph), but it puzzles me in the second case (headline, image and paragraph inside a <div>). What does HTML think the <div> is supposed to do, if text does not flow around it as a unit? |
|
I have found that I can get the result I want by putting the entire list of items in a table, with each item in a one-cell row. |
#5
| |||
| |||
|
|
The <div> markup only means a block. When the end tag </div> is encountered, a line break is generated |
|
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. |
#6
| |||
| |||
|
|
On 2008-04-27, Jukka K. Korpela <jkorpela (AT) cs (DOT) tut.fi> wrote: [...] 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. |
|
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. |
#7
| |||
| |||
|
|
Scripsit Ben C: On 2008-04-27, Jukka K. Korpela <jkorpela (AT) cs (DOT) tut.fi> wrote: [...] 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/stru....html#edef-DIV |
|
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. |

#8
| |||
| |||
|
|
I'm trying to compose a list of items, each of which consists of text that wraps around a picture at the left margin. The examples I have seen tell me to do it like this: p><img src="xxxx.jpg" align="left" width=nn height=nn>zzz zzzzz zz zzzzz...</p In my case, since the wrapped text includes a headline, I assume I am supposed to do this: div img src="xxxx.jpg" align="left" width=nn height=nn h2>yyy yy yyyyyyyyy</h2 p>zzz zzzzz zz zzzzz...</p /div (In my actual code I am referring to a class in the stylesheet instead of using "align=left.") This does not work (in either case) when the picture is longer than the text. The next paragraph of text is spaced from the end of the preceding paragraph, even though the picture extends beyond that point. This makes sense in the first case (image inside a paragraph), but it puzzles me in the second case (headline, image and paragraph inside a <div>). What does HTML think the <div> is supposed to do, if text does not flow around it as a unit? I have found that I can get the result I want by putting the entire list of items in a table, with each item in a one-cell row. It seems to me that there must be an easier way, though, so I wonder if I'm missing something. |
#9
| |||
| |||
|
|
I'm trying to compose a list of items, each of which consists of text that wraps around a picture at the left margin. The examples I have seen tell me to do it like this: .... |
|
In my case, since the wrapped text includes a headline, .... |
|
I have found that I can get the result I want by putting the entire list of items in a table, with each item in a one-cell row. It seems to me that there must be an easier way, though, so I wonder if I'm missing something. |
![]() |
| Thread Tools | |
| Display Modes | |
| |