Should one add class or id to a HTML document for better structure?
Usually we add id or class for CSS and Javascript selectors. When no
selector is needed, should we just not put the id or class?
Example:
# HTML
<div class="name">John Smith</div>
<div class="email>jsmith@abc.com</div>
# CSS
.name { color: red }
You see that .email is not used. Should we keep that there, or remove it?
What's the best practice?
No comments:
Post a Comment