gpt4 book ai didi

html - 外部 CSS 样式表未链接

转载 作者:行者123 更新时间:2023-11-28 06:06:00 27 4
gpt4 key购买 nike

首先,我想补充一点,我之前看了很多帖子,没有一个符合我的具体情况。

问题:

  1. “Lounge.html”是下面显示的“索引”html 文件
  2. “test.css”是我试图链接到的外部 .css 文件,也在下面显示
  3. “Lounge.html”和“test.css”都在同一个文件夹中;根文件夹
  4. 所有“img”和“a”元素处于工作状态
  5. 当我在 Microsoft Edge 或 Internet Explorer 中运行“Lounge.html”时,该样式未应用于我的页面。

如果能帮助我使这个外部链接正常工作,我将不胜感激。

问候,

AA

h1, h2 {
font-family: sans-serif;
color: gray;
}
h1 {
border-bottom: 1px solid black;
}
p {
font-family: sans-serif;
color: maroon;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Head First Lounge</title>

<link type="text/css" rel="stylesheet" href="test.css" />

</head>
<body>
<h1>Welcome to the New and Improved Head First Lounge</h1>
<p><img src="images/drinks.gif" alt="Drinks" /></p>
<p>
Join us any evening for refreshing
<a href="beverages/elixir.html">elixirs</a>,
conversation and maybe a game or two of
<em>Dance Dance Revolution</em>.
Wireless access is always provided;
BYOWS (Bring Your Own Web Server).
</p>
<h2>Directions</h2>
<p>
You'll find us right in the center
of downtown Webville. If you need help finding
us, check out our
<a href="about/directions.html">detailed directions</a>.
Come join us!
</p>
</body>
</html>

最佳答案

这可能是浏览器缓存的问题。 清除缓存并再次检查。清除缓存的简单方法是在添加后添加一些随机字符串?到网址。示例

http://example.com/test.html?somerandomtext

关于html - 外部 CSS 样式表未链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36453831/

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