Press "Enter" to skip to content

How To Use Css In Angular 8 component level

app.component.ts:-

import { Component } from ‘@angular/core’;

@Component({
selector: ‘app-root’,
templateUrl: ‘./app.component.html’,
styleUrls: [‘./app.component.scss’]
})
export class AppComponent {
title = ‘Hello Welcome to whatsmysuggestion’;
}

app.component.scss:-

Note:- Which ever css code needed for angular component , please add into respective css (or) scss file of component as shown below.

h1
{
color:red;
font-size:20px;

}

app.component.html:-

<h1>{{ title }}</h1>

Be First to Comment

    Leave a Reply

    Your email address will not be published. Required fields are marked *