0
<div> tag with class and id element?
Can someone explain to me a brief description on <div> tag with class and id element?I have noticed it in many websites but have not seen its usage in the HTML5 tutorial except with style.
3 odpowiedzi
+ 2
The div tag has changed in HTML5, there are now dedicated tags for the more common div usage with class and id attributes. Where you would normally write <div id="header"> for example there is now a new HTML5 element called <header> to represent the same thing.
+ 2
ID's are unique - each element can have only one ID and each page can have only one element with that ID. On the other hand, classes are NOT unique. You can use the same class on multiple elements and you can use multiple classes on the same element. This is very good article, read it. :)
https://css-tricks.com/the-difference-between-id-and-class/
0
@Andrew Dunk yes I do understand that <header> tag in HTML5 has replaced <div id=header> but in some webpages they use div tags in id and class for certain page content to be displayed;thats where I had a doubt.but thanks for the explanation
@Jakub Adamec Thanks for the explanation and web page link.