CSS:它呈现“ul> li“快于“ul li”? [英] CSS: Does it render "ul > li" faster than "ul li"?
问题描述
使用>而不是让我从更少的人那里得到更快的呈现?
using ">" rather than " " make the rendered faster as I heard from few people?
.slide:hover > div > span {
border-color: #c8c8c8;
}
或
.slide:hover div span {
border-color: #c8c8c8;
}
非常感谢!
更新:问题
update: question
推荐答案
你应该非常认真地重新考虑听听告诉你这种类型的东西的人。
You should very seriously reconsider listening to the people who tell you this type of thing.
这种差异在最佳时是完全不重要的。没有人应该浪费时间,精力或脑力考虑这些事情。这不是一个有用的优化。不要陷入过早优化的陷阱,特别是对于像HTML / CSS这样的动态语言。
The difference is utterly insignificant at best. No one should waste time, energy, or brainpower considering such things. This isn't a useful optimization. Don't fall into the trap of premature optimization, especially for a dynamic language like HTML/CSS.
编写清晰,可维护和功能的代码 first ,然后再担心其他任何操作。
如果 ul> li
看起来比 ul li
更清楚,然后这样写。如果没有,不要。保持简单。
Write code that is clear, maintainable, and functional first, before worrying about anything else.
If ul > li
looks clearer to you than ul li
, then write it that way. If not, don't. Keep it simple.
这篇关于CSS:它呈现“ul> li“快于“ul li”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!