0% found this document useful (0 votes)
2 views

HTML_Interview_Questions

The document contains 100 HTML interview questions and answers, covering fundamental concepts such as HTML elements, the difference between HTML and HTML5, and the purpose of the DOCTYPE declaration. It also explains semantic elements, the distinction between id and class attributes, and how to create tables in HTML. Additionally, it discusses inline, block, and inline-block elements, making images responsive, and the purpose of the <meta> tag.

Uploaded by

yogeshdhote1805
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

HTML_Interview_Questions

The document contains 100 HTML interview questions and answers, covering fundamental concepts such as HTML elements, the difference between HTML and HTML5, and the purpose of the DOCTYPE declaration. It also explains semantic elements, the distinction between id and class attributes, and how to create tables in HTML. Additionally, it discusses inline, block, and inline-block elements, making images responsive, and the purpose of the <meta> tag.

Uploaded by

yogeshdhote1805
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

100 HTML Interview Questions and Answers

1. What is HTML?
HTML (HyperText Markup Language) is the standard language for creating web pages.

2. What are HTML elements?


HTML elements are the building blocks of web pages, consisting of a start tag, content, and an end
tag (e.g., <p>Hello</p>).

3. What is the difference between HTML and HTML5?


HTML5 introduced new semantic elements (<article>, <section>, <nav>), multimedia support
(<audio>, <video>), and form enhancements.

4. What is the purpose of the DOCTYPE declaration?


It tells the browser which version of HTML to use and ensures proper rendering.

5. What are semantic elements in HTML?


Elements like <header>, <footer>, <section>, and <article> provide meaning to the content.

6. What is the difference between id and class attributes?


'id' is unique and can be used only once per page. 'class' can be reused for multiple elements.

7. How do you create a table in HTML?


<table>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
</table>

8. What is the difference between inline, block, and inline-block elements?


Inline: Doesn't start on a new line, only takes as much space as needed (<span>, <a>). Block:
Starts on a new line, takes full width (<div>, <p>). Inline-block: Like inline but allows width and
height (<button>).

9. How can you make an image responsive?


Using CSS: img { max-width: 100%; height: auto; }

10. What is the purpose of the <meta> tag?


It provides metadata about the webpage (character set, viewport settings, SEO keywords).

You might also like