【发布时间】:2023-03-04 11:52:01
【问题描述】:
我启动了一个 Angular 应用程序,它工作正常,但它没有将样式表 style.css 应用到与 index.html (src) 相同的食物中。知道为什么吗?
index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>AngularDemo</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" type="stylesheet" href="style.css">
</head>
<body>
<i></app-root>
</body>
</html>
style.css
/* You can add global styles to this file, and also import other style files */
body {
background-color: black;
color: white;
}
在我将样式添加到 index.html 文件的头部之前,背景保持白色,字母保持黑色。
【问题讨论】:
标签: html css angular hyperlink styles