HTML Concepts: Kinds of Elements
Published on May聽31, 2023, filed under development, html. (Share this post, e.g., on Mastodon.)
There are six (not two, five, or eight) different kinds of elements in HTML:
- Void elements:
area,base,br,col,embed,hr,img,input,link,meta,source,track, andwbr - Raw text elements:
scriptandstyle - Escapable raw text elements:
textareaandtitle - The template element:
template - Foreign elements: elements from the MathML and SVG namespaces
- Normal elements: all other allowed HTML elements
This classification is useful because these elements differ in key aspects. Void elements have no contents (they have no end tag, even if we wanted one). The template element contains template contents. MathML and SVG relate to different specifications (and may therefore not even be counted as HTML elements).
As always (consider the Web Developer鈥檚 Pilgrimage), the HTML specification has the details: 搂聽13.1.2 Elements. And this is part of a series: more HTML concepts.
About Me
I鈥檓 Jens (long: Jens Oliver Meiert), and I鈥檓 an engineering lead, guerrilla philosopher, and indie publisher. I鈥檝e worked as a technical lead and engineering manager at various companies (e.g., Google); I鈥檓 an active web and tool developer (code optimization, digital defense), a contributor to web standards (like HTML, CSS, WCAG), and a book author (O鈥橰eilly, Frontend Dogma).
I love trying things鈥攊n web development and engineering management, but also in politics and philosophy, where I hold to one idea in particular: that we can only be well if we take good care of everyone. Here on meiert.com I talk about some of my perspectives and experiences. (Interpret charitably but be critical鈥攁nd share feedback and advice that makes my work better.)
