Angular 10: Styles.css not loading into Index.html

1.6k views Asked by At

I've added one html element inside my index.html file and now I want to add some styling on it. I have written the style code inside styles.css file but it is not reflecting on index.html element.

Here is the code:

Index.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Angular App</title>
    <base href="/" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link
      rel="icon"
      type="image/x-icon"
      href="https://icons.com/emoj-symbol-30763.png"
    />
  </head>
  <body>
    <app-root>
      <h2 class="loading-head">Loading .........</h2>
    </app-root>
  </body>
</html>

Styles.css

.loading-head { color: red; }

angular.json

  "styles": [
     "src/theme.less",
     "src/styles.css"
  ],

File Structure

/src/
  --index.html
  --styles.css
/
  --angular.json

Angular Version

Angular CLI: 10.1.1
Node: 14.10.1

I'm not able to figure out what & where I'm doing wrong. Can anyone help me please?

0

There are 0 answers