What is the difference between ID and CLASS In Html? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is the difference between ID and CLASS In Html?

20th Jul 2019, 5:53 AM
hami boyđŸ‡ȘđŸ‡č
hami boyđŸ‡ȘđŸ‡č - avatar
4 Answers
+ 4
In the CSS, a class selector is a name preceded by a full stop (“.”) and an IDselector is a name preceded by a hash character (“#”). The difference between an ID and a class is that an IDcan be used to identify one element, whereas a class can be used to identify more than one.
20th Jul 2019, 6:33 AM
Muaz Ahmad
Muaz Ahmad - avatar
+ 3
In id, the priority of styles in css is higher; unlike classes, id is better used for binding anchor links, for binding label to input, and for binding events js.
20th Jul 2019, 5:57 AM
Anna/ĐĐœŃ
Anna/ĐĐœŃ - avatar
0
ID es un atributo Ășnico que solo puedes usar en una etiqueta, no puedes repetir el mismo valor en otro id, y CLASS lo puedes usar mĂșltiples veces, reutilizar su valor cuantas veces quieras đŸ‘đŸ’»đŸ™‹đŸ˜€
25th Jul 2019, 10:13 PM
Samuel Alejandro Gonzalez
Samuel Alejandro Gonzalez - avatar
0
"id" is not duplicate and can be assigned only once and only to one element. "class" can merge a group of elements. When styling in CSS, the priority for id = 100, class = 10, tag name = 1.
2nd Aug 2019, 8:50 AM
Andriy Halychanivskyi
Andriy Halychanivskyi - avatar