The ::first-line pseudo-element is for applying styles to the first line of an element. Imagine a paragraph that is several lines long.
::first-line allows you to style that first line of text. You could use it to make it larger or set it in small-caps as a stylistic choice. The amount of text targeted by this pseudo-element depends on the several factors like line length, viewport width, font-size, letter-spacing, word-spacing. As soon as the line breaks, the text after that is no longer selected. Note that there is no actual DOM element being selected here.
This pseudo-element only works on block-level elements (when display is set to either block, inline-block, table-caption, table-cell). If set on an inline element, nothing happens, even if that inline element has a line break within it.
The :enabled pseudo-class in CSS selects focusable elements that are not disabled, and therefore enabled. It is only associated with form elements (input, select, textarea). Enabled elements include ones in that you can select, that you can enter data into, or that you can focus on or click.
In theory, :enabled should match an a, area, or link with href attributes, but browsers don’t seem to handle that scenario. You can style button, input, textarea, optgroup, option and fieldsets that are not disabled. When menu is supported, we should also be able to target command and li‘s that are children of menu, if not disabled.
You would also think that elements with contenteditable and tabindex attributes would be selectable with the :enabled pseudo-class.
A descendant selector in CSS is any selector with white space between two selectors without a combinator.
Descendant means anywhere nested within it in the DOM tree. Could be a direct child, could be five levels deep, it is still a descendant. This is different than a child combinator which requires the element to be the next nested level down.
The descendant selector is the most expensive selector in CSS. It is dreadfully expensive—especially if the selector is in the Tag or Universal Category.
The :disabled pseudo-class selector provides conditional styling to HTML elements that can receive user input, when the elements have the disabled attribute.
It is defined in the CSS Selectors Level 3 spec as a “UI element state pseudo-class”, meaning it is used to style content based on the user’s interaction with an input element.
Elements that can receive the disabled attribute include button, input, textarea, optgroup, option and fieldset.
There are two valid syntaxes for setting this attribute: either disabled=”disabled” or (in HTML5) simply the disabled Boolean keyword. An element is disabled if it can’t be activated (e.g. selected, clicked on or accept text input) or accept focus. Such an element can be styled using the :disabled pseudo-class selector.