0
What is the difference between type, I'd and class selectors ?
3 Réponses
+ 4
as the names indicate, type sector select elements of a given type, class selectors select elements with the given class on them and id selectors select an element by its assigned id. Selectors will be covered in the CSS course.
+ 4
Id is unique and we can have only 1 id
#myId {
}
class is used if we have multiple elements, so we can select all of them and set style
.myClass {
}
type selector is for element name, it will target every element with this name and apply style to it
p {
}