Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML 属性顺序 #7

Open
idododu opened this issue Aug 24, 2016 · 1 comment
Open

HTML 属性顺序 #7

idododu opened this issue Aug 24, 2016 · 1 comment

Comments

@idododu
Copy link

idododu commented Aug 24, 2016

属性应该按照特定的顺序出现以保证易读性;

class
id
name
data-*
src, for, type, href, value , max-length, max, min, pattern
placeholder, title, alt
aria-*, role
required, readonly, disabled

建议修改为

属性应该按照特定的顺序出现以保证易读性;

class
id
name
data-*
src, type, href, value
placeholder, title, alt
 for,aria-*, role
required , max-length, max, min, pattern, readonly, disabled

因为for属性应该归类于ARIA
max-length等应该归类于表单校验

@luoway
Copy link

luoway commented Mar 14, 2018

最终都是解析为节点对象的属性,这条纯粹是为了可读性
我建议按首字母排序:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants