HTML Essentials
HTML Syntax
Read and write the punctuation that forms HTML markup.
HTML syntax is the small set of writing rules browsers use to recognize elements. Most elements use an opening tag, content, and a closing tag.
Reading markup
Angle brackets surround tag names, while a forward slash marks a closing tag.
Important definitions
- Opening tag
- Starts an element.
- Closing tag
- Ends an element and includes a forward slash.
- Content
- The information placed between tags.
Syntax
Use this general pattern as a reference:
HTML
<tag>content</tag>Examples
Paragraph syntax
EXAMPLE 1
<p>A clear sentence.</p>ResultA clear sentence.
Empty element
EXAMPLE 2
<br>ResultA line break.
COMPLETE EXAMPLE
<section>
<h2>Profile</h2>
<p>Learning one element at a time.</p>
</section>Expected output
A Profile heading followed by a paragraph.
Note
Some elements, such as img and br, do not wrap content.
Tip
Type opening and closing tags together, then add the content between them.
Common mistakes
- Missing the closing angle bracket.
- Writing the slash in the opening tag.
- Using curly quotation marks in attributes.