Skip to content

Commit c249573

Browse files
committed
Add host selector questionn
1 parent c8c68dd commit c249573

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Diff for: README.md

+13-3
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@
275275
|267| [Can you give an example of built-in validators?](#can-you-give-an-example-of-built-in-validators)|
276276
|268| [How do you optimize the performance of async validators?](#how-do-you-optimize-the-performance-of-async-validators)|
277277
|269| [How to set ngFor and ngIf on the same element?](#how-to-set-ngfor-and-ngif-on-the-same-element)|
278-
|270| [](#)|
278+
|270| [What is host property in css?](#what-is-host-property-in-css)|
279279
|271| [](#)|
280280
|272| [](#)|
281281
|273| [](#)|
@@ -4337,6 +4337,16 @@
43374337
43384338
**[⬆ Back to Top](#table-of-contents)**
43394339
4340-
270. ### ?
4341-
4340+
270. ### What is host property in css?
4341+
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.
4342+
For example, you can create a border for parent element as below,
4343+
```js
4344+
//Other styles for app.component.css
4345+
//...
4346+
:host {
4347+
display: block;
4348+
border: 1px solid black;
4349+
padding: 20px;
4350+
}
4351+
```
43424352
**[⬆ Back to Top](#table-of-contents)**

0 commit comments

Comments
 (0)