I'm building a simple angular app with bootstrap. It seems that the base index.html won't load the styles.css. If I put the css code right into html tags it works like a charm. I tried to reboot the app and clear the browser cache, it seems to just ignore the style file. When I wrote the css file for the first time it worked, hence I thought that was a cache problem. I changed nothing of the Angular project base structure.
Here's my code.
index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ReagApp</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<div class="container">
<app-root></app-root>
</div>
</body>
</html>
styles.css
body {
background-color: #d9d9d9;
}
.container{
width: 70%;
max-width: 100%;
background-color: white;
margin-left: auto;
margin-right: auto;
}
Here's the version that works instead.
index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ReagApp</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body style=" background-color: #d9d9d9;">
<div class="container"
style="width: 70%;
max-width: 100%;
background-color: white;
margin-left: auto;
margin-right: auto;">
<app-root></app-root>
</div>
</body>
</html>
.angular-cli.json
[other things]
"prefix": "app",
"styles": [
"styles.css",
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"../node_modules/font-awesome/css/font-awesome.css"
],
"scripts": [
"../node_modules/jquery/dist/jquery.min.js",
"../node_modules/tether/dist/js/tether.min.js",
"../node_modules/bootstrap/dist/js/bootstrap.min.js"
],
"environmentSource": "environments/environment.ts",
[other things]
The code is pretty trivial but still.
Thanks in advance.