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.
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.
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).