+ 3

Is it possible to use id and class for the same element?

most frequent questions in html

6th Jun 2018, 7:41 AM
Akani_Tony
Akani_Tony - avatar
5 Answers
6th Jun 2018, 7:52 AM
Duncan
Duncan - avatar
+ 2
yes possible
6th Jun 2018, 8:09 AM
Amin
Amin - avatar
+ 2
Yes. It was possible to use both ID and class in the same element. The same thing goes for classes. You can have multiple elements for one class. Though, in this kind of case...it was preferable to use the tag selector and/or the class inheritance in CSS.
8th Jun 2018, 6:41 AM
Rhoshielamie Libuna
Rhoshielamie Libuna - avatar
+ 1
You can use one id and multiple class in one element.
6th Jun 2018, 8:50 AM
CalviŐ˛
CalviŐ˛ - avatar
0
Yes, it's possible.
9th Jun 2018, 12:27 PM
Alexis Davila
Alexis Davila - avatar