【发布时间】:2021-12-06 00:13:38
【问题描述】:
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://kit.fontawesome.com/48d7c2e207.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="./css/newsfeed_header.css">
<link rel="stylesheet" href="./css/newsfeedprofile.css">
<title>News Feed Profile | My Family Gathering</title>
</head>
当我访问所有网页时,一切都很好。例如本地主机/网站/配置文件。所有的内容都加载了,一切都被设计了。但是当我转到 localhost/website/profile/12345 时,内容加载但没有样式。很奇怪,当我去 localhost/website/profile.php?id=12345 时,一切都正常加载。有人可以引导我走向正确的方向吗?
【问题讨论】:
-
你能给我看看你的html吗?请问?
-
听起来你的 CSS 是相对于当前 URL 加载的。查看
localhost/website/profile/12345的源码,查看CSS文件的URL -
@mulquin
网站名称 -
是的,您的 CSS 似乎是相对加载的,删除 /css 之前的点/句点,它应该可以工作
-
@mulquin 好的,所以你所说的解决了它。我从一开始就删除了 .. 并且它起作用了。感谢大家的帮助!