HTML rules
Duplicate ID¶
IDs should be unique.
Before
After
Missing component¶
Many tags require specific attributes.
Before
<!DOCTYPE html>
<html>
<head>
<title>Foo</title>
</head>
<body>
<button>Click me</button>
<input type="text"/>
<img src=""/>
</body>
</html>
After
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="description" content="Foo">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Foo</title>
</head>
<body>
<button type="button">Click me</button>
<input type="text" aria-label="Input"/>
<img src="foo.png" alt="Foo image"/>
</body>
</html>
Declaring¶
Lowercase syntax¶
Tags and attributes should be lowercase.
Before
After