简体   繁体   中英

How can stop text wrapping around some floated divs?

I floated 3 images in div s in the middle of a long section of text. I want to float them so the site keeps it's 'liquid' design, adapting to any width browser window. But if text starts wrapping to the left of them on wide Windows, it looks bad. I'd like them to float, but still be able to clear text around them so they look like a block element. How can I do that?

I thought maybe of sticking in a 100% width div right after the image div s, that's 1px high, and filled with a 1px image that's just the background color. Will that work?

http://www.briligg.com/frailty.html The images in question are the ones at the beginning of the 'the cause of addiction is stress' section. Line 134 to 146, references the internal style sheet.

Put a clear: left on your section of text following the images.

That appears to be your div with class text though I don't know if you would want to universally apply the clear to all the divs with that class.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM