Search

11/30/2007

Indenting CSS

Indenting CSS - 非常有創意的寫法,第一種寫法是依照 selector 的 weight 排序,實際上蠻難( to me at least )即時判斷selector的權重,第二種寫法的可行性蠻高的,是依照 HTML 的 structure 下去寫的,下次來試看看。


table.data_table {
}
table.data_table tr {
}
table.data_table tr td {
}
table.data_table tbody {
}
table.data_table tbody td {
}



1. div#box {
2. background-color: #FFF;
3. border: 1px solid #2E5E81;
4. margin: 50px auto 0 auto;
5. width: 790px;
6. }
7.
8. div#top, div#bottom {
9. background-color: #ADDCFF;
10. height: 25px;
11. line-height: 25px;
12. }
13.
14. div#main {
15. background: transparent url(../images/background.png) 10px 10px no-repeat;
16. height: 500px;
17. }
18.
19. div#content {
20. background-image: url(../images/png/50.png);
21. height: 500px;
22. margin: 25px 25px 25px 395px;
23. padding: 10px 10px 10px 10px;
24. }


<body>
<div id="box">
<div id="top">
<div id="main">
<div id="content">
</div>
<div id="bottom"></div>
</div>
</body>

沒有留言: