Home > Mobile >  Make text appear to the right of a picture
Make text appear to the right of a picture

Time:03-08

<div style="float: left;">
    <img src="image.png"/>
    <div style="font-size: 100px;">Health And Wellbeing</div>
</div>

When I run this code, the words appear underneath the picture, is there any way to make the words appear to the right of the text?

CodePudding user response:

I am not sure why your container div has float: left; in its styles, but you can use Flexbox to arrange the contents with more flexibility.

Here's a simple example:

<div style="float: left; display: flex;">
    <img src="https://picsum.photos/seed/picsum/200/300" />
    <div style="font-size: 100px;">Health And Wellbeing</div>
</div>

CodePudding user response:

Isn't it simple? Just put <img> after the words...

<div style="float: left;">
  <div style="font-size: 100px;">
    Health And Wellbeing
  </div>
  <img src="image.png" />
</div>

  •  Tags:  
  • html
  • Related