Skip to content

CSS Selectors

Attribute presence


The [attribute] selector matches elements that have the specified attribute, regardless of its value.

Link with href

The hyperlink is matched because it has an href attribute.

Link with empty href

The selector only checks for the presence of the attribute, not its value. So the hyperlink is matched even though the href attribute is empty.

Link without href

The hyperlink is not matched because it does not have an href attribute.