Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stopping text from wrapping around image

Tags:

html

css

I am destroying my mind trying to get this styling done right. I have a fixed size image with an unpredictable height div of text to the right of it. I want the top of the text to line up with the top of the image but to NOT wrap around it. My markup is:

<img height='231px' width='132px' style='float:left' />
<div>Text</div>

I would like to find a solution that doesn't involve using a table, but at the moment I am drained and can't think about how to do it with css/divs

like image 920
Andrew Jackman Avatar asked Dec 28 '22 18:12

Andrew Jackman


1 Answers

This should do the trick.

<div style="margin-left: 132px">Text</div>

To have space between the text and the image, make the margin larger or add a padding-left.

like image 128
DanielB Avatar answered Jan 21 '23 19:01

DanielB