Why the anchor(a) tag appeared next to the image and not below it? isn’t the page suppose to be read from up to bottom?
<h1>Our Menu</h1>
<h2>Falafel</h2>
<p>Chickpea, herbs and spices.</p>
<img src="flafel.jpeg" width="240" height="135" alt="Flafel">
<h2>Pasta Salad</h2>
<p>Lettuce, vegetables and mozzarella.</p>
<img src="salad.jpg" width="240" height="135" alt="Salad">
<a href="location.html">Our Location</a>
I was trying to practice some html basics but this problem happened and can’t find an explanation for it.
2
Answers
this is because img and anchor "a" tag are both the inline tags.
to solve this issue you should try wrapping the "img" image tag into a div
For now, you can use a
<br>
on the line between the image and text. It would be better to learn CSS and relatively position it below but thetag works.
Also the images in this demonstration cannot be shown because I have no access to that location, but this should work for you.