InterviewHubPRO
Section Overview
Q270

Question 270 of 283

Part 10: Reactive Forms, Standalone Components, Signals & NgRx (256 - 283)

95%
Angular & Signals (283 Qs)•Part 10: Reactive Forms, Standalone Components, Signals & NgRx (256 - 283)

What is host property in css?

The :host pseudo-class selector is used to target styles in the element that hosts the component. Since the host element is in a parent component's template, you can't reach the host element from inside the component by other means. For example, you can create a border for parent element as below,

js
//Other styles for app.component.css
//...
:host {
display: block;
border: 1px solid black;
padding: 20px;
}