CSS [attribute|="value"] Selector

The [attribute|="value"] selector selects elements with the specified attribute, whose value can be exactly the specified value, or the specified value followed by a hyphen (-).

Welcome

This paragraph has class="top".

This paragraph has class="top-text".

This paragraph has class="topcontent".

This paragraph has class="content".

Note: The elements with class="top" and class="top-header" and class="top-text" get a yellow background. The value has to be a whole word, either alone or followed by a hyphen.