Selectors target HTML elements and apply styles based on their attributes, types, and relationships.
Universal selector:
*{
}
Element:
element{
}
Attribute:
#id {
}
.class {
}
element[attribute='value'] {
}
Pseudo-class:
Select and style elements based on their state
Pseudo-class attached to a selector
selector:pseudo-class {
}
Pseudo-classes include:
:hover
:active
:focus
:visited
:first-child
:last-child
:not
:enabled
:disabled
Top comments (0)