Can you use the ID attribute more than once?


#1

I thought the ID attribute was “unique”—that you could only use it once per page. ??


#2

The attribute isn’t unique, the attribute can be used multiple times. But each name of id element should be unique, so this is fine:

<div id="one"></div>
<div id="two"></div>

this isn’t:

<div id="one"></div>
<div id="one"></div>

although browser do allow the latter one as well, its not good practice.


#3

Thank you!

Does codecademy hav a course in WordPress too? More advanced


#4

Nope, no wordpress course

but wordpress is simple, its drag and drop which means you don’t even have to know html & css.