CSS属性的常规顺序 [英] Conventional Order of CSS properties

查看:225
本文介绍了CSS属性的常规顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一个标准的指导CSS属性应该是什么样的顺序?这将决定是否应该使用此代码

Is there a standard guideline of what order the CSS properties should be in? This would be to decide if I should use this code

p {font-size: 14px; color: purple}

或此代码

p {color: purple; font-size: 14px}



编辑



我现在使用 CSS盒模型约定

推荐答案

没有广泛采用的惯例。两个示例之间没有区别,因此您应该选择您喜欢的约定。如果你必须真正满足hobgoblins,选择字母顺序或它影响盒子模型的顺序。

There is no widely adopted convention. There is no difference between either example, so you should choose the convention you prefer. If you must really satisfy the hobgoblins, choose alphabetical or the order it affects the box model.

这篇关于CSS属性的常规顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆