CSS: Pseudo-Classes Flashcards
(44 cards)
What are Pseudo-Classes?
These are special CSS keywords that allow you to select an element based on its specific state or position.
What are User Action Pseudo-Classes?
These are special keywords that allow you to change the appearance of elements based on user interactions, improving the overall user experience.
What is the “:active” Pseudo-Class?
This pseudo-class lets you select the active state of an element, like clicking on a button.
What is the “:hover” Pseudo-Class?
This pseudo-class defines the hover state of an element.
What is the “:focus” Pseudo-Class?
This pseudo-class applies styles when an element gains focus, typically through keyboard navigation or when a user clicks into a form input.
What is the “:focus-within” Pseudo-Class?
This pseudo-class is used to apply styles to an element when it or any of its descendants have focus.
What are “input” Pseudo-Classes?
These pseudo-classes are used to target HTML input elements based on the state they are in before and after user interaction.
What is the “:enabled” Pseudo-Class?
This pseudo-class is used to target form buttons or other elements that are currently enabled.
What is the “:disabled” Pseudo-Class?
This pseudo-class lets you style an interactive element in disabled mode.
What is the “:checked” Pseudo-Class?
This pseudo-class is used to indicate to the user that it is checked.
What is the “:valid” Pseudo-Class?
This pseudo-class targets the input fields that meet the validation criteria.
What is the “:invalid” Pseudo-Class?
This pseudo-class targets the input fields that do not meet the validation criteria.
What are the “:in-range” and “:out-of-range” Pseudo-Classes?
These pseudo-classes apply styles to elements based on whether their values are within or outside specified range constraints.
What is the “:required” Pseudo-Class?
This pseudo-class targets input elements that have the required attribute. It signals to the user that they must fill out the field to submit the form.
What is the “:optional” Pseudo-Class?
This pseudo-class applies styles input elements that are not required and can be left empty.
What is the “:autofill” Pseudo-Class?
This pseudo-class applies styles to input fields that the browser automatically fills with saved data.
What are Location Pseudo-Classes?
These pseudo-classes are used for styling links and elements that are targeted within the current document.
What is the “:any-link” Pseudo-Class?
This pseudo-class is a combination of the :link and :visited pseudo-classes. So, it matches any anchor element with an href attribute, regardless of whether it’s visited or not.
What is the “:link” Pseudo-Class?
This pseudo-class allows you to target all unvisited links on a webpage. You can use it to style links differently before the user clicks on them.
What is the “:local-link” Pseudo-Class?
This pseudo-class targets links that point to the same document. It can be useful when you want to differentiate internal links from external ones.
What is the “:visited” Pseudo-Class?
This pseudo-class targets a link the user has visited.
What is the “:target” Pseudo-Class?
This pseudo-class is used to apply styles to an element that is the target of a URL fragment.
What is the “:target-within” Pseudo-Class?
This pseudo-class applies styles to an element when it or one of its descendants is the target of a URL fragment.
What are Tree-Structural Pseudo-Classes?
These pseudo-classes allow you to target and style elements based on their position within the document tree.