Suggest an editImprove this articleRefine the answer for “What does ngStyle do?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)The `[ngStyle]` directive in Angular is an **attribute directive** that lets you **dynamically change an element's CSS styles** through an object of keys and values. **Key point:** `ngStyle` lets you change individual CSS properties of an element depending on the component's state, without using classes.Shown above the full answer for quick recall.Answer (EN)ImageThe `[ngStyle]` directive in Angular is an **attribute directive** that lets you **dynamically change an element's CSS styles** through an object of keys and values. How it works: 1. `[ngStyle]` accepts an object where the key is the CSS property name and the value is its value. 2. Styles are applied dynamically and update when the data changes. Example: ```html <div [ngStyle]="{'color': textColor, 'font-size.px': fontSize}"> Dynamic style </div> ``` ```typescript textColor = 'red'; fontSize = 20; ``` > Conclusion: `ngStyle` lets you **change individual CSS properties of an element depending on the component's state**, without using classes.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.