How to align text with the image

I tried using display:inline, text-align:center but it wouldn’t work at all. The text would start before the image and end after the image which I don’t want. Having the answer to this would help solve my main issue that I’m really concerned about. Thanks.


Hi 1to1, I could help you better if you could post your current code/ link to it on CodePen.

I am not exactly sure what it is you are trying to accomplish but I’m thinking that float might solve your problem. Are you trying to have the text and the picture side-by-side? Posting a codepen that others could look at would help

Hi 1to1, what Kaite said it’s true, it would be better if you shared the code with us.

But, you could read this post, it has an entire explanation of how inline works, or this post where I explain a little about how float works.

Also, explain better what do you want.

See ya and keep coding

I want the text to stay in range with the image just like the picture I posted before. You see how the text goes after image and keeps going ? I don’t want that to happen but rather make it stay align with the image. Hope this makes more sense. :grinning:

Dubai is a global city and business hub of the Middle East.[8] It is also a major global transport hub for passengers and cargo.

Hi @1to1
Maybe you should wrap your image and the text with a container and give the container some min and max width for responsiveness and give the img a 100% width.