Can I use DIV class and ID together in CSS?
css, html
Solution
Yes, yes you can.
#y.x {
/* will select element of id="y" that also has class="x" */
}
Similarly:
.x#y {
/* will select elements of class="x" that also have an id="y" */
}
Incidentally this might be useful in some use cases (wherein classes are used to represent some form of event or interaction), but for the most part it's not necessarily that useful, since `id`s are unique in the document anyway. But if you're using classes for user-interaction then it can be useful to know.
Problem
Can I use DIV Class and ID together in CSS? For example: ``` <div class="x" id="y"> -- </div> ```