css架構 grid.html 轉

來源:互聯網
上載者:User

轉自http://hi.baidu.com/yongqihejiqing/home

"

span-x:
設定它的
float:left;
width:(x*40-10)px;
margin-right:10px;
border:

設定border後時,
padding-right:4px;
margin-right:5px;
border: 1px solid #eee;

當它們同時設定時(CSS名字是:層疊樣式表),
所以margin-right:5px會覆蓋上面的margin-right:10px;

<div class="span-1 border"><p>phpzht@gmail.com</p></div>
它的樣式為:
float:left;
width:30px;/*(x*40-10)px;*/
padding-right:4px;
margin-right:5px;
border: 1px solid #eee;

.last,div.last的主要是為了:margin-right:0;
它平時用在span-x這樣的類中,而又因為span-x有margin-right:10px;用.last或者div.last
margin-right:0;會覆蓋margin-right:10px;

<div class="prepend-1 span-1"><p>php</p></div>
<div class="prepend-20 span-1 append-1 last"><p>zht</p></div>
解釋上面代碼:
第一個div:
    prepend-1意思為:
        padding-left:40px;
    span-1意思為:
        width:30px;
        margin-right:10px;
第二個div:
    prepend-20意思為:
        padding-left:800px;(20*40px)
    span-1意思為:
        width:30px;
        margin-right:10px;
    append-1意思為:
        padding-right:40px;
    last意思為:
        margin-right:0px;

最後CSS代碼為:
第一個div:{
    padding-left:40px;
    width:30px;
    margin-right:10px;
}
第二個div:{
    padding-left:800px;
    width:30px;
    margin-right:0px;
    padding-right:40px;
}

"

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.