简体   繁体   English

CSS和HTML不会链接

[英]CSS and HTML will not link

I have been using external stylesheets just fine until a couple days ago. 直到几天前,我一直在使用外部样式表。 I don't know why I am no longer able to link to external stylesheets from my HTML since I have had no problems with it earlier. 我不知道为什么我不再能够从HTML链接到外部样式表,因为我之前对此没有任何问题。 I absolutely cannot find the issue. 我绝对找不到问题。
It will probably be obvious, but right now I am really frustrated. 这可能很明显,但是现在我真的很沮丧。
Please Help! 请帮忙!

My File Structure: 我的档案结构:
-Tutorial (folder) - index.html - stylesheet.css

 h1 { color: green; } 
 <!doctype html> <html> <head> <title>Hello</title> <link rel="stylesheet" href="stylesheet.css"> </head> <body> <h1>Testing...</h1> </body> </html> 

Note: It may run fine here on the snippet... but it will not link correctly in my HTML. 注意: 此代码段在此处可能运行良好...但是无法正确链接到我的HTML中。

采用

 <link rel="stylesheet" href="./stylesheet.css"> 

Thanks you guys for the help! 谢谢你们的帮助! I found that I had this in my head: 我发现我脑子里有了这个:

<link rel="stylsheet" href="stylesheet.css">

I had spelled stylesheet wrong in the 'rel'. 我在“ rel”中拼写了样式表错误。
It works fine now! 现在工作正常!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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