CSS属性书写顺序

拈花ヽ惹草 提交于 2020-01-20 01:39:54

遵循以下顺序:
布局定位属性: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);
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    -o-border-radius: 10px;
    -ms-border-radius: 10px;
    border-radius: 10px;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!