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>

沒有留言:

張貼留言

[設計軟硬件] 2026年3月份關於設計軟硬件價錢的資料搜集

Hardware Macbook Pro 16吋 M5 Pro 銀色 標準顯示器 48GB RAM 2TB SSD Storage HK$27,999 Arduino Hardware with sensors & software for control TaoBao ...