<?xml version="1.0" encoding="utf-8"?>

CSS attribute selector

CSS attribute selector Bad Practice
CSS attribute selector Best Practice

Attribute selectors aren't common, but they have some powerful use cases. They allow you to target elements that have a particular attribute or attribute value.

Attribute selectors are enclosed in square brackets ([...]). For example, to style all elements with a title attribute, we'd use the selector [title]. We can also target elements with specific titles. In that case, the code would look like [title="Important"].

Improve your UX & Product skills with interactive courses that actually work