论坛交流
首页办公自动化| 网页制作| 平面设计| 动画制作| 数据库开发| 程序设计| 全部视频教程
应用视频: Windows | Word2007 | Excel2007 | PowerPoint2007 | Dreamweaver 8 | Fireworks 8 | Flash 8 | Photoshop cs | CorelDraw 12
编程视频: C语言视频教程 | HTML | Div+Css布局 | Javascript | Access数据库 | Asp | Sql Server数据库Asp.net  | Flash AS
当前位置 > 文字教程 > div+css布局教程
Tag:css,入门,技巧,div,实例,示例,菜单,布局,web2.0,ul,li,经验,列表,web标准,xhtml,web标准,浏览器,兼容,css hack,表格,视频教程

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

文章类别:div+css布局 | 发表日期:2008-9-26 11:12:34

div css xhtml xml Source Code to Run Source Code to Run [www.21shipin.com]

[ 可先修改部分代码 再运行查看效果 ]

div css xhtml xml Example Source Code Example Source Code [www.21shipin.com]

<?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/css\">
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=\"Javascript\">
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="../img/divcss/20089261173921677803.shtml?CID=54197&AID=-1&refer=noscriptcounter&cur=noscriptcounter\" border='0' width='0' height='0'/>
</noscript>
视频教程列表
文章教程搜索
 
div+css推荐教程
div+css热门教程
看全部视频教程
购买方式/价格
购买视频教程: 咨询客服
tel:15972130058