DIV CSS网页布局:实现让多个DIV排列时居中



\" style=\"margin:0px 2px -3px 0px\" alt=\"div css xhtml xml Source Code to Run\"> Source Code to Run [www.52css.com]

=\"ubbbuttonrt\">[ 可先修改部分代码 再运行查看效果 ]


\" style=\"margin:0px 2px -3px 0px\" alt=\"div css xhtml xml Example Source Code\"/> Example Source Code [www.52css.com]

<?xmlversion=\"1.0\"encoding=\"iso-8859-1\"?>
<!DOCTYPEhtmlPUBLIC\"-//W3C//DTDXHTML1.0Transitional//EN\"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
<htmlxmlns=\"http://www.w3.org/1999/xhtml\">
<head>
<title>UntitledDocument</title>
<metahttp-equiv=\"Content-Type\"content=\"text/html;char=iso-8859-1\"/>
<styletype=\"text/css\">
body{text-align:center}
#outer{
    width:60%;
    background:#ffffcc;
    margin:auto;
    text-align:center;
}
.inner{
    width:100px;
    height:100px;
    margin:5px;
    border:1pxsolid#000;
}
*html.inner{display:inline}/*forie*/
html>body#outer{display:table}/*formozilla*/
html>body.inner{display:table;float:left}/*formozilla*/
@mediaalland(min-width:0px){/*opera7styles*/
html>body.inner{display:inline-block;float:none;}
}

</style>
</head>
<body>
<!--forcequirksmodebyusingthexmlpro-logue-->
<divid=\"outer\">
<div=\"inner\">test</div>
<div=\"inner\">2</div>
<div=\"inner\">3</div>
<div=\"inner\">4</div>
<div=\"inner\">5</div>
<div=\"inner\">6</div>
<div=\"inner\">7</div>
<div=\"inner\">8</div>
<div=\"inner\">9</div>
<div=\"inner\">10</div>
<div=\"inner\">11</div>
<div=\"inner\">12</div>
<div=\"inner\">13</div>
<brstyle=\"clear:both\"/>
</div>
</body>
</html>
<scriptlanguage=\"Javascript\">
varnow=Date;


document.write(\"<imgsrc=\'http://counter.yesky.com/counter.shtml?CID=54197&AID=-1&refer=\"+escape(document.referrer)+\"&rand=\"+now.getTime+\"&cur=\"+escape(document.URL)+\"\'border=\'0\'alt=\'\'width=\'0\'height=\'0\'>\");
</script>
<noscript>
<imgsrc=\"http://counter.yesky.com/counter.shtml?CID=54197&AID=-1&refer=noscriptcounter&cur=noscriptcounter\"border=\'0\'width=\'0\'height=\'0\'/>
</noscript>


Tags: 

延伸阅读

最新评论

发表评论