Hi, I need to wrap text around a div like in the atached image (at top, right and bottom). The code is something like this: <div class="container"> <div class="DIV"> DIV DIV </div> TEXT TEXT TEXT </div> Like this - http://vreaudetoate.ro/wrap.jpg
Hi radiofanatic, what you need is the float property. Try this example below: .div { float: left; } Look at this - its straightforward once you read it twice: http://www.tizag.com/cssT/float.php Le007
No, thats not what I need. Look better at the picture, the div inside the content is surrounded by text, at the top, right and bottom. Also the DIV code is first, then is TEXT in the html code.
like le007 said, you'd have to use the float property. to get the text to go above the div, you have to move the div inside the text in the HTML, the div can't go first. i've tried looking for cleaner ways of doing this, but i couldn't find any.
as soon as i posted my previous message, i thought of another way. it's kinda cheap but it works and only if your DIV stays put. put another div, let's give it the class name "topWrapSpacer" (i suck at naming my divs), above DIV. so your html should be like this now: <div class="container"> <div class="topWrapSpacer"></div> <div class="DIV"> DIV DIV </div> TEXT TEXT TEXT </div> Code (markup): now add the following css: div.topWrapSpacer { width: 0px; height: 100px; float: left; } div.DIV { float: left; clear: both; } Code (markup): so basically topWrapSpacer is pushing down the DIV div, but because it has no width, it doesn't affect the text. this way, you can keep the DIV div first in the html. this works in firefox and safari, but i haven't tested this out in IE ::shakes fist:: yet.
Good workaround rikun, but he should learn about floats. Nested divs are fine - just keep them well tabbed in and with names that are easily identifiable.