<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<style>
.parent { width:1500px;height:250px;margin:0 auto;text-align:center;background-color:red;}
.children {display:inline-block;width:100px;height:250px;}
/**+ html .children { display:inline;zoom:1;}*/
/** html .children { display:inline;zoom:1;}*/
</style>
</head>
<body>
<div class="parent">
<div class="children" style="background-color:green;"></div>
<div class="children" style="background-color:red;"></div>
<div class="children" style="background-color:yellow;"></div>
<div class="children" style="background-color:blue;"></div>
<div class="children" style="background-color:green;"></div>
<div class="children" style="background-color:red;"></div>
<div class="children" style="background-color:yellow;"></div>
<div class="children" style="background-color:blue;"></div>
<div class="children" style="background-color:green;"></div>
</div>
</body>
</html>
如何让让多个横向的DIV居中显示
最新推荐文章于 2023-11-28 11:50:56 发布