Issue
I am using a custom HTML tag in my code (<include>
). Is this bad practice and if so what should it be replaced with.
It seems to me that it adds readability to the code by having the meaning in the tag name instead of a <div class="include">
.
Solution
Creating custom HTML tags are perfectly fine nowadays, however, you need to know how to properly create them, for a better browser support. Make sure they have a semantic "meaning", or "role" for better readability and accessibility. It is great when working with web components.
Here is a good article about creating custom html elements: https://www.smashingmagazine.com/2014/03/introduction-to-custom-elements/
Answered By - crabbly
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.