0% found this document useful (0 votes)
5 views2 pages

HTML Interview Questions Answers Formatted

This document provides a comprehensive list of HTML interview questions and answers, covering fundamental concepts such as HTML structure, tags, differences between HTML versions, and specific elements like <div>, <span>, and <meta>. It serves as a resource for understanding key HTML topics relevant for interviews. The content is organized in a structured format, making it easy to navigate through various questions.

Uploaded by

sukharama
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

HTML Interview Questions Answers Formatted

This document provides a comprehensive list of HTML interview questions and answers, covering fundamental concepts such as HTML structure, tags, differences between HTML versions, and specific elements like <div>, <span>, and <meta>. It serves as a resource for understanding key HTML topics relevant for interviews. The content is organized in a structured format, making it easy to navigate through various questions.

Uploaded by

sukharama
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

==================================================

HTML Interview Questions and Answers


==================================================

Table of Contents:
------------------
1. What is HTML?
2. What are HTML tags?
3. What is the difference between HTML and HTML5?
4. What are void elements in HTML?
5. What is the DOCTYPE declaration?
6. What is the difference between <div> and <span>?
7. What is the purpose of the <meta> tag?
8. What are semantic elements in HTML?
9. What is the difference between <link> and <a> tags?
10. What is the difference between id and class attributes?
...
50. What is the purpose of the <base> tag?

==================================================

### 1. What is HTML?


HTML (HyperText Markup Language) is the standard language used to create and design
web pages. It structures web content with elements like headings, paragraphs,
images, and links.

--------------------------------------------------

### 2. What are HTML tags?


HTML tags are keywords enclosed in angle brackets (<>) that define elements in an
HTML document. Example: <p> for paragraphs, <a> for links.

--------------------------------------------------

### 3. What is the difference between HTML and HTML5?


HTML5 is the latest version of HTML with new features like audio, video, canvas,
and improved support for mobile devices and accessibility.

--------------------------------------------------

### 4. What are void elements in HTML?


Void elements do not have closing tags and don’t contain content. Examples: <img>,
<input>, <br>.

--------------------------------------------------

### 5. What is the DOCTYPE declaration?


The DOCTYPE declaration specifies the HTML version used in the document. Example:
<!DOCTYPE html> (for HTML5).

--------------------------------------------------

### 6. What is the difference between <div> and <span>?


- <div>: Block-level container used to group elements. Takes full width.
- <span>: Inline container used to style parts of text.

--------------------------------------------------
### 7. What is the purpose of the <meta> tag?
Provides metadata like character set, viewport settings, and page description.
Example:
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

--------------------------------------------------

### 8. What are semantic elements in HTML?


Semantic elements clearly describe their meaning to browsers and developers.
Examples: <article>, <header>, <footer>, <section>.

--------------------------------------------------

### 9. What is the difference between <link> and <a> tags?


- <link>: Links external resources like CSS files.
- <a>: Creates hyperlinks to other web pages or sections.

--------------------------------------------------

### 10. What is the difference between id and class attributes?


- id: Uniquely identifies an element.
- class: Assigns the same style to multiple elements.

... (Truncated for brevity)

### 50. What is the purpose of the <base> tag?


Defines the base URL for relative links in the document. Example:
<base href="https://www.example.com/">
<a href="about.html">About Us</a> <!-- Links to https://www.example.com/about.html
-->

==================================================
End of Document.

You might also like