<div class="foot">
<div id="footone">
<div id="table">
<ul>
<li id="img1"><img alt="" src="images/banner/10.jpg"/></li>
<li id="img1"><img alt="" src="images/banner/11.jpg"/></li>
<li id="img1"><img alt="" src="images/banner/12.jpg"/></li>
<li id="img1"><img alt="" src="images/banner/13.jpg"/></li>
</ul>
</div>
<div id="menu">
<ul>
<li>沙盘</li>
<li>F3栋</li>
<li>花园</li>
<li>物业</li>
</ul>
</div>
</div>
</div>
id=table 要具中怎么居中不了
.foot{ width:1920px; height:200px;}
#footone{ width:1920px; height:120px; text-align:center;}
#foottwo{ width:1920px; height:80px;}
#foottwo input{ width:70px; height:50px; line-height:50px; float:right; margin-right:80px; font-size:18px; color:#CCC; background-color:transparent;}
/*图片导航*/
#table{ width:auto; height:120px; text-align:center; visibility:hidden; overflow:hidden; margin:0 auto; display:inline;}
#table ul li{ width:110px; height:110px; overflow:hidden; text-align:center; list-style-type:none;
float:left; margin-left:10px; cursor:pointer;}
样式代码贴出来撒
怎么,帮忙解决一下,谢谢
@菜鸟需帮助:
改成这样试试
#table
{
width: 60px;
height: 120px;
text-align: center;
margin: 0px auto;
border: 1px solid #808080;
}
@骑着蜗牛耍流氓: 还是居中不了
@菜鸟需帮助: 我不知道你要做什么效果,感觉你的样式表乱七八糟的,你试试把你的DIV都加上边框再运行看看效果
@菜鸟需帮助:
给你敲了个列子,ID为table的DIV居中:
<div id="footone">
<div id="table">
</div>
</div>
#footone { width:auto; height:700px; border:1px solid #808080; } #table { width: 100px; height: 100px; margin: 0px auto; border:1px solid #ff0000; }
@骑着蜗牛耍流氓: 水平居中,在footone外面还有个foot div
@菜鸟需帮助:
.foot { width: auto; height: 1000px; } #footone { width: auto; height: 800px; text-align: center; border: 1px solid #ff0000; } /*图片导航*/ #table { width: 150px; height: 120px; text-align: center; margin: 0px auto; border:1px solid #ff0000; }
<div class="foot"> <div id="footone"> <div id="table"> <ul> <li id="img1"> <img alt="" src="images/banner/10.jpg" /></li> <li id="img1"> <img alt="" src="images/banner/11.jpg" /></li> <li id="img1"> <img alt="" src="images/banner/12.jpg" /></li> <li id="img1"> <img alt="" src="images/banner/13.jpg" /></li> </ul> </div> <div id="menu"> <ul> <li>沙盘</li> <li>F3栋</li> <li>花园</li> <li>物业</li> </ul> </div> </div> </div>
可以居中
@骑着蜗牛耍流氓: 非常感谢,居中了
@菜鸟需帮助: OK
@骑着蜗牛耍流氓: li的float停靠又会使样式改变,怎么办呢
@菜鸟需帮助:
截图看看
@骑着蜗牛耍流氓: 知道了,div宽度不够。谢谢
@菜鸟需帮助: 噢