gpt4 book ai didi

html - 被忽略的 CSS 文件搞糊涂了

转载 作者:太空宇宙 更新时间:2023-11-04 13:48:26 25 4
gpt4 key购买 nike

一点简单得可笑的网络编码对我来说是行不通的,而且我终究无法弄清楚自己做错了什么。

这是我的 HTML 文件:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Experiment</title>
<link rel="stylesheet/css" type="text/css" href="/team/css/style.css">
</head>

<body>
<div id="user_box">
<p>Hi. Whassup?</p>
</div>
</body>
</html>

这是它链接到的 CSS 文件:

#user_box {
position: fixed;
left: 10px;
top: 10px;
padding: 5px;
z-index: 100;
height: 40em;
width: 16em;
background-color: white;
border: solid black;
}

这是行不通的。 CSS 格式被完全忽略。但是,当我将 #user_box 的内容复制到 style= 标记中时,它的工作方式完全符合我的预期。

我正在确认 CSS 文件在它应该在的位置并且浏览器可以看到它;当我查看源代码时,我可以单击该链接,它会正常下载。

我怀疑我遗漏了一些明显/愚蠢的东西,但我没有弄清楚它是什么。求求你,指出我的愚蠢并获得 Shiny 的复选标记。

最佳答案

样式表的正确 rel 只是 stylesheet,而不是 stylesheet/css。删除 /css 一切都应该没问题。

关于html - 被忽略的 CSS 文件搞糊涂了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11144378/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com