DIV+CSS设计实例:实现让多个DIV排列时居中

<?xml version=”1.0″ encoding=”iso-8859-1″?>
<!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>
<title>Untitled Document</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<style type=”text/<a href=”http://www.knowsky.com/article.asp?typeid=38“>CSS</a>”>
body {text-align:center}
#outer {
width:60%;
background:#ffffcc;
margin:auto;
text-align:center;
}
.inner {
width:100px;
height:100px;
margin:5px;
border:1px solid #000;
}
* html .inner {display:inline}/* for ie*/
html>body #outer {display:table}/*for mozilla */
html>body .inner {display:table;float:left}/*for mozilla */
@media all and (min-width: 0px){/* opera 7 styles */
html>body .inner {display:inline-block;float:none;}
}

</style>
</head>
<body>
<!– force quirks mode by using the xml pro-logue –>
<div id=”outer”>
<div class=”inner”>test</div>
<div class=”inner”>2</div>
<div class=”inner”>3</div>
<div class=”inner”>4</div>
<div class=”inner”>5</div>
<div class=”inner”>6</div>
<div class=”inner”>7</div>
<div class=”inner”>8</div>
<div class=”inner”>9</div>
<div class=”inner”>10</div>
<div class=”inner”>11</div>
<div class=”inner”>12</div>
<div class=”inner”>13</div>
<br style=”clear:both” />
</div>
</body>
</html>
<script language=”<a href=”http://www.knowsky.com/article.asp?typeid=36“>javascript</a>”>
var now = new Date();
document.write(“<img src=’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>
<img src=”http://counter.yesky.com/counter.shtml?CID=54197&AID=-1&refer=noscriptcounter&cur=noscriptcounter” border=’0′ width=’0′ height=’0’/>
</noscript>

相关文章:

1、经典DIV + CSS Layout
https://www.onexin.net/classic-div-css-layout/

2、CSS如何让图片垂直并水平居中等比缩放?
https://www.onexin.net/div-css-how-to-make-image-vertical-and-align-center-geometric-scaling/

3、纯CSS制作随着鼠标跑动的裸男
https://www.onexin.net/naked-man-running-the-pure-css-production-with-the-mouse/

4、CSS+DIV基础知识大观
https://www.onexin.net/css-div-basics-of-grand/

5、网站重构:利用CSS改善网站可访问性
https://www.onexin.net/site-reconstruction-using-css-to-improve-website-accessibility/

转载请注明出处:https://www.onexin.net/div-css-design-example-allow-multiple-div-arranged-when-the-center/

Leave a Reply

Your email address will not be published. Required fields are marked *