Reputation: 4517
My code is as shown below:
test.html
<div class="q-img-container">
<img id="q-order-img" src="../img/ic_truck.png" alt=""></img>
</div>
But it gives me following error:
"Unhandled Promise rejection:"
"Template parse errors:
Void elements do not have end tags "img" ("iv class="q-img-container">
<img id="q-order-img" src="../img/ic_truck.png" alt="">[ERROR ->]</img>
</div>
My directory structure is as follows:
---app
------img
----------ic_truck.png
------template
----------test.html
What am I missing here?
Upvotes: 4
Views: 1242
Reputation: 760
img
tag is a void element
. Such elements cannot have any content and are forbidden to be closed (W3C recommendation).
As the error message says, remove the end tag </img>
.
Just use following
<img id="q-order-img" src="../img/ic_truck.png" alt="">
Please refer to this answer.
Upvotes: 6