Pin Me

A Glossary of HTML Tags: G-M

written by: Haley Montgomery•edited by: Michele McDonough•updated: 6/26/2009

Basic HTML offers a wealth of options for web development if you just know the HTML tag code. Even if you use an HTML editor, it can be helpful to know the tags yourself. This article highlights an ongoing list of common HTML tags including their function and code. Part 3 of the series includes G-M.

  • slide 1 of 1

    HTML Tag Codes G - M

    HTML tags code utilizes the less-than (<) and greater-than (>) keys found on your keyboard. In order for the HTML code to be executed, each element must contain both a corresponding beginning and ending tag. An ending tag is differentiated from a beginning tag by using the forward slash key (/) prior to the element name, as seen in the following example:

    <ELEMENT> content here </ELEMENT>

    For the purpose of displaying these articles, the less-than and greater-than symbols have been replaced by an asterisk (*) in the code examples provided. The specific tag element is shown in all-caps, but HTML tag codes do not register letter case, so either may be used with programming.

    HEAD: The head tag is part of the basic structure of all HTML coded pages. It contains descriptive information about the page including the page title and meta tags used by search engines. It also often contains script coding that may be used within the page to execute certain functions.

    Code: *HEAD* content here */HEAD*

    HEADING: The heading tag displays various sizes of larger formatted text that can serve as headings. The tag defines 6 levels as part of the coding, with "1" being the smallest heading and "6" being the largest. This tag is sometimes used in lieu of setting multiple parameters with the font tag. In the code example below, replace the "#" sign with a numeral (1-6).

    Code: *H#* content here */H#*

    HEIGHT: The height attribute is used to designate the height in pixels of various elements such as images or table cells. It appears within the element beginning tag. Replace the "#" with your specific pixel dimensions.

    Code: HEIGHT="#"

    HORIZONTAL RULE: The horizontal rule tag is used to define a shaded line in your HTML page. It does not require an ending tag.

    Code: *HR*

    HORIZONTAL RULE (SOLID): The "noshade" attribute is used to designate a solid (rather than shaded) horizontal line in your HTML page. It does not require an ending tag.

    Code: *HR NOSHADE*

    HTML: This tag is part of the basic structure of an HTML coded page and indicates the type of document. The HTML tag must surround all HTML coding.

    Code: *HTML* content here */HTML*

    IMAGE: The image tag is used to display a separate file on the page, usually a JPEG or GIF. It consists of two parts: the image element designation and the source designation for the file to be displayed. See "LINK" for a description of how absolute and relative URLs may be coded. This tag does not utilize an ending tag. It is customary to designate the specific width and height (in pixels) of the image to be displayed as shown in the code example below. Replace the "#" sign with your specific pixel dimensions. Various other attributes such as border size and color may also be defined within the image tag.

    Code: *IMG SRC="image URL here" WIDTH="#" HEIGHT="#"*

    IMAGE RUN-AROUND: The run-around attribute tags are used to designate the runaround width or height or an image in pixels. Horizontal space is designated by "HSPACE" and the vertical space is designated by "VSPACE". Replace the "#" sign with your specific pixel dimensions.

    Code: *IMG SRC="image URL here" HSPACE="#" VSPACE="#"*

    ITALIC: The italic tag is used to display an italic version of the selected font. To maintain other text attributes, the font tag should be coded inside the italic tag as shown in the example.

    Code: *I**FONT* content here */FONT**/I*

    LINE BREAK: The line break tag is used to simulate a single space return on your HTML page and does not require an ending tag.

    Code: *BR*

    LINK: The link tag contains two parts: the element designation and the reference designation for the file to be linked. It can apply to text or images. In reference to the file to be linked, you can input the absolute URL beginning with "http://www..." or reference the URL relative to the displayed file using the forward slash (/) to indicate file directories. Three periods (...) may be used at the beginning of the URL to indicate a parent directory.

    Code: *A HREF="link URL here"* linked content here */A*

    LINK TARGET: The target attribute allows you to designate a specific window for the linked file to display in. It is included within the *A* beginning tag. If a target attribute is not added, the default designation is the currently open window. A common target is "blank", which opens the linked file in a new browser window.

    Code: *A HREF="link URL here" TARGET="BLANK"* linked content here */A*

HTML Tag Glossary

The series offers an on-going glossary of alphabetized HTML tags. Beginning with an overview of HTML and its correct syntax, it serves as a resource for learning how to code various HTML functions in your web pages.
  1. A Glossary of HTML Tags: Overview of HTML Code Syntax
  2. A Glossary of HTML Tags: A-F
  3. A Glossary of HTML Tags: G-M
  4. A Glossary of HTML Tags: N-S
  5. A Glossary of HTML Tags: T-Z