2013年12月18日 星期三

[CSS] How to fix Margin Auto when Floating-Left Elements are involved

http://stackoverflow.com/questions/18329137/how-to-fix-margin-auto-when-floating-left-elements-are-involved

http://jsfiddle.net/kBqCJ/

<code>

<div class="page">
    <div class="container">
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
    </div>
</div>


<style>
.page {
  width: 100%;
}

.container {
  width: 100%;
  display: block;
  margin: 0 auto;
    text-align: center;
}

.box {
  display: inline-block;
  width: 200px;
    height: 200px;
    background: grey;
}

</style>

</code>

沒有留言:

張貼留言

[夕陽感言] 系統的千瘡百孔

凡事都有兩面,有好處,自然有壞處;有得,自有失;沒有完美,總有它的限制。 沒有一個程式可以解決所有的問題,沒有一個系統沒有漏洞。它能到達「成熟」的階段,但它永不會完美。之後就是隨著年日總有「老化」的一天,或是世界進步了,或是已經maintain不到了……科技的日新月異,隨著pro...