Forum Moderators: open
Surely it would have to retrieve this from the server
The 'client-side' versus 'server-side' distinction is about which computer executes the code, rather than where the original version of the file is saved.
Yes, all client-side code on the web must come from a file that the user's web browser retrieves from a web server. But the code is run in the user's web browser, on the user's PC.
Hope I've understood the question correctly, and that that's made it clearer.
a.
My confusion is coming from the fact that I thought the server decided to download the css file to the browser and as Javascript isn't running on the server, what does it do?
I'm not certain I'm understanding your question right, but:
I thought the server decided to download the css file to the browser
No - the web browser requests a specific file from the server. Then the web server sends that file. So if the web browser requests styles800.css, the server will send styles800.css, and if the web browser requests styles1024.css, then the server sends styles1024.css.
The line:
<link rel="stylesheet" type="text/css" href="css/styles800.css">
Does that answer your question? Sorry if I'm being obtuse...
best,
a.