I would like to generate a certain style in which there is an image (icon) on the left side, and next to it there is some description (plain text).
So here is what I got so far:
.elem { margin-left: 7%; position: relative; width: 100%; } .text { display: inline; vertical-align:middle; } .img { width: 5%; vertical-align:middle; }
<div class="elem"> <img class="img" src="https://d30y9cdsu7xlg0.cloudfront.net/png/172871-200.png"/> <span class="text"> (1) This is a example text </span> </div> <br> <div class="elem"> <img class="img" src="https://d30y9cdsu7xlg0.cloudfront.net/png/172871-200.png"/> <span class="text"> (2) <b>This is a LONG example text, because this is a LONG example text while it a LONG example text also this is a LONG example text, also because this is a LONG example text while all is a LONG example text</b> </span> </div> <br> <div class="elem"> <img class="img" src="https://d30y9cdsu7xlg0.cloudfront.net/png/172871-200.png"/> <span class="text"> (3) This is a example text </span> </div>
As you can see, it works fine, but second elem (div) with long text generates a line break, which causes my text to float to the left. But I want the lines to be indented, like the first word in a sentence. Look at this:

user9225081
source share