Self-Closing Tag

Why Trust Techopedia

What Does Self-Closing Tag Mean?

A self-closing tag is an element of HTML code that has evolved in the language. Typically, the self-closing tag makes use of a “/” character in order to effectively close out a beginning tag enclosed in sideways carets.

Advertisements

Techopedia Explains Self-Closing Tag

The story of the self-closing tag has to do with the ways that HTML has been evolved throughout its use since the late 1980s. A conventional HTML tag had an opening tag and a closing tag. However, there are elements in HTML called void elements, such as images and links, that do not strictly require closing tags because of their inherent structure. Experts claim that things like images and links do not need and cannot have content – they are just kind of pointers to an element that is installed in the page.

In more recent variations of HTML such as XHTML, instead of including individual opening and closing tags, developers use a self-closing tag that includes a “/” within the carets: for example – <img src=img/circle alt=“” />

Now, with HTML 5, even that slash character is considered obsolete. W3C rules and other standards show that developers no longer need to include the character to indicate a closing tag, because it is understood that those void elements do not need any closing at all. Significant questions come up on sites around the Internet about how HTML and W3C standards deal with self-closing tag syntax.

Advertisements

Related Terms

Margaret Rouse
Technology expert
Margaret Rouse
Technology expert

Margaret is an award-winning writer and educator known for her ability to explain complex technical topics to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles in the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret’s idea of ​​a fun day is to help IT and business professionals to learn to speak each other’s highly specialized languages.