Does the order of HTML attributes have any performance impact?

Is there any reason related to parsing time, layout, rendering time, style app, etc. to have HTML attributes in a specific (or sequential) order?

The order of HTML attributes does not significantly improve page compressibility , and maintaining some order can make markup easier for readers to understand (for example, put id first, starting <input> with type , putting logical attributes at the end of an open tag), but I would like to know are there any reasons for evaluating the order of the attributes.

+6
source share
2 answers

No one talks about what I don’t think. All properties within each tag must be analyzed and read before the tag is correctly understood by the browser.

So far, the code is not syntax - without errors and (obviously), the shorter the better.

+3
source

It all depends on the layout mechanism, but I suspect this will be negligible. You do not have to worry about this.

+2
source

Source: https://habr.com/ru/post/889007/


All Articles