Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to aligne image to text? HTML/CSS

How to make the coffee image close to the text?example as it should be

how did I manage to do this

.cup {
  float: right;
}

.mbc {
  font-size: 60px;
}
<div class="page1">
  <div>
    <div>
      <h1 class="mbc">Make better<br>coffee<img src="Coffe.png" alt="Coffe image" width="70px" height="67px" class="cup"></h1>
      <p>why learn how to blog?</p>
    </div>
    <img src="Croods.png" alt="Croods" width="476px" height="323px">
  </div>
</div>

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Right now, float right makes the image always go to the right side. If the image is positioned inline (display: inline, which is the default value), the image would be placed correctly.

<h1>This is<br/>your text<img width="30" style="margin-left: 10px" src="https://hotemoji.com/images/dl/d/coffee-emoji-by-twitter.png" /></h1>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading