codecamp

属性编写顺序

推荐的样式编写顺序

  1. 1、显示属性

    1
    display/list-style/position/float/clear

    2、自身属性(盒模型)

    1
    width/height/margin/padding/border

    3、背景

    1
    background
  2. 4、行高

    1
    line-height
  3. 5、文本属性

1
2
color/font/text-decoration/text-align/
text-indent/vertical-align/white-space/content
  1. 6、其他

    1
    cursor/z-index/zoom
  2. 7、CSS3属性

    1
    transform/transition/animation/box-shadow/border-radius
  3. 8、链接的样式请严格按照如下顺序添加:

    1
    a:link -> a:visited -> a:hover -> a:active(LoVeHAte)


规则书写规范
性能优化
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }