Css Selector

Name Example Description Link
element p Selects all <p> elements
#id #firstname Selects the element with
* * Selects all elements
.class .intro p.intro Selects all elements with Selects all <p> elements with
[attribute] [lang] Selects all elements with a lang attribute
[attribute=value] [] Selects all elements with
[attribute~=value] [title~="flower"] Selects all elements with a title attribute containing the word "flower"
[attribute|=value] [lang|="en"] Selects all elements with a lang attribute value equal to "en" or starting with "en-"
[attribute^=value] [href^="https"] Selects all elements with a href attribute value that begins with "https"
[attribute$=value] [href$=".pdf"] Selects all elements with a href attribute value ends with ".pdf"
[attribute*=value] [href*="w3schools"] Selects all elements with a href attribute value containing the substring "w3schools"
& & Applies styles for an element within the context of another element