HTML5 Interview Questions and Answers for 2 years experience
-
What is HTML5 and what are its key features?
- Answer: HTML5 is the fifth and current major version of HTML, the core markup language of the World Wide Web. Its key features include semantic elements (like `
`, `
- Answer: HTML5 is the fifth and current major version of HTML, the core markup language of the World Wide Web. Its key features include semantic elements (like `
-
Explain the difference between `DOCTYPE` and `` tags.
- Answer: The `` declaration is not a tag; it's a document type declaration that tells the browser which version of HTML the document uses, enabling standards mode rendering. The `` tag is the root element of an HTML page; it encompasses all other elements.
-
What is semantic HTML and why is it important?
- Answer: Semantic HTML uses elements that clearly describe their meaning to both the browser and developers. Examples include `
`, `
- Answer: Semantic HTML uses elements that clearly describe their meaning to both the browser and developers. Examples include `
-
How do you embed an external stylesheet and a JavaScript file in an HTML document?
- Answer: External stylesheets are linked using the `` tag within the `` section: ``. External JavaScript files are linked using the ``.
-
Explain the difference between inline, internal, and external stylesheets.
- Answer: Inline styles are applied directly to an element using the `style` attribute. Internal stylesheets are defined within the `