I'm currently experimenting with some code and running into a problem.
Using Express, I noticed that only the CSS selector for the body
element is working. However, if I remove the body tag, then the next container works, but the ones after that do not.
In Chrome dev tools network tab, it shows that my CSS file has been successfully retrieved.
I even attempted changing
app.use(express.static(path.join(__dirname, '/public')))
to app.use(express.static('public')
, but that didn't resolve the issue. The JavaScript fetch function is functioning correctly though. Feeling quite frustrated!
I also have additional code for future use such as body-parser
and sqlite3
.
Here's a snippet of the HTML:
//index.html
<html lang="en">
//rest of the index.html code here
CSS code:
//styles.css
//CSS styles defined here
Javascript snippet:
//server.js
const express = require('express');
//rest of the server.js code here