gpt4 book ai didi

html - 链接外部样式表 (HTML)

转载 作者:太空宇宙 更新时间:2023-11-04 11:21:01 24 4
gpt4 key购买 nike

我正在建立我的第一个网站,我正在尝试附加一个外部 css 文件...

我的 index.htmltest.css 都在完全相同的文件夹/目录中,但由于某些原因我的 test.css文件未链接...

问题:有谁知道为什么我的 test.css 没有被链接?

//HTML (index.html)

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" media="screen" href="test.css">
<title>Page Title</title>
</head>
<body>
<h1>header of type 1</h1>
<p>standard paragraph</p>
<hr>
<p>HTML stands for Hyper Text Markup Language</p>
</body>
</html>

最佳答案

不用担心,您的 css 代码没有问题。您只需确保样式表链接的“href”部分包含您要包含的文件的名称,在您的情况下为:

href="CSS Test.css"

Windows 默认情况下会隐藏文件扩展名,因此请确保在您第二次添加扩展名后,您的文件实际上并没有被称为“CSS Test.css.css”。要显示所有文件扩展名,请执行以下操作:

Open Folder Options by clicking the Start button Picture of the Start button, clicking Control Panel, clicking Appearance and Personalization, and then clicking Folder Options.

Click the View tab, and then, under Advanced settings, clear the Hide extensions for known file types check box, and then click OK.

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

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