Does it matter in what order attributes are specified within a tag? In other words, is (img src="XXXX.zzz" width="100%" height="100%") treated the same as (img width="100%" src="XXXX.zzz" height="100%"), or even (height="100%" width="100%" img src="XXXX.zzz")??? Thanks.

3 answers

1
point
This was chosen as the best answer

It may not matter to the machines, but it's a good idea to pick a standard approach and stick with it. It makes it easier to debug code when you always know where to look for things. I alphabetize my CSS rules (border, color, font-size, etc.) for the same reason.

Answered about 7 years ago by Alex Taylor
orta 244
1
point

They are treated the same, yes. Therefore attribute order is irrelevant.

Answered about 7 years ago by orta
-4
points

While I usually hate one word answers... Yes.

Answered about 7 years ago by Eli Cochran
  • This is why one word answers are bad. What are you saying yes to? That it matters what order attributes are specified within a tag or that the two examples are treated the same. "Yes" doesn't answer this question at all. Eric Ryan Harrison about 7 years ago