Semantic elements are HTML elements that carry inherent meaning or convey a specific purpose within the structure of a web page.
Semantic elements provide clear meaning to both browsers and developers about the content they contain.
For instance, while non-semantic elements like <div>
and <span>
lack inherent meaning about their content, semantic elements such as <form>
, <table>
, and <article>
clearly define the type and purpose of their content.
Numerous websites utilize HTML code such as <div id="nav">
, <div class="header">
, and <div id="footer">
to designate navigation, header, and footer sections.
HTML offers semantic elements specifically designed to delineate various components of a webpage.