#divbg
{
width: 98%;
margin-left: auto;
margin-right: auto;
}
#divbg li
{
float: left;
background: rgb(231,231,231);
width: 180px;
height: 180px;
font-size: 20px;
list-style-type: none;
cursor: hand;
line-height: 40px;
text-align: center;
cursor: pointer;
margin-bottom: 2%;
margin-top: 4%;
margin-left: 5.5%;
margin-right: 5.5%;
}
#box
{
margin:0 0 0 0;
position: absolute;
}
代码如上,我要的功能 八个小块居中显示 初始每行4个 窗口缩小变大 当中的小块也要居中 小块大小固定180*180 css调试了很久 愣是没调出来。。。。
回复讨论(解决方案)
木有人啊?????
#divbg { width: 98%; margin-left: auto; margin-right: auto; } #divbg li { float: left; background: rgb(231,231,231); width: 180px; height: 180px; font-size: 20px; list-style-type: none; cursor: hand; line-height: 40px; text-align: center; cursor: pointer; margin-bottom: 2%; margin-top: 4%; margin-left: 5.5%; margin-right: 5.5%; } #box { margin:0 0 0 0; position: absolute; }你不觉得这样好看些吗
赞版主 楼上正解
查看更多关于div块状居中显示_html/css_WEB-ITnose的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did105478