DEV Community

Lal Sahab Yadav
Lal Sahab Yadav

Posted on

HTML Interview Questions and Answers for Freshers

This guide dives into HTML interview questions and answers for freshers, along with clear and concise answers to help you shine.

Image description

Q1. What is HTML?
Ans: HTML stands for HyperText Markup Language. It’s the foundation for creating webpages, defining the structure and content.

Q2. Explain the difference between HTML tags and elements.
Ans: Tags (like

) are opening and closing instructions. Elements encompass the tags and their content (like

This is a paragraph

).

Q3. What are some common HTML attributes?
Ans: Attributes provide additional information to tags, like id for unique identification and class for applying styles.

Q4. How do you create headings in HTML?
Ans: Use

to

tags for different heading levels,

being the most important.

Q5. How do you create a bulleted or numbered list?
Ans: Use

    for unordered (bulleted) lists and
      for ordered (numbered) lists, with
    1. for each list item.

      Q6. How do you add images to your webpage?
      Ans: Use the tag with the src attribute specifying the image source.

      Q7. What is the alt attribute used for in the tag?
      Ans: The alt attribute provides alternative text for the image, displayed if the image can’t load or for accessibility purposes.

Top comments (0)