Loading lesson path
Concept visual
Start from A
Consistent, clean, and tidy HTML code makes it easier for others to read and understand your code. Here are some guidelines and tips for creating good HTML code.
Always declare the document type as the first line in your document. The correct document type for HTML is: <!DOCTYPE html>
HTML allows mixing uppercase and lowercase letters in element names. However, we recommend using lowercase element names, because:
<body>
Formula
< p > This is a paragraph.</p ></body>
<BODY>
Formula
< P > This is a paragraph.</P ></BODY>
In HTML, you do not have to close all elements (for example the <p> element). However, we strongly recommend closing all HTML elements, like this:
<section>
Formula
< p > This is a paragraph.</p >
< p > This is a paragraph.</p ></section>
<section>
Formula
< p > This is a paragraph.
< p > This is a paragraph.</section>
HTML allows mixing uppercase and lowercase letters in attribute names. However, we recommend using lowercase attribute names, because:
Formula
< a href ="https://www.w3schools.com/html/"> Visit our HTML tutorial </a >Formula
< a HREF ="https://www.w3schools.com/html/"> Visit our HTML tutorial </a >HTML allows attribute values without quotes. However, we recommend quoting attribute values, because:
You MUST use quotes if the value contains spaces
<table class="striped">
Formula
< table class = striped >