Home >Web Front-end >JS Tutorial >How to introduce css in angular
How to introduce css in angular: 1. Set the "@Component({styleUrls:['css file path']})" statement in the ts file; 2. Set "@Component({ styles:[`css style code`]})" statement.
The operating environment of this tutorial: windows7 system, angular6 version, Dell G3 computer.
angular Two ways to introduce css
Write in ts file @Component({....}) Enter
Method 1:
styleUrls:['css文件路径']
Method 2:
styles:[` //直接写css样式 格式和在css文件里面一样 例如 a{ color:red; } `] //注意 是反引号`` tab键上面那个
[Related tutorial recommendations: "angular tutorial》】
The above is the detailed content of How to introduce css in angular. For more information, please follow other related articles on the PHP Chinese website!