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

CSS样式表
CSS教程之css选择器 、属性、值
CSS的color颜色使用说明
firefox css自动换行的实现方法
css支持标准的图片垂直居中
css+table 1px边框单元格
css之使table也能overflow:hidden
几个常用经典的css技巧
css 跨浏览器实现float:center
css浏览器不兼容原因分析及解决办法
iframe transparent透明背景方法
有衬线字体与无衬线字体比较
div+css在思路和流程上实现结构与表现的分离分析
css教程 css和document
层盖住下拉列表框问题解决方案
css样式之区分input是按钮还是文本框的方法
CSS expression控制图片自动缩放效果代码[兼容 IE,Firefox]
谈谈网页设计中的字体应用Font Set
XHTML标签的自关闭写法的坏处分析
顶级经典常用的CSS属性收集整理
10条影响CSS渲染速度的写法与使用建议

CSS样式表书写顺序


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-28   浏览: 98 ::
收藏到网摘: 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