I am trying to get a text to wrap around a div
in my XHTML. My XHTML looks like so....
<div id="cont-content"> <p>content</p> <p>more content</p> <div id="content-sidebar"> BLALALALALLAAL </div> </div>
And my CSS looks like...
#content-sidebar { display: block; float: right; width: 270px; height: 400px; border: 1px solid red; }
Can you see any reason why the text will not wrap around this Div?
You have to set 'display:inline-block' and 'height:auto' to wrap the content within the border. Show activity on this post. Two ways are there. No need to mention height in this it will be auto by default.
The <wbr> element If you know where you want a long string to break, then it is also possible to insert the HTML <wbr> element. This can be useful in cases such as displaying a long URL on a page.
Yep you got it. The #content-sidebar should be before all the texts which are supposed to wrap it. Like this:
<div id="cont-content"> <div id="content-sidebar"> BLALALALALLAAL </div> <p>content</p> <p>more content</p> </div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With