I have a text and an image where I want to apply "text-wrap". In my case the text is only wrapping below the image, but I'm trying to achieve the exact opposite. A fiddle says more than thousand words..
https://jsfiddle.net/x5486cpj/1/
html
<p>
<span class="myimage">Image</span>
Lorem Ipusm sum dolor set Lorem Ipusm sum dolor set Lorem Ipusm sum dolor setLorem Ipusm sum dolor set Lorem Ipusm sum
dolor setLorem Ipusm sum dolor setLorem Ipusm sum dolor setLorem Ipusm sum dolor set etLorem Ipusm sum dolor setLorem Ipusm sum dolor setLorem Ipusm sum dolor set etLorem Ipusm sum dolor setLorem Ipusm s
um dolor setLorem Ipusm sum dolor set
</p>
css
.myimage {
width: 140px;
height: 120px;
position: relative;
float: right;
top: 15px;
margin: 11px;
border: 1px solid red;
}
*I want the text to be wrapped ABOVE the image only , not below *
thanks
height: calc(100% - 120px);
will help you out here :)
body {
font-family: sans-serif;
font-size: 13px;
}
.container {
max-width: 400px;
height: 200px;
}
img {
height: 100px;
width: 150px;
background-color: white;
border: 5px solid red;
box-sizing: border-box;
float: right;
clear: right;
}
.spacer {
height: calc(100% - 120px);
width: 0px;
float: right;
}
<div class="container">
<div class="spacer"></div>
<img/>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>