xhtml css網(wǎng)頁布局是否要注意CSS書寫順序?_CSS教程
教程Tag:暫無Tag,歡迎添加,賺取U幣!
我們運用xhtml css網(wǎng)頁布局,實現(xiàn)表現(xiàn)與結構的分離,表現(xiàn)部分的css文件非常重要,也比較繁雜,我們在書寫CSS文件時有很多屬性和值,我們就考慮到了書寫順序的問題。
有時候是先寫了margin或color,然后再寫width和height等等。我們有沒有必要讓我們的編碼更加的工整,更加的科學呢?實踐證實,書寫工整、按一定的規(guī)則進行書寫是很有好處的。
下面是Mozilla Firefox所建議的CSS書寫順序,對我們的代碼書寫很有參考價值:
有時候是先寫了margin或color,然后再寫width和height等等。我們有沒有必要讓我們的編碼更加的工整,更加的科學呢?實踐證實,書寫工整、按一定的規(guī)則進行書寫是很有好處的。
下面是Mozilla Firefox所建議的CSS書寫順序,對我們的代碼書寫很有參考價值:
示例代碼 [www.wf0088.com]
* mozilla.org Base Styles
* maintained by fantasai
* (classes defined in the Markup Guide -http://mozilla.org/contribute/writing/markup)
*/
/* Suggested order:
//顯示屬性
* display
* list-style
* position
* float
* clear
//自身屬性
* width
* height
* margin
* padding
* border
* background
//文本屬性
* color
* font
* text-decoration
* text-align
* vertical-align
* white-space
* other text
* content
* maintained by fantasai
* (classes defined in the Markup Guide -http://mozilla.org/contribute/writing/markup)
*/
/* Suggested order:
//顯示屬性
* display
* list-style
* position
* float
* clear
//自身屬性
* width
* height
* margin
* padding
* border
* background
//文本屬性
* color
* font
* text-decoration
* text-align
* vertical-align
* white-space
* other text
* content
相關CSS教程:
- 相關鏈接:
- 教程說明:
CSS教程-xhtml css網(wǎng)頁布局是否要注意CSS書寫順序?。