用的Tomcat部署struts项目,在jsp中引用CSS。css文件在/css下。
<head>
<html:base/>
<title>登录</title> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" href="/css/global-style.css" type="text/css"> </head>
不知道为什么没有起作用?网上的代码也都是这样,有没有人遇到过这种问题?
<head>
<html:base/>
<title>登录</title> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" href="/css/global-style.css" type="text/css"> </head>
不知道为什么没有起作用?网上的代码也都是这样,有没有人遇到过这种问题?
解决方案 »
- 请问JAVA JDBC 连接SQL 2000、2005、2008的jar包通用吗?
- 高手帮忙看看。
- jstl 标签小问题??
- 我想在tomcat5.5配置两个项目,分别用两个端口访问,请问该怎么设置呢?
- 请教一个字符乱码的问题
- 如何用javascript或java 保存当前页面
- 在jsp页面中怎样实现转移页面到指定的绝对路径的URL
- 请回复过此贴的进来领分!加了一句代码之后问题多多,<%@ page errorPage=index1.jsp %>!!顺便测试一下是否能给500分了~
- 有关报表打印、iText的问题。。有强行换页的方法吗?
- 多终端访问服务器数据传输超时设计
- 如何禁止除了IE以外的浏览器打开页面?
- 关于struts-config.xml中的问题!
比如你的路径是:
http://localhost:8080/
那么这个/css文件目录是:http://localhost:8080/css
如果你的路径是:http://localhost:8080/xy/
那么你这个/css目录就还是:
http://localhost:8080/css而不是http://localhost:8080/xy/css
所以建议你使用相对路径。
<style type="text/css"><!--
<%@ include file="/css/global-style.css"%>
-->
</style>