内部样式和外部样式优先级_样式规则优先级

内部样式和外部样式优先级

Style rules take increasing priority as they grow closer to the element they are influencing: that is, in the case of a rule conflict, the rules for an inline style will trump those of an embedded style, and embedded style rules will be used over a linked style rule.

样式规则越接近影响的元素,其优先级就越高:也就是说,在规则冲突的情况下,内联样式的规则将胜过嵌入式样式的规则,而嵌入式样式规则将用于链接样式规则。

Style rules are synergistic if they do not conflict: a rule written in a linked style sheet will join with embedded and inline rules for the same element to create an appearance that is the result of combining the rules.

样式规则在不冲突的情况下是协同的:用链接的样式表编写的规则将与同一元素的嵌入式和内嵌规则结合在一起,以创建外观,这些外观是组合规则的结果。

All other things being equal, a conflicting rule between an id and a class will resolve by favouring the rule in the id.

在其他所有条件都相同的情况下, idclass之间的冲突规则将通过支持id的规则来解决。

翻译自: https://thenewcode.com/160/Style-rule-prioritization

内部样式和外部样式优先级

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值