'Linking CSS doesn't work
So my CSS doesn't work for some reason. I have searched online and cannot find a problem with it but the CSS is not connecting to the HTML. Here is my code:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="yee.css">.
</head>
<body>
<audio id="yee" src="C:\Users\Jake Coffey\Downloads\yee.wav" preload="auto"></audio>
<center><img src="https://vignette1.wikia.nocookie.net/smashbroslawlorigins/images/1/16/Yee.png/revision/latest/scale-to-width-down/280?cb=20140904202925" onclick="document.getElementById('yee').play();" /></center>
</body>
</html>
Solution 1:[1]
This maybe... never mind... But I got this problem.
Try add /
to your link tag end
<link rel="stylesheet" type="text/css" href="yee.css"/>
Solution 2:[2]
It's hard to answer because we can't see your file structure.
This href you are using href="css/yee.css"
is assuming that your files look like this.
/ project-folder
index.html
/ css
yee.css
The href tells your HTML file where to look for the CSS file. If your CSS file is in the same folder as your HTML file try changing the href to href="yee.css"
Hope that helps!
EDIT:
Solution 3:[3]
Make sure that you type the href correctly :
href="yourfolder/yourcssstylename.css"
Solution 4:[4]
Try to make the link the same level as index.html
directed to the css folder.
<link rel="stylesheet" href="yourfolder/css/styles.css">
or only ...href="css/styles.css">
and make sure delete /
before css file name.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | bearwithbeard |
Solution 2 | |
Solution 3 | ori |
Solution 4 | ahuemmer |