How can I wrap a text around a div. Leaving the div at the middle of the text body using css?
Sketch:
text text text text
text text text text
text text text text
text text text text
+-------+ text text
+ + text text
+ div + text text
+ + text text
+-------+ text text
text text text text
text text text text
text text text text
text text text text
NOTE: From the HTML point of view, the div goes before the text.
<div></div> [... text...]
The other answers are correct in that you’ll need to float the
<div>(e.g.div { float: left; margin: 10px 0 10px 10px; }, however, keep in mind that in order for the<div>to appear in the middle of you content, it will have be in the content itself.When using a float like this, you have to just remember that you have to insert the
<div>right before the content that you want to wrap around it. So, in this case, have a paragraph of text, insert the<div>, then have a couple more paragraphs. When you float the<div>, it will appear in the middle of your content.