当前位置: 首页 > 图文教程 > 网页制作 > CSS样式表 > CSS样式表书写顺序

CSS样式表
关于CSS的一些基础应用
纯CSS实现的无侵入的卡盘(幻灯片)
w3c标准自适应高度height100%不起作用的问题分析
CSS代码组合和嵌套
CSS常用属性缩写实例
CSS代码缩写实例以及CSS缩写原因总结
网页字体大小的设计技巧
CSS3的新特性介绍
DOCTYPE和XHTML的相关认识
DIV CSS建立的符合web标准网页的好处
CSS语法缩写规则
FireFox浏览器和IE浏览器下CSS兼容问题
CSS代码属性分组的写法例子
解决全部网页木马的技巧
css教程:DIV垂直居中的办法
css常用布局多行多列
不同浏览器的CSS Hack写法小结
CSS 控制字符宽度省略号效果 兼容浏览器
纯CSS实现的三级下拉菜单实现代码
快速定位页面中复杂 CSS BUG

CSS样式表书写顺序


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-28   浏览: 54 ::
收藏到网摘: n/a

整理了一下自己写CSS时的顺序,跟大家分享下。

下表顺序为从上到下,从左到右:
========================
display || visibility
list-style : list-style-type || list-style-position || list-style-image
position
top || right || bottom || left
z-index
clear
float

width
max-width || min-width
height
max-height || min-height
overflow || clip
margin : margin-top || margin-right || margin-bottom || margin-left
padding : padding-top || padding-right || padding-bottom || padding-left
outline : outline-color || outline-style || outline-width
border
background : background-color || background-image || background-repeat || background-attachment || background-position

color
font : font-style || font-variant || font-weight || font-size || line-height || font-family
font : caption | icon | menu | message-box | small-caption | status-bar
text-overflow
text-align
text-indent
line-height
white-space
vertical-align
cursor