HTML Tag Definition

What you need to know about HTML tags

HTML question mark
HTML question mark.

HTML is the language of the Web. The web pages that you view on your computer or phone, including this one, are written in Hypertext Markup Language using what are known as "HTML tags". You can think of HTML as the "under-the-hood code" that controls the structure of a web page.

Ultimately, when you learn any new language, you begin with simple phrases and build from there. Learning about HTML is no different. You will begin by perfecting common HTML tags. This is the equivalent of learning "simple phrases" in a spoken language. Those phrases become the bedrock upon which you build your knowledge and speech, just like HTML tags are the foundation upon which you will build your web development skills.

HTML Tag Format

You can recognize an HTML tag because it is surrounded by the characters < and > at the beginning and end of the tag. Between these two characters would be other text that defines what kind of HTML tag is being written. For example, if you know that "hr" means horizontal rule (or line) you would write this for the HTML tag:


You've just written an HTML tag that draws a horizontal rule on a web page.

Most HTML tags come in pairs. They are placed at the beginning and at the end of a section of text to dictate the content that they will contain. These tag pairs make up HTML elements. When you learn that  and   are the opening and closing tags to make text bold, you begin to understand how HTML tags affect the appearance of text on a web page.

This sentence will appear in all bold because of the hidden HTML tags.

The closing strong tag (which stands for "strong emphasis and which, by default, renders text as bold) is identical to the opening strong tag except that it includes a slash in the tag. This is the format that is followed by most HTML tags. The opening tag and closing tags are the same, with the addition of a slash in the closing that follows the first "<" character.

HTML Tag Combinations

HTML tags are frequently used in combination. The opening and closing tags for emphasized (italics) text are and  . Adding the italic tags to a single word in the all-bold sentence example causes the word to appear is both bold and italics on the web page.

This sentence will appear in all bold because of the hidden HTML tags. 

Whenever several tags are used together in an element of a web page, with some tags appearing inside of others, they are referred to as nested HTML tags. You must remember that nested tags, which are the tags inside others, must be closed before their containing tags can be closed. Look at this example:

This is text that is emphasized for a specific reason.


You should notice that the tag is opened inside the

, which means it must be closed before the

closing tag appears. Think of nested tags like boxes inside of other boxes. Interior boxes must be closed before their exterior, containing boxes are.

HTML Tags and Web Pages

There are dozens of HTML tags in valid HTML. Some HTML tags dictate very common, basic elements like paragraphs, while others are more complicated and add more functionality, like link or "anchor" tags. A list of HTML tags gives a snapshot of the many functions tags can perform on a web page using tags.

There are also some tags that are required of all webpages. As you build your first page, you will use the

A list of HTML tags isn't much help until you've gone through an HTML tutorial, but after you do, you can use HTML tags to build your own web page. One note, do not be overwhelmed by the number of possible HTML tags. While there are hundreds of possible tags to use, the reality is that you are likely to only use a handful of them over and over. In fact, there are some HTML tags that we've never used even once in decades of web design work!

Deprecated Tags

HTML5 is the current markup standard . Some of the tags that were used in earlier versions of HTML are now handled by style sheets in HTML5. The deprecated HTML tags have been removed from the HTML specifications. It is best to not use any obsolete tags.

Format
mla apa chicago
Your Citation
Kyrnin, Jennifer. "HTML Tag Definition." ThoughtCo, Sep. 30, 2021, thoughtco.com/html-tag-definition-3466458. Kyrnin, Jennifer. (2021, September 30). HTML Tag Definition. Retrieved from https://www.thoughtco.com/html-tag-definition-3466458 Kyrnin, Jennifer. "HTML Tag Definition." ThoughtCo. https://www.thoughtco.com/html-tag-definition-3466458 (accessed March 28, 2024).