Mime type error when adding a CSS file to Angular

Solution 1 (with Bootstrap installed)

All you need to do is:

  1. Go to .angular-cli.json under the root directory of your angular app.

  2. Modify the styles array to include bootstrap before styles.css

    "styles": [
        "../node_modules/bootstrap/dist/css/bootstrap.min.css",
        "styles.css"
      ],

Note: the path to bootstrap is relative to /src/index.html that’s why you need "../" before node_modules.

  1. Exit the current session of ng serve and start it again.

Here is an Awesome tutorial

Solution 2 (with Bootstrap referenced)

All you need to do is:

  1. Go to styles.css under the root directory of your angular app.

  2. Add this line at the top:

@import url('https://unpkg.com/bootstrap@3.3.7/dist/css/bootstrap.min.css');

Here is Angular docs

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)