Top 10 HTML Interview Questions with Answers
1. What is HTML?
HTML stands for HyperText Markup Language. It is the standard markup language used to create web
pages.
2. What are HTML tags?
HTML tags are used to define elements in a web page. Tags are enclosed in angle brackets like <p>, <div>,
etc.
3. What is the difference between HTML and HTML5?
HTML5 is the latest version of HTML with new features like audio, video support, semantic elements, and
more APIs.
4. What is a semantic tag in HTML?
Semantic tags clearly describe their meaning to both the browser and the developer, like <article>, <section>,
<header>, <footer>.
5. What is the use of the <doctype> declaration?
<!DOCTYPE> declares the document type and version of HTML being used. It helps the browser to render
the page correctly.
6. What are void elements in HTML?
Void elements are HTML elements that do not have closing tags, like <br>, <img>, <hr>, <input>.
7. How do you insert an image in HTML?
You can insert an image using the <img> tag with src and alt attributes: <img src='image.jpg'
alt='Description'>
8. What is the difference between <id> and <class> in HTML?
id is unique and used for a single element. class can be used for multiple elements.
9. What is the use of the <meta> tag in HTML?
<meta> tag provides metadata about the HTML document, like character set, author, and viewport settings.
10. What are the different types of lists in HTML?
HTML supports three types of lists: ordered list (<ol>), unordered list (<ul>), and description list (<dl>).