HTML attributes Order
Attribute order
HTML attributes should come in this particular order for easier reading of code.
class
id
,name
data-*
src
,for
,type
,href
,value
title
,alt
role
,aria-*
Classes make for great reusable components, so they come first. Ids are more specific and should be used sparingly (e.g., for in-page bookmarks), so they come second.
FROM http://codeguide.co/#html-attribute-order
留言
張貼留言