HTML属性的顺序是否对性能有任何影响? [英] Does the order of HTML attributes have any effect on performance?
问题描述
是否有任何理由与解析时间,布局,渲染时间,样式应用程序等有关,使HTML属性具有某种(或一致)的顺序? > HTML属性的顺序不会显着提高页面的可压缩性,并且保持某种顺序可以使得标记更容易让人类读者弄清楚(例如,首先将 id
>,开始< input> $ c $用$
类型
,将布尔属性放在开始标记的末尾),但我想知道是否有任何性能原因考虑属性顺序。 p>
没有人可以说我不认为。
只要代码没有语法错误,并且(显然)越短越好。
Is there any reason that relates to parsing time, layout, rendering time, style application, etc. to have HTML attributes in a certain (or consistent) order?
The order of HTML attributes does not improve a page's compressibility significantly, and maintaining some order can make the markup easier for human readers to figure out (e.g. putting id
first, starting <input>
s with type
, putting boolean attributes at the end of an opening tag) but I'd like to know if there are any performance reasons to consider attribute order.
None to speak of I don't think. All the properties within each tag have to be parsed and read before the tag can be properly understood by the browser.
As long as the code is syntax-error free and (obviously) the shorter the better.
这篇关于HTML属性的顺序是否对性能有任何影响?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!