HTML5 Interview Questions and Answers for 2 years experience

HTML5 Interview Questions and Answers
  1. 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 `
      `, `
  2. 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.
  3. 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 `
      `, `
  4. 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 ``.
  5. 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 `