What do you mean by Id can be applied only once per page because I tried it twice and it worked? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What do you mean by Id can be applied only once per page because I tried it twice and it worked?

10th Dec 2016, 5:02 AM
arun menon
arun menon - avatar
5 Answers
+ 4
WITCH. BURN HER! NO BLACK MAGIC...
10th Dec 2016, 5:13 AM
Ahri Fox
Ahri Fox - avatar
+ 1
It will overwrite the old cmd
11th Dec 2016, 8:50 PM
Mayer Luca
Mayer Luca - avatar
+ 1
I think it also just falls under "best practices" for readable code... If you give something an id it is to set it apart as unique so you wouldn't want to use that same id again, whereas I could have the same class on multiple elements.
12th Dec 2016, 8:16 PM
Carly
+ 1
If you use same ID multiple time it will wor.k in CSS. But there will be problem in JavaScript. There will be also problem when you are using <a> tag for scrolling in the page like this. <a href="#id_name">go to ...</a>
26th Dec 2016, 3:36 PM
Ankit Maru
Ankit Maru - avatar
- 1
no were getting this all wrong. an ID is unique ,its used to divide web pages into sections and can be applied once per page.Just like your body is divided into torso and limb.you can't have two torsos.if we have an ID footer,we can't have two footer.HTML always tolerates wrong syntax.but I don't think it will validate.
14th Dec 2016, 4:09 PM
victor
victor - avatar