您可以将text-align: justify
用于div.wrapper
,也可以将display:inline-block
用于 div 列表。像这样:
HTML
<div class="wrapper">
<div id="search_tile" class="search_tile"></div>
<div id="timeline_tile" class="timeline_tile"> </div>
<div id="conversations_tile" class="conversations_tile"></div>
<div id="source_tile" class="source_tile"></div>
<div id="11_tile" class="demo_11_tile"></div>
<div id="14_tile" class="demo_14_tile"></div>
<div id="12_tile" class="demo_12_tile"></div>
<div id="13_tile" class="demo_13_tile"></div>
<div class="placeholder"></div>
<div class="placeholder"></div>
</div>
CSS
body{
background-color: blue;
}
.wrapper {
letter-spacing: -4px;
word-spacing: -4px;
font-size: 0;
text-align: justify;
}
.wrapper:after {
content:"";
display:inline-block;
width: 100%;
}
.wrapper div{
font-size: 16px;
letter-spacing: normal;
word-spacing: normal;
display:inline-block;
*display: inline;
zoom:1;
background-color:black;
width: 200px;
max-width: 200px;
height: 200px;
margin: 10px;
padding: 5px;
border: solid 2px yellow;
-webkit-transition: max-width 500ms ease-in-out, height 500ms ease-in-out;
-moz-transition: max-width 500ms ease-in-out, height 500ms ease-in-out;
-ms-transition: max-width 500ms ease-in-out, height 500ms ease-in-out;
-o-transition: max-width 500ms ease-in-out, height 500ms ease-in-out;
transition: max-width 500ms ease-in-out, height 500ms ease-in-out;
}
.wrapper .placeholder {
width: 200px;
height: 0;
border: none;
background:none;
}
请查看演示。如果你有兴趣,你可以点击这里和这里。