打印

[求助] FF DIV内的内容如何设置居中?

样式如下

#top .menu {
       width:730px;
       height:35px;
       float: left;
       position: relative;
       top: 335px;
       background:#DB0709;
       text-align: center;
       padding-top:15px;
}

<div id="top">
<div class="menu">{菜单}</div>
<div class="login">{用户登录信息}</div>
</div>

如上的样式仅对IE有效,如果需要在FF下也让CLASS为 menu 的层内文字居中的话应该怎么写,知道的朋友告诉一下,谢谢
复制内容到剪贴板
代码:
<!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>test</title>
</head>
<style type="text/css">
*{ margin:0px; padding:0px;}
div{ width:300px; height:300px; background-color:green; border:6px solid #ccc; text-align:center; position:relative; display:table-cell; vertical-align:middle;}
p{ *position:absolute;top:50%;left:50%;}
img{ *position:relative;top:-50%;left:-50%;}
</style>
<body>
<div><p><img src="http://www.baidu.com/img/slogo-renwu-0806.gif" /></p></div>
   
</body>
</html>
坛子里很多的,自己搜索下
bbon.cn sunbbon.cn