# Class and Style Binding

*noun*

say it: **“KLAS and STYLE BYND-ing”** **/klæs ænd staɪl ˈbaɪndɪŋ/**

Binding syntax that adds CSS classes or styles to an element based on component values.

## What is **Class and Style Binding**?

**Class and style binding** adds CSS classes or styles based on component values.

```html
<li [class.done]="task.completed">{{ task.title }}</li>
<div [style.width.%]="progress"></div>
```

## In a sentence

- “With **class binding**, \[class.sale\]="onSale" turns the price red during a sale.”

Level: Apprentice · [More Angular terms at this level](https://www.ask-codey.com/glossary?category=angular&level=2)

Updated: November 9, 2026

Source: https://www.ask-codey.com/glossary/class-and-style-binding
