本地CSS文件未从HTML加载 [英] Local CSS file is not loading from HTML
问题描述
经过几个小时的论坛搜索和尝试后,我得到了代码:
after a few hours of searching through the forums and trying things, I've got the code:
<html>
<head>
<title>Tester123</title>
<link href="style1.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1> What the what? </h1>
<p>This is a paragraph. Hooray!</p>
<div class="trial">What text is this?</div>
<p>Oh hello. The CSS thing is frustrating hey?</p>
</body>
</html>
而且我正在尝试将CSS加载到Chrome(从Mac)中.我已经将css(style1.css)和该文件保存在同一文件夹中(都只是从计算机中加载),我已经清除了缓存,但没有在Chrome Inspector(源代码)中加载任何有关CSS,我对任何想法都stuck之以鼻.我打开了源文件,它似乎可以很好地链接到那里.我检查了四个文件名和类型,但没有任何内容.有想法吗?
And I'm trying to get the CSS to load in Chrome (from a mac). I've got the css (style1.css) and this file in the same folder (all just loading from my computer), I've cleared the cache, I don't see anything loading in the Chrome Inspector (Sources) about the CSS and I'm stuck for any ideas. I opened up the source and it seems to link through great there. I have quadruple checked file names and types, but I have nothing. Thoughts?
推荐答案
link
标签中的 type
属性具有印刷引号字符: type ="text/css"
.尝试将其更改为普通"引号,例如 type ="text/css"
The type
attribute in your link
tag has typographical quote characters: type="text/css"
. Try to change these to "plain" quotes like type="text/css"
这篇关于本地CSS文件未从HTML加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!