To style the host element of the component, use ng-style directive. CSS properties help in the styling of the component.
Approach: Styling of host components uses CSS properties, which can be altered, modified and updated whenever needed.
The CSS properties are listed as follows:
- color: Used to set font color.
- background-color: Used to set background color.
- font-size: Used to set size of font.
- padding: Used to set space around the text.
Example 1: This example uses ng-style directive. CSS properties of font color and background color are used here.
Example 2: This example shows the styling of components based on font-size, font-color and background color.
- AngularJS | ng-style Directive
- AngularJS | angular.element() Function
- How to show a span element for each rows clicked in AngularJS?
- How to check an element has certain CSS style using jQuery ?
- How to add `style=display:“block”` to an element using jQuery?
- Node | urlObject.host API
- HTTP headers | Host
- host command in Linux with examples
- HTML | DOM Location host Property
- HTML | DOM Anchor host Property
- HTTP header | X-Forwarded-Host
- Peripheral Component Interconnect (PCI)
- Principal Component Analysis with Python