In HTML, what is a Tag?

Article Details
  • Written By: M.R. Anglin
  • Edited By: Bronwyn Harris
  • Last Modified Date: 27 September 2019
  • Copyright Protected:
    Conjecture Corporation
  • Print this Article
Free Widgets for your Site/Blog
As President of Uruguay, José Mujica refused to live in the presidential mansion and gave away 90% of his salary.  more...

October 16 ,  1964 :  China became the fifth country in the world to successfully detonate a nuclear bomb.  more...

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.


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.

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.


You might also Like


Discuss this Article

Post your comments

Post Anonymously


forgot password?