css属性书写顺序

 

css属性书写顺序 

 

 建议遵循以下顺序:

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

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

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

其他属性(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); border-radius: 10px;
}

posted @ 2022-04-09 14:21  jiecodes  阅读(22)  评论(0编辑  收藏  举报