HTML interview question

What are semantic and non-semantic elements?

Answer

  • Semantic elements: clearly describes its meaning to both the browser and the developer. For example: <form>, <table>, <article>, <aside>, <details>, <figcaption>, <figure>, <footer>, <header>, <main>, <mark>, <nav>, <section>, <summary>, <time> clearly defines its content.
  • Non-semantic elements: <div> and <span> tells nothing about its content.

More Technical Interview Topics