gpt4 book ai didi

html - CSS在中申请首页失败

转载 作者:行者123 更新时间:2023-11-28 01:20:30 25 4
gpt4 key购买 nike

Hello, I have a home page LoginPage.html in /WebContent/html/LoginPage.html

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=windows-1256">
<title>Login Page</title>
<link rel="stylesheet" type="text/css" href="../css/jsStyle.css" />
</head>
<body>...</body>
</html>

我已经在 web.xml 中配置了相同的内容

</welcome-file-list>
<welcome-file>/html/LoginPage.html</welcome-file>
</welcome-file-list>

Problem: When I am trying to access the file from the home page URL
http://localhost:8080/Project/
It fails to apply the CSS.
Whereas when I access through the location specific URL
http://localhost:8080/Project/html/LoginPage.html
CSS is applied.

因此,CSS 在加载欢迎页面时无法应用;我尝试了多种选择。请帮忙。

最佳答案

您的 css 文件位置必须相对于 html 文件。我认为目前您的 css 文件位于元素文件夹中。如果你想在使用 http://localhost:8080/Project/ 时访问 css你的 css 路径必须是 css/jsStyle.css。如果它不起作用,请更新您的文件夹树结构。

关于html - CSS在<welcome-file-list>中申请首页失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51531263/

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