HTML Interview Questions and Answers for internship

100 HTML Internship Interview Questions and Answers
  1. What is HTML?

    • Answer: HTML stands for HyperText Markup Language. It's the standard markup language for creating web pages and web applications. It uses tags to structure content, such as headings, paragraphs, images, and links.
  2. What is the difference between HTML and HTML5?

    • Answer: HTML5 is the latest version of HTML, introducing new semantic elements (like `
      `, `
  3. Explain the Document Object Model (DOM).

    • Answer: The DOM is a programming interface for HTML and XML documents. It represents the page so that programs can access and change the content, structure, and style of a document. It's a tree-like representation of the page's elements.
  4. What are semantic HTML elements? Give examples.

    • Answer: Semantic HTML elements clearly describe their meaning to both the browser and the developer. Examples include `
      `, `
  5. Explain the difference between `

    ` and `` elements.

    • Answer: `
      ` is a block-level element, meaning it takes up the full width available. `` is an inline element, meaning it only takes up as much width as necessary. `
      ` is used for structural elements, while `` is used for styling or manipulating smaller parts of text within a line.
  6. How do you create a hyperlink in HTML?

  7. How do you create an image in HTML?

    • Answer: Using the `` tag. The `src` attribute specifies the image URL, and the `alt` attribute provides alternative text for accessibility.
  8. What is the purpose of the `alt` attribute in the `` tag?

    • Answer: The `alt` attribute provides alternative text for images. This is crucial for accessibility, as it allows screen readers to describe the image to visually impaired users. It also helps with SEO.
  9. How do you create a list in HTML? Give examples of ordered and unordered lists.