多个DIV排列时居中

来源:互联网 发布:网络保密十不准 编辑:程序博客网 时间:2024/05/01 04:48
<?xml version="1.0"encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<title>&#22810;&#20010;DIV&#25490;&#21015;&#26102;&#23621;&#20013;</title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />
<style type="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}
html>body #outer {display:table}
html>body .inner {display:table;float:left}
@media all and (min-width: 0px){
html>body .inner{display:inline-block;float:none;}
}

</style>
</head>
<body>
<!-- force quirks mode by using the xml pro-logue-->
<div id="outer">
  <divclass="inner">test</div>
  <divclass="inner">2</div>
  <divclass="inner">3</div>
  <divclass="inner">4</div>
  <divclass="inner">5</div>
  <divclass="inner">6</div>
  <divclass="inner">7</div>
  <divclass="inner">8</div>
  <divclass="inner">9</div>
  <divclass="inner">10</div>
  <divclass="inner">11</div>
  <divclass="inner">12</div>
  <divclass="inner">13</div>
  <br style="clear:both"/>
</div>
</body>
</html>
<script language="Javascript">
var now = new 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>test
2
3
4
5
6
7
8
9
10
11
12
13

原创粉丝点击