Difference between semantic and non-semantic elements Last Updated : 15 Jul, 2025 Comments Improve Suggest changes 13 Likes Like Report Semantic HTML elementsThese semantic elements simply mean, elements with meaning. The reason being, there definition in the code tells the browser and the developer what they are supposed to do. Framing in simpler words, these elements describe the type of content they are supposed to contain. Following is the list of some semantic elements: articleasidedetailsfigcaptionfigurefooterformheadermainmarknavtablesectionExample: This example shows the use of semantic elements. html <!DOCTYPE html> <html> <head> <title>my web page</title> <style type="text/css"> h1 { color: green; font-weight: bold; } table, tr, td { border: 1px solid black; } th { font-weight: bold; color: red; } </style> </head> <body> <article> <h1>GeeksforGeeks</h1> <p>A Computer Science Portal for Geeks</p> </article> <table> <tr> <th>head1</th> <th>head2</th> </tr> <tr> <td>A</td> <td>0</td> </tr> <tr> <td>B</td> <td>1</td> </tr> </table> </body> </html> Output: Non-Semantic elements Unlike, semantic elements they don't have any meaning. They don't tell anything about the content they contain. They can be used with different attributes to mark up semantics common to a group. Following is the list of some non-semantic elements: divspanExample: This example shows the use of non-semantic elements. html <!DOCTYPE html> <html> <head> <title>my web page</title> <style type="text/css"> span { color: green; font-size: 40px; font-weight: bold; } </style> </head> <body> <div> <span>GeeksForGeeks</span> <br> A computer science portal for geeks </div> </body> </html> Output: Difference between semantic and non-semantic elementsSemantic elements Non-Semantic elementsThey have meaningThey don't have meaningThey describe how the content within them is supposed to behaveThey can contain anythingThey have specific attributes for their structureThe 'class' attribute can be used to work with their structure Create Quiz Comment V vanshikagoyal43 Follow 13 Improve V vanshikagoyal43 Follow 13 Improve Article Tags : Web Technologies HTML HTML-Basics HTML-Misc HTML-Questions +1 More Explore HTML BasicsHTML Introduction4 min readHTML Editors4 min readHTML Basics7 min readStructure & ElementsHTML Elements4 min readHTML Attributes7 min readHTML Headings3 min readHTML Paragraphs3 min readHTML Text Formatting4 min readHTML Block and Inline Elements3 min readHTML Charsets4 min readListsHTML Lists3 min readHTML Ordered Lists5 min readHTML Unordered Lists4 min readHTML Description Lists3 min readVisuals & MediaHTML Colors11 min readHTML Links Hyperlinks2 min readHTML Images7 min readHTML Favicon4 min readHTML Video4 min readLayouts & DesignsHTML Tables9 min readHTML Iframes4 min readHTML Layout4 min readHTML File Paths3 min readProjects & Advanced TopicsHTML Forms4 min readHTML5 Semantics5 min readHTML URL Encoding4 min readHTML Responsive Web Design11 min readTop 10 Projects For Beginners To Practice HTML and CSS Skills8 min readTutorial ReferencesHTML Tags - A to Z List5 min readHTML Attributes Complete Reference8 min readHTML Global Attributes5 min readHTML5 Complete Reference8 min readHTML5 MathML Complete Reference3 min readHTML DOM Complete Reference15+ min readHTML DOM Audio/Video Complete Reference2 min readSVG Element Complete Reference5 min readSVG Attribute Complete Reference8 min readSVG Property Complete Reference7 min readHTML Canvas Complete Reference4 min read Like