您现在的位置: 雨哲在线 >> 文章教程 >> Web开发 >> HtmlCss >> 查看文章内容
广告位招商QQ:425162221

CSS属性书写顺序推荐

【字体: 】         ★★★ 作者:未知    文章来源:网络    点击数:    更新时间:2008-07-25    阅读点数:0

载入中

对于CSS属性的书写顺序,一般都是信手拈来,一蹴而就,HOHO,下面是来自Mozilla Firefox 建议的CSS书写顺序,据说对SEO有好处喔。
//显示属性
* 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属性顺序书写规范:

*{
/*显示属性*/
display
position
float
clear
cursor


/*盒模型*/
margin
padding
width
height

/*排版*/
vertical-align
white-space
text-decoration
text-align


/*文字*/
color
font
content

/*边框背景 为什么要把 boder和background放在最后的原因是修改的频率会较之前的频繁,放在最后查看起来方便,哈哈。*/
border
background
}

/*浏览器 Hack*/
test:791px!important; /*FF Hack*/
*test:785px!important; /*IE7 Hack*/
test:777px; /*IE7以下*/

文章来源:雨#哲

网友看法
    数据载入中,请稍后……
    发表评论
    昵 称: 邮 箱:
    评 分:
    内 容:
    0/5000)
    插入链接
    验证码:

    雨哲提示:Alt+S快速发表
广告位招商QQ:425162221