简体   繁体   中英

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>

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"/>

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:

https://codepen.io/718studio/project/editor/ABPvrZ/

Make sure that you type the href correctly :

href="yourfolder/yourcssstylename.css"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM