answersLogoWhite

0

What function does a tag serve?

User Avatar

Anonymous

8y ago
Updated: 11/28/2021

An HTML tag delineates the beginning and end of an HTML element. The data contained in that element is supposed to be somehow related. In HTML 4 & 5, some elements only have one tag, for instance the image element:

<img src="example.gif" alt="Fun Example">

Most other elements have two tags, one that opens the element, and one that closes it.

<p>This is a paragraph. It could contain an image, if we wanted it to.</p>

In XHTML, all the elements close. Elements like the image tag use an XML pattern called "self-closing."

<img src="example.gif" alt="Fun Example" />

User Avatar

Kennith Lockman

Lvl 10
3y ago

What else can I help you with?