I have this code:
<div class = "content-dir-item"> <p>Text input</p> <img src="./images/email.png" class = "mail" alt="img-mail" /> </div>
I would put img inline with text using css. How can I do this?
Using the float property of CSS will allow you to place an image and text on the same line without breaking the line break. Or Alternatively, you should use the flexbox method of CSS that uses the flex property to make sure that images and lines are aligned in the same line.
Images have display: inline
by default.
You might want to put the image inside the paragraph.<p><img /></p>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With