Stylesheet not loaded because of MIME-type

前端 未结 30 3138
猫巷女王i
猫巷女王i 2020-11-22 07:29

I\'m working on a website that uses gulp to compile and browser sync to keep the browser synchronised with my changes.

The gulp task compiles everything

30条回答
  •  忘掉有多难
    2020-11-22 08:01

    For Node.js applications, check your configuration:

    app.use(express.static(__dirname + '/public'));
    

    Notice that /public does not have a forward slash at the end, so you will need to include it in your href option of your HTML:

    href="/css/style.css">
    

    If you did include a forward slash (/public/) then you can just do href="css/style.css".

提交回复
热议问题