Tags
In HTML, a Tag
is the fundamental unit used to structure and present content on web pages.
A tag is composed of keywords enclosed in angle brackets (< >
) like <tag>
.
A tag consists of a start tag (<tag>
) and an end tag (</tag>
), with the content that the tag applies to placed in between.
Here is an example of the structure of an HTML tag.
<tag>Content that the tag applies to</tag>
The start tag is represented as <tagname>
(e.g., <html>
), while the end tag is represented as </tagname>
(e.g., </html>
) with a slash (/
) in front of the tag name.
<html> Hello World! </html>
Note: Some tags have a slash (
/
) placed after the tag name, known as aSelf-closing Tag
. We will learn more about self-closing tags in later lessons.
Practice
Follow the highlighted parts of the code to practice your input.
Which of the following is the most appropriate closing tag?
Lecture
AI Tutor
Publish
Design
Upload
Notes
Favorites
Help