Why is the doctype a different color from the <html> tags?


#1

Question

Why is the doctype a different color from the tags?

Answer

Line one is not actually an HTML element or tag. As you discovered in the first exercise of this lesson, it is a declaration that lets the browser know that it is looking at an HTML5 document and it should be parsed accordingly.

Text editors like the one you are using in this workspace often use different colors to help developers distinguish between different pieces of code and to aid in overall readability.


FAQ: Learn HTML Elements - Common HTML Elements - The `<html>` tag