首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

jsp和html在IE下,该怎么处理

2012-02-24 
jsp和html在IE下!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//ENhtmlheadtitle登

jsp和html在IE下
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   
  <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">

<style type="text/css">
*{
margin:0;
padding:0;
}
body{
background:url(pic/09.jpg) 0 0 repeat-x;
}
#content{
width:891px;
margin:auto;
}
#head{
background:url(pic/01.png) 0 0 no-repeat;
height:100px;
margin-top:58px;
width:330px;
align:left;
}
#body_left{
background:url(pic/02.jpg) 0 0 no-repeat;
width:427px;
height:272px;
float:left;
margin-top:17px;
}
#body_right{
background:url(pic/03.jpg) 0 0 no-repeat;
width:22px;
height:272px;
line-height:310px;
float:right;
margin-top:17px;
}
#body_middle{
background:url(pic/04.jpg) 0 0 no-repeat;
height:310px;
margin-left:427px;
width:442px;
}
#log{
background:url(pic/05.jpg) 0 0 no-repeat;
margin-top:18px;
height:47px;
margin-left:75px;
}
#uname{
background:url(pic/06.jpg) 0 0 no-repeat;
margin-top:18px;
margin-left:90px;
height:23px;
}
font{
color:#00C;
font-size:12px;
margin-left:25px;
}
.t{
background:url(pic/10.jpg) 0 0 no-repeat;
border:none;
height:20px;
line-height:20px;
text-indent:0.2em;
width:137px;
}
#pwd{
background:url(pic/07.jpg) 0 0 no-repeat;
height:47px;
margin-left:90px;
margin-top:18px;
}
#select{
margin-left:90px;
margin-bottom:18px;
}
#bu{
margin-left:100px;
}
.b{
background:url(pic/08.jpg) 0 0 no-repeat;
cursor:pointer;
border:none;
width:59px;;
height:20px;
line-height:20px;
text-align:center;
}
#copyright{
margin-top:30px;
text-align:center;
color:#00c;
font-size:12px;
font-family:Verdana, Geneva, sans-serif;
}
</style>
</head>

<body>
<div id="content">
<div id="head"></div>
<div id="body_left"></div>
<div id="body_right"></div>
<div id="body_middle">&nbsp;
  <div id="log"></div>
  <form action="Login" method=post>
  <div id="uname"><font>&nbsp用户名:<input type="text" name="username" class="t"></font></div>
  <div id="pwd"><font>&nbsp密&nbsp;&nbsp;码:<input type="text" name="password" class="t"></font></div>
  <div id="select"><font><input type="radio" value="student" name="user">&nbsp;&nbsp;管理员&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" value="teacher" name="user">&nbsp;&nbsp;老师&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" value="student" name="user" checked=checked>&nbsp;&nbsp;学生</font></div>
  <div id="bu"><input type="submit" value="提&nbsp;&nbsp;交" class="b">&nbsp;&nbsp;&nbsp;<input type="reset" value="重&nbsp;&nbsp;置" class="b">&nbsp;&nbsp;&nbsp;<input type="button" value="注&nbsp;&nbsp;册" class="b" onclick="window.location.href='registe.jsp'"></div>


  </form>
  </div>
  <div id="copyright">Copyright &copy; 2011 版权所有ZLT</div>
</div>
</body>
</html>
这段html代码在ie下显示正常 能居中 且同一行三列body-left body-middle body-right显示正常,
当改成jsp后在谷歌下依旧显示正常 IE9下却显示不是居中,同一行body-left浮动向左,body-right浮动向右,可是body-middle却跑到下一行了 请问怎么回事

[解决办法]
可能是网页兼容的问题吧,你可以参考一下 div+css 兼容ie6 ie7 ie8 ie9和FireFox Chrome等浏览器方法
http://hi.baidu.com/pcj2010/blog/item/4d58d74757d2749eb3b7dce8.html

不晓得对不对,你试试

热点排行