/    Sign up×
Community /Pin to ProfileBookmark

Getting a ul to flow under a floated img

I have noticed that in some cases, the <li> elements in a <ul> will not flow properly under a floated <img>.

Case in point:

[code]
<img src=”image.gif” style=”float:right” />

<p>text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text</p>

<ul>
<li>text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text</li>
<li>text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text </li>
<li>text text text text text text text text text text text text text text text text text text text text text </li>
</ul>
[/code]

You will have to play with your window size to see the problem. If the first line of the first <li> element is not below the <img> then none of the <li> element will flow under the <img>.

I assume that each individual <li> element is a block and will not flow under the floated <img> but I would also like to correct this if possible.

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@toicontienOct 26.2006 — I've noticed this problem too. It happens for UL and OL elements. You're pretty much stuck with it as far as I know.
×

Success!

Help @House_of_Haus spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...