views:

28

answers:

2

Should the attributes of any particular HTML tag be listed in a specific order? Is there a convention for the order? For example, I have the following image tag in an HTML strict page...

<img src="http://example.com/media/graphics/border_bottom.png" class="border" height="5px" width="600px" alt="Lower Border" />

Should the src be listed first, or the height, or the width, etc? What is the proper order?

Thanks in advance!

A: 

Nope not at all, the order doesn't matter. I tend to put attributes in the same order in my pages, just for consistency but it's isn't needed

Glenn Slaven
A chap at a company I freelanced at pointed out that consistently ordering your attributes within a given page could help the gzip algorithm compress the page, as it (roughly speaking) compresses by eliminating duplicate strings.
Paul D. Waite
@Paul - Definitely true, but give me a call when that's even close to being a bottleneck in your website's performance and I'll.. well let's just say that'll never be the bottleneck.
Gareth
@Gareth: yeah, it’s not going to be a big effect.
Paul D. Waite
+1  A: 

No there isn't, but anyway you should follow make your own standard and follow it

armonge