Pseudo-elements Flashcards
What is the purpose of CSS pseudo-elements?
They allow adding or targeting an extra element without modifying the HTML.
What do ::before and ::after pseudo-elements do?
They create child elements inside an element, but only on elements that accept children.
What property must be defined for ::before and ::after to work?
The content property, which can be a string or an image url.
What does ::first-letter target?
It styles the first letter of a block-level text element.
What display values must an element have for ::first-line to work?
block, inline-block, list-item, table-caption, or table-cell.
What is ::backdrop used for?
It styles the area behind elements in full-screen mode, such as <dialog> and <video>.</video></dialog>
What can ::marker style?
List bullets, numbers, and <summary> element arrows.
What does ::selection do?
It customizes the appearance of selected text.
What does ::placeholder style?
The placeholder text of input fields.