Good:
For writing maintainable and scalable HTML documents.
Bad:
For writing maintainable and scalable HTML documents.
— HTML Best Practices
Good:
For writing maintainable and scalable HTML documents.
— HTML Best Practices
Also good (recommended by WHATWG):
For writing maintainable and scalable HTML documents.
— HTML Best Practices
Also good too (recommended by W3C):
For writing maintainable and scalable HTML documents.
Bad:
Good:
Bad:
- General
- The root Element
- Sections
...
Good:
- General
- The root Element
- Sections
...
Bad:
![]()
“HTML Best Practices” Cover Art
Good:
![]()
![]()
“HTML Best Practices” Cover Art
Bad:
...
Good:
...
Bad:
...
Good:
... Text-level semantics
Bad:
WHATWG
A community maintaining and evolving HTML since 2004.
Good:
WHATWG
A community maintaining and evolving HTML since 2004.
Bad:
offline version
Good:
offline version
Bad:
Japanese PDF version
Good:
Japanese PDF version
Bad:
Click here to view PDF version.
Good:
PDF version is also available.
Bad:
Caution!
Good:
Caution!
Bad:
Good:
Bad:
“For writing maintainable and scalable HTML documents”
Good:
For writing maintainable and scalable HTML documents
Also good:
“For writing maintainable and scalable HTML documents”
Bad:
HBP
Good:
HBP
Bad:
HTML
Good:
HTML
Bad:
Good:
Specify code language with class attribute prefixed with language-
Bad:
<DOCTYPE html>
Good:
<DOCTYPE html>
Bad:
Ctrl+F5
Good:
Ctrl+F5
Bad:
HTML Best Practices
Good:
HTML Best Practices
Bad:
HTML
Best
Practices
Good:
HTML
Best
Practices
Bad:
Good:
Bad:
For writing maintainable and scalable HTML documents.
And for mental stability.Don't trust!
Good:
For writing maintainable and scalable HTML documents.
And for mental stability.Don't trust!
Bad:
Good:
Bad:
Good:
Bad:
Good:
Bad:
If your browser support inline frame, ads are displayed here.
Good:
Bad:
Good:
Bad:
Good:
Bad:
General The root Element Sections
Good:
General The root Element Sections
Bad:
Element | Empty | Tag omission |
pre | No | Neither tag is omissible |
img | Yes | No end tag |
Good:
Element | Empty | Tag omission |
---|---|---|
pre | No | Neither tag is omissible |
img | Yes | No end tag |
Bad:
Query:
Good:
Bad:
Good:
Bad:
Good:
Bad:
Good:
Bad:
Good:
Bad:
Good:
Bad:
Good:
Bad:
Good:
Bad:
512GB used (1024GB total)
Good:
512GB used (1024GB total)
Bad:
Good:
Bad:
Good:
Bad:
Good:
Bad:
Also bad:
Good:
Bad:
Good:
Bad:
... ...
Good:
... ...
原文出处:https://github.com/dyygtfx/html-best-practices