10. CSS属性书写顺序(重点)

时间:2021-01-27 14:06:31   收藏:0   阅读:0

生活中衡量一个人有气质:穿着打扮举止言行等等,编程中如何衡量一个人的代码能力?规范标准优雅高质量等等一个词形容专业从代码中看出是否有经验..

建议遵循以下顺序:

  1. 布局定位属性:display / position / float / clear / visibility / overflow(建议 display 第一个写,毕竟关系到模式)

  2. 自身属性:width / height / margin / padding / border / background

  3. 文本属性:color / font / text-decoration / text-align / vertical-align / white- space / break-word

  4. 其他属性(CSS3):content / cursor / border-radius / box-shadow / text-shadow / background:linear-gradient …

.jdc {
 display: block;
 position: relative;
 float: left;
 width: 100px;
 height: 100px;
 margin: 0 10px;
 padding: 20px 0;
 font-family: Arial, ‘Helvetica Neue‘, Helvetica, sans-serif;
 color: #333;
 background: rgba(0,0,0,.5);
 -webkit-border-radius: 10px;
 -moz-border-radius: 10px;
 -o-border-radius: 10px;
 -ms-border-radius: 10px;
 border-radius: 10px;
}

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!