I’m trying to create some code in which there is text on the left and an image on the right and I want them to be next to each other. The thing is, if there is no image I want the text to go across the width of the div. Is this possible? Here is the code that I have been working on:
Code:
<div style="width: 220px; border:1px solid #000;">
<span style="position:relative; float:left; clear:left;">At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium</span>
<img src="../../Public/Pictures/Sample Pictures/Desert.jpg" style="width:30px;height:60px;vertical-align: top; float:right; clear:right;" />
</div>