< link rel =" stylesheet" href =" ../ css / style.css">不管用 [英] <link rel="stylesheet" href="../css/style.css"> is not working

查看:149
本文介绍了< link rel =" stylesheet" href =" ../ css / style.css">不管用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有css文件下的css文件夹和jsp文件下的jsp文件夹,这两个文件夹都在WEB-INF文件夹内。所以我怎么能得到csp文件里面的jsp?

I have css files under css folder and jsp files under jsp folder and both folders are inside WEB-INF folder. So how can i get the css file inside jsp?

  <link rel="stylesheet" href="../css/style.css>

我给了这样的路径。

推荐答案

尝试使用:

<link rel="stylesheet" type="text/css" href="css/style.css" >

而不是

href="../css/style.css

这里你缺少正确的省略号。同时检查 BalusC answer 将解决您的问题。

Here you are missing right apostrophe. Also check BalusC answer would solve your problem.

您可以在 WEB-INF 相同级别的资源文件夹创建 css 文件夹中创建资源文件夹,然后将css文件引用为



Also i recommend to you create resources folder on the same level as WEB-INF then in resources folder create css folder and then reference css file as:

WEB-INF
resources
  --css
    --styles.css
  --js
    --scripts.js 

这里如何连接css和页面:

and here how to connect css with page:

<link rel="stylesheet" type="text/css" href="resources/css/styles.css" />

我使用这种方法是我的web项目,一切正常。

I'm using this approach is my web project and everything works correctly.

这篇关于&lt; link rel =&quot; stylesheet&quot; href =&quot; ../ css / style.css&quot;&gt;不管用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆