简体   繁体   English

Java JSP Servlet,为什么我的CSS无法正常工作。

[英]Java JSP Servlet , Why my css dont work.Thanks

I have a project written by jsp and servlet but It have a bug, my bootstap and some css file dont access EROR 404 and i also try change my link to access to css file but It dont work to me. 我有一个用jsp和servlet编写的项目,但是它有一个错误,我的引导程序和一些CSS文件无法访问EROR 404,我也尝试更改我的链接以访问CSS文件,但对我来说不起作用。 This is my pic, THank you. 这是我的照片,谢谢。 这是我的代码

在Chrome中显示

Try to use proprely relative paths, in the case of your css, the path should be ./css/bootstrap.css , ./css/shop.css etcc same thing for your js 尝试使用适当的相对路径,就您的CSS而言,该路径应为./css/bootstrap.css,./css/shop.css etcc与您的js相同

Notice that your page is looking for the css at the root directory, while it is actually under /DuAn 请注意,您的页面实际上是在/ DuAn下的根目录中查找css。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM