谁能告诉我如何使用IE9:
我正在尝试让"center“div出现在中心..它在ff和chrome上工作得很好,但我花了1个小时尝试让它在IE9上工作。它一直向左转!
使其工作的唯一方法是将文本对齐设置为在父容器上居中。有没有人知道其他方法?更“得体”?
谢谢!
<html>
<head>
<style type="text/css">
#center {
width: 200px;
border: 1px;
margin: 0 auto;
}
</style>
</head>
<body>
<div id="center">
Hello World!
</div>
</body>
</html>
</code>发布于 2011-07-05 03:11:27
IE臭名昭著,因为没有适当的doctypes就无法工作。
尝试添加HTML5 one
<!DOCTYPE html>
发布于 2011-07-05 03:11:55
查看小提琴:http://jsfiddle.net/xavi3r/bGyPN/
尝试删除</code>它指的是什么?
<div id="center">
Hello World
</div>
#center
{
width:200px;
margin:0 auto;
border:1px solid #CCC;
}https://stackoverflow.com/questions/6575225
复制相似问题