roman-v1 roman-v1 - 5 months ago 6
HTML Question

How to display text around box?

here is my example: http://jsfiddle.net/9y7d3124/1/, I'm trying to display red box in the right top corner, AND TEXT AROUND it, but if there too much text on the left box is moving below, if I set absolute position for box text is moving under the box, text is dynamic, because of it can't set it by margins or paddings, does anybody know a solution? Here html code:

<div class="left">asdfwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww</div>
<div class=right></div>

Answer

.parent {
  overflow: hidden;
}

.right {
    margin: 0 0 15px 15px;
    width: 200px;
    height: 200px;
    background: red;
    float: right;
}
<div class="parent">
  <div class=right></div>
  <div  class="left">asdfwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwww</div>
</div>

Comments