firefox和IE兼容问题 在jsp页面中用到了一个<div id="choiceDiv" class="hiddenDiv" style="width:62%"> 这样的div,为什么style="width:62%" 在IE下正常,一到firefox下就变形了呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <div id="choiceDiv" class="hiddenDiv" style="width:62%;"> 如果还是不行 width不要百分比 用width:500px; 1 注意加上你的jsp所使用的html类型,也就是加上DOCTYPE 2 你的css属性后面要加上分号; 3 class="hiddenDiv" style="width:62%" 既然用class,为什么不将width也一起写进css样式里去?尝试运行下面的代码,也许就是你想要的结果 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>代码编写:dyw31415926</title> <style type="text/css"> .hiddenDiv{ background-color:#ff0000; text-align:center; } </style></head><body> <div id="choiceDiv" class="hiddenDiv" style="width:62%;">你得有些内容</div></body></html> 总发不成功。再发 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>代码编写:dyw31415926</title> <style type="text/css"> .hiddenDiv{ background-color:#ff0000; text-align:center; } </style></head><body> <div id="choiceDiv" class="hiddenDiv" style="width:62%;">你得有些内容</div></body></html> 好像ie的页面不算边框和右边、下边的滚动条,而firefox是算进去的。 [DIV]如何定位DIV的位置 服务器端获取手机端传过来的json 求高手指点 80分全部送上:正则达人请进 请教一个sql的排序 jsp 如何定义数组 求助! 不好意思麻烦大家一个javascript的小问题了~~~~~ jsp bean不能访问的问题 Strut 中取不到 session 的问题(100分) 请教数据库连接问题!!!!急 怎么调用本地的一个程序?而没有安全限制? 哪位大虾知道FCK?小弟求教
2 你的css属性后面要加上分号;
3 class="hiddenDiv" style="width:62%" 既然用class,为什么不将width也一起写进css样式里去?
尝试运行下面的代码,也许就是你想要的结果 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>代码编写:dyw31415926</title>
<style type="text/css">
.hiddenDiv{
background-color:#ff0000;
text-align:center;
}
</style>
</head>
<body>
<div id="choiceDiv" class="hiddenDiv" style="width:62%;">你得有些内容</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>代码编写:dyw31415926</title>
<style type="text/css">
.hiddenDiv{
background-color:#ff0000;
text-align:center;
}
</style>
</head>
<body>
<div id="choiceDiv" class="hiddenDiv" style="width:62%;">你得有些内容</div>
</body>
</html>