gpt4 book ai didi

html - 无法从 Internet 链接样式表

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

我在 static.friedpanseller.com/magic.css 有一个样式表

我用过

<link rel="stylesheet" href="static.friedpanseller.com/magic.css" type="text/css">

链接样式表。但是,该页面没有选择样式表,并且某些 div 无法正常工作。像这个虽然我放了id和class,但只显示“construction”两个字,没有样式。

<div id="construction" class="construction0"><font style="margin-left: 20px;">construction</font></div>

我一定是做错了什么,但我不知道是什么,如果有人能帮助我,那就太好了。

谢谢!

最佳答案

您需要一个完整的网址,可能是 protocol relative url :

<link rel="stylesheet" href="//static.friedpanseller.com/magic.css" type="text/css">

或者,使用完整协议(protocol):

<link rel="stylesheet" href="http://static.friedpanseller.com/magic.css" type="text/css">

您可以使用 <a href="static.friedpanseller.com/magic.css">link</a> 测试 url关联。单击此链接会转到 http://yoursite.com/static.friedpanseller.com/magic.css - example

有关相对 URL 的更多信息,请参阅 RFC 3986 .特别是 examples at 5.4 :

Within a representation with a well defined base URI of
http://a/b/c/d;p?q
a relative reference is transformed to its target URI as follows.

[...]

  • "g" = "http://a/b/c/g"
  • [...]
  • "//g" = "http://g"

关于html - 无法从 Internet 链接样式表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20394111/

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