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.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more