今天用css布局了一张jsp页面,就是在页面上放了几张图片,在ie8下显示正常,而在firefox中却是一片空白,不知其原因,搞得心都碎了
我的项目目录如下:
WebRoot
  --css
     --login.css
  --img
     --login.jps
     --loginHead.jpg
  --META-INF
      ......
  --WEB-INF
      ......
  --login.jsplogin.jsp代码如下:<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'login.jsp' starting page</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" type="text/css" href="css/login.css">  </head>
  
  <body>  <div id="container">
    <div id="head"></div>
    <div id="mid">
    <div id="title"></div>
    </div>
    <div id="bottom"></div>
  </div>
  </body>
</html>上面表了颜色的部分是我写的,其他的是MyEclipse自动生成login.css代码如下:
#container{
width:960px;
height:700px;
}
#head{
background:url(../img/loginHead.jpg) middle center no-repeat;
background-repeat:no-repeat;
width:950px;
height:46px;
}
#mid{
width:950px;
height:450px;
background:url(../img/login.jpg) middle center no-repeat;
}以上页面在ie中完全能正常显示,但在firefox中为一片空白,如果把图片等直接写在标签里面如<div style=".....">也可以显示,页面的普通文字也可以显示向各位经验丰富的高手求助