CSS-Pseudo
CSS-Pseudo:
In CSS, pseudo-classes and pseudo-elements are used to select and style elements based on various states and positions that can't be targeted with simple selectors alone. They are denoted by a colon : and can be applied to existing selectors. Here's an overview of some common pseudo-classes and pseudo-elements:
Pseudo-classes:
:hover: Selects an element when the mouse pointer is over it.
:active: Selects an element when it's being activated, typically when clicked on.
:focus: Selects an element when it gains focus, often used for form elements.
:not(): Allows you to select elements that do not match a specific selector.
:first-child: Selects the first child of a parent element.
:last-child: Selects the last child of a parent element.
:nth-child(): Selects elements based on their position within a parent element.
Pseudo-elements:
::before and ::after: Create virtual elements before or after the content of an element.
::first-line: Selects the first line of text within an element.
::first-letter: Selects the first letter of text within an element.
::selection: Allows you to style the portion of text that is selected by the user.
::placeholder: Styles the placeholder text in input and textarea elements.