selectors Flashcards
type selector
any HTML tag
h1 {}
p {}
section {}
etc.
class selector
selects the elements under the same class
.text-quote {}
.container {}
attribute selector
A selector that allows you to select an element based on the presence of a specific attribute
a[title] {
}
a[href=”https://google.com”] {}
What is a psuedo-class?
A selector that chooses elements in a specific state.
a:hover {}
What is a pseudo-element?
A selector that choose only part of an element.
p::first-line {}
What is the universal selector?
- {}
What is an id selector?
first-form-field {}
selects the one element with a specified id.
What are the user action pseudo-classes?
:hover //matches when a user hovers the pointer on the element
:active //matches when an item is being activated ‘click on’ by the user
:focus //matches when the element has focus
:focus-visible
:focus-within