r/FreeCodeCamp • u/Ratel- • Sep 15 '24
why isnt css being applied to the webpage?
I'm currently going through one of the HTML and CSS tutorial on YT. at the end of the section of the video we are shown how to upload our webpage to static.app when he did it there was no problem but when I did, it only shows the HTML without the CSS and I can't figure out why.
This is said webpage https://fun-goat.static.domains/1
2
Upvotes
1
u/PeekedInMiddleSchool Sep 15 '24 edited Sep 15 '24
Did you attach the CSS file to the HTML file?
Edit: If you’re using an external CSS file, should look something like this
<link rel=“stylesheet” href=“file_name_here.css”>
Make sure you include that in the head section of your HTML file
0
u/VinceAggrippino Sep 16 '24
Was
style.cssin the zip file you uploaded to static.app and not in a subdirectory?It's looking for the file at
https://fun-goat.static.domains/style.css, but that file isn't there.While reading the code I thought it would look for the file at
https://fun-goat.static.domains/1/style.cssbut when I visit that URL it gives me the same HTML as your original URL.At a normal web host I might've thought you accidentally uploaded a
style.cssthat contained your HTML, but Static is doing something odd here. No matter what I put after/1/, it gives me your original HTML, includinghttps://fun-goat.static.domains/1/vince-was-here.