HTML Missing DOCTYPE
A DOCTYPE declaration tells the browser which HTML version to use. Missing or wrong DOCTYPE can cause quirks mode.
Common causes
- No <!DOCTYPE html> at start.
- Wrong or legacy DOCTYPE.
How to fix
- Add <!DOCTYPE html> as the first line.
- Use the HTML5 DOCTYPE for modern pages.
Examples
Good
<!DOCTYPE html> <html>
FAQ
- Is DOCTYPE required?
- Best practice; validators expect it.
- What DOCTYPE for HTML5?
- <!DOCTYPE html>.
Fix it now
Try in validator (prefill this example)