以下HTML看起来需要Firefox 2 & 3和IE7。 Left
按钮位于左侧,Right
按钮位于右侧,中间的文本位于中间位置!IE6布局问题 - 绝对定位
但是,在IE6上,Left
按钮未对齐 - 它看起来居中对齐。
任何人都可以提出为什么?
<!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>
<title>Layout problem!</title>
<style type="text/css">
DIV#Footer
{
padding: 10px;
color: #fff;
background-color: #484848;
position: relative;
text-align: center;
}
DIV#Footer INPUT
{
margin: 5px 15px;
position: absolute;
top: 0px;
}
DIV#Footer INPUT.right
{
right: 0px;
}
DIV#Footer INPUT.left
{
left: 0px;
}
</style>
</head>
<body>
<div id="Footer">
<input class="left" type="button" value="Left" />
Some text in the middle
<input class="right" type="button" value="Right" />
</div>
</body>
</html>
(我一直在使用IE Developer工具,试图分析和解决这个问题,但没有成功...)
这相当反向!谢谢乔纳斯。 这几乎完美的作品 - 它似乎推动我的含有div的宽度在IE6中的几个像素。 – 2009-02-11 17:36:05
设置缩放将改变光标。可能只想通过在规则前面加上_来限制IE6的使用。 – 2009-02-11 17:49:56