Internet
Fact-checked

At EasyTechJunkie, we're committed to delivering accurate, trustworthy information. Our expert-authored content is rigorously fact-checked and sourced from credible authorities. Discover how we uphold the highest standards in providing you with reliable knowledge.

Learn more...

In HTML, what is a Tag?

M.R. Anglin
M.R. Anglin

Hyper text markup language (HTML) is a language that can be used to tell a web browser how to display web pages. To do this, HTML tags are utilized to dictate how the text or images are to be placed or formatted on the page. HTML tags are normally enclosed by angle brackets (< >). These brackets tell the browser that the text within the bracket is HTML code, rather than text to be displayed. Using HTML, a browser can display text and images in a variety of colors, fonts, and formatting types.

An HTML element has a certain format. First, there are the opening tags, also called start tags. Within the angle brackets is the code or other information a web browser needs to display text in the appropriate way. After the opening tag, the text or information that is affected by the code is typed in and after that the closing tag is inputted. Thus, if a person wanted the word “color” to be in boldface type, the person would input something like this: <b> color </b>. This will result in text that looks like this: color.

HTML tags are the portion of the code that determine how text and images are displayed on the webpage.
HTML tags are the portion of the code that determine how text and images are displayed on the webpage.

In the example above, the opening tag is <b>. This tells the computer that the text to follow is to be in boldface format. The closing tag is </b>, which tells the computer that the boldface format should stop. It is important to make sure tags are closed when writing HTML. Otherwise, in going with the example, a person would end up with all the text following the opening tag being in boldface rather than just the text he wishes to be formatted.

Tags are enclosed by angle brackets and provide the information on how an element, such as text, is to be displayed on a web page.
Tags are enclosed by angle brackets and provide the information on how an element, such as text, is to be displayed on a web page.

There are many tags in HTML and each tell the browser to display text and images in different ways. In general, they are fairly easy to understand. “B,” “i,” and “u” stand for boldface, italics, and underline respectively. In addition, there are tags that tell the computer to insert a hyperlink, tags that allow for the input of images, as well as tags that allow for a variety of other formatting, spacing, and other features that help to make websites appear as they do. It is important to note, however, that some tags are depreciated.

Depreciated tags are tags that have been labeled obsolete by the World Wide Web Consortium (W3C), a body that develops the standard for HTML, and have been substituted by different options in newer versions of HTML and XHTML. An example of a depreciated tag is the “u.” Since tags like this have been replaced by other options that are more practical, it is advised that writers of HTML coding opt for using the newer tags. In the example with underlining, the “style” attribute should be used. This attribute allows for several different text formatting options, including underlining, coloring, fonts, and other text styles.

Discuss this Article

Post your comments
Login:
Forgot password?
Register:
    • HTML tags are the portion of the code that determine how text and images are displayed on the webpage.
      By: alexeysmirnov
      HTML tags are the portion of the code that determine how text and images are displayed on the webpage.
    • Tags are enclosed by angle brackets and provide the information on how an element, such as text, is to be displayed on a web page.
      By: Stephen VanHorn
      Tags are enclosed by angle brackets and provide the information on how an element, such as text, is to be displayed on a web page.