Is there a specific order that HTTP tag attributes should be listed in?

痞子三分冷 提交于 2019-11-28 07:56:58

问题


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!


回答1:


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




回答2:


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



来源:https://stackoverflow.com/questions/3817542/is-there-a-specific-order-that-http-tag-attributes-should-be-listed-in

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!