General Discussion One Solution

Joseph Lander
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Joseph Lander
Front End Web Development Techdegree Graduate 24,868 Points

Connect the CSS file - not currently referenced

I wanted to add the 3 items we add on the home page as list items using <li> tags. I didn't want the bullet styling so added a declaration in the CSS to remove that but it didn't apply. It appears that there are stylesheets in the public folder that aren't connected to the index.html file.

I added a link in the head of layout.pug link(rel="stylesheet", href="stylesheets/style.css") this doesn't work for me. In the console it returns GET /stylesheets/style.css 404 as it is not finding it.

I can't see how to connect it as none of the following file paths are working for me: ../stylesheets/style.css, ./stylesheets/style.css, stylesheets/style.css or ./public/stylesheets/style.css.

I have a vague knowledge that it should not need to be prefixed with public/ as the pathname was set up in app.js. However, does this only become active when the code is deployed rather than as we are in the development server?

1 Answer

Joseph Lander
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Joseph Lander
Front End Web Development Techdegree Graduate 24,868 Points

If you go on to the next Express practice challenge, the first task is to link static files to your project! You need to use middleware to link static files in Express - That was the issue.

Don't forget to reset your npm script so that the changes take effect. It will be referenced but here is a link if you want to add it to this project: https://expressjs.com/en/starter/static-files.html#serving-static-files-in-express