# class attribute

*noun*

say it: **“KLASS AT-ri-byoot”** **/klæs ˈætrɪbjuːt/**

An attribute that puts an element into one or more named groups, so the same style or behavior can apply to every element in the group.

## What is **`class` attribute**?

**`class` attribute** — An attribute containing one or more reusable class names for an element.

```html
<p class="daily-special">Tomato soup</p>
```

## In a sentence

- “Every sold-out drink on the menu has the **class** sold-out, so one CSS rule grays them all out.”

Level: Novice · [More CSS terms at this level](https://www.ask-codey.com/glossary?category=css&level=1)

Updated: November 9, 2026

## In other subjects

- [Class Attribute in Python](https://www.ask-codey.com/glossary/class-attribute)

Source: https://www.ask-codey.com/glossary/class-attribute-html
