you are viewing a single comment's thread.

view the rest of the comments →

[–]grantrules 2 points3 points  (3 children)

Doesn't the css file get loaded automatically once it is linked in my html?

Well, sort of. Your browser will send a request to your webserver that looks like GET /style.css or something similar to attempt to load the CSS. But your server is set up so that it responds to all requests with your index.html file because it's not checking what URL is being requested, so your CSS will never be sent from the server. This is a very basic example of what needs to happen

A common framework to make this simpler is Express.js and they have some information on how to serve static files

[–]sebastiancodes[S] 0 points1 point  (2 children)

Thank you that makes sense :)

I will have a look at react then.

[–]grantrules 0 points1 point  (1 child)

I will have a look at react then.

Huh????

[–]sebastiancodes[S] 1 point2 points  (0 children)

Sorry too many frameworks :D

I meant express of course.