小编Jas*_*son的帖子

哪个更快:重复样式还是重复选择器?

我想知道以下哪个例子会更好.如果性能相同,哪一个读得更好?

示例1(重复选择器)

.helpfulCommenter, .questionTroll { color: #f00; }

.questionTroll { text-decoration: line-through; }

.helpfulCommenter { color: #f00; }

.questionTroll { color: #f00; text-decoration: line-through; }

.helpfulCommenter, .questionTroll { color: #f00; }

.questionTroll { text-decoration: line-through; }

要么

示例2(重复样式)

.helpfulCommenter { color: #f00; }

.questionTroll { color: #f00; text-decoration: line-through; }

.helpfulCommenter, .questionTroll { color: #f00; }

.questionTroll { text-decoration: line-through; }

.helpfulCommenter { color: #f00; }

.questionTroll { color: #f00; text-decoration: line-through; }

我知道类名不是语义,这里展示的特定样式是无关紧要的.我只是想知道哪些浏览器更容易解析和实现.

css

5
推荐指数
1
解决办法
81
查看次数

标签 统计

css ×1