Difference between revisions of "HTML Validation"
Jeff-strong (talk | contribs) m (Editorial review and minor corrections) |
|||
Line 1: | Line 1: | ||
== HTML Validator == | == HTML Validator == | ||
The site https://validator.w3.org provides an HTML Validation service | The site https://validator.w3.org provides an HTML Validation service that you can (and should) use to validate HTML pages. It's very easy to use. Simply copy your URL from the browser's URL bar and paste it in the address textbox validator, then click "Check." | ||
{{ResponsiveImage|[[file:W3CMarkupValidationService.png|link=|W3C Markup Validation Service]]}} | {{ResponsiveImage|[[file:W3CMarkupValidationService.png|link=|W3C Markup Validation Service]]}} | ||
== Common Errors == | == Common Errors == |
Latest revision as of 18:19, 24 September 2022
HTML Validator[edit]
The site https://validator.w3.org provides an HTML Validation service that you can (and should) use to validate HTML pages. It's very easy to use. Simply copy your URL from the browser's URL bar and paste it in the address textbox validator, then click "Check."
Common Errors[edit]
Missing "lang attribute"[edit]
😲 Message: Consider adding a lang attribute to the html start tag to declare the language of this document.
✅ Fix: Include a language attribute in the html start tag:
<html lang="en">
Character encoding was not declared[edit]
😲 Message: The character encoding was not declared. Proceeding using windows-1252.
✅ Fix: Include a meta element with a charset attribute immediately after the opening <head> tag
<head>
<meta charset="utf-8">
Start tag seen without doctype[edit]
😲 Message: Start tag seen without seeing a doctype first. Expected <!DOCTYPE html>
✅ Fix: Include a !DOCTYPE as the first tag
<!DOCTYPE html>