'How do I align the text beside the picture?
The code is:
<main>
<p>The following decades show the data:</p><br>
<img src="fiba-1950.jpg"><p>-1950</p>
<p>1960</p>
</main>
The text is under the image, I tried changing the value of p but that would also change the upper paragraph. I would like the text to be aligned to the left so that there would be space in between both images. "-"
Thank you.
Solution 1:[1]
you can add float property to the image like:
<img src="fiba-1950.jpg" style="float: right;">
Solution 2:[2]
<div style="display: flex">
<p>The following decades show the data:</p><br>
<img src="fiba-1950.jpg"><p>-1950</p>
<p>1960</p>
</div>
That will help you. If you use bootstrap, it will be more easy.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Jonathan |
| Solution 2 | Francesco Tagliani |
