CSS Won't Import

I put

   <meta charset = "utf-8">
   <title>OJVJPJ Game: Text</title>
   <link rel = "stylesheet" href = "style.css">

but CSS remains the same. style.css is

span {
  background-color: red;

and I have a span in index.html, but nothing is red. Link is here Glitch :・゚✧.

Hi there - as you figured in the style.css comment, it is because it’s a Node app that the style.css file is not loading. When using Node you need to specify where any static files you want to load exist in the project. For a live example, see line 12 of my server.js file in this express project Glitch :・゚✧

app.use(express.static("public")); declares that the /public folder contains static files that express should recognize as available and load. Add this to your index.js, rename style.css to “public/style.css” and you should be good to go.

1 Like