"The id attribute got more classy in HTML5" is written at some pages. If I use class attribute instead of id, does it conform to HTML5? Thanks for your help.
See Question&Answers more detail:os"The id attribute got more classy in HTML5" is written at some pages. If I use class attribute instead of id, does it conform to HTML5? Thanks for your help.
See Question&Answers more detail:osThe attributes still have two different purposes:
class
can contain multiple classes and multiple elements can have the same classesid
contains a single ID and that ID can only be used for one element.The statement you quoted exists because some restrictions on how an ID must look like have been lifted in HTML5 - classes never had those restrictions.