Join Regular Classroom : Visit ClassroomTech

HTML Interview Questions – Beginner Level | Codewindow.in

1. What is HTML?

The full form of HTML stands for Hypertext Markup Language and it also allows the user to create and structure sections, paragraphs, headings, links, and blockquotes for web pages and applications.

2. What are tags and attributes in HTML?

Tags are the primary component of the HTML that defines how the content will be structured/formatted, whereas Attributes are used along with the HTML tags to define the characteristics of the element.
For example, <p align=” center”>Interview questions</p>, in this the ‘align’ is the attribute using which we will align the paragraph to show in the center of the view.

3. What are different types of lists in HTML?

There are 3 types of lists in HTML.
<ul> – This is used for unordered lists (Generally uses ‘bullet’ as a marker).
<ol> – This is used for ordered lists (Generally uses ‘numbers’ as a marker).
<dl> – This is used for description or definition lists (Generally uses ‘dash’ as a marker).

4. What is formatting in HTML?

HTML formatting is a process of formatting the text for a better look and feel. It uses different tags to make text bold, italicized, underlined.

5. How many types of heading does an HTML contain?

The HTML contains six types of headings which are defined with the <h1> to <h6> tags. Each type of heading tag displays different text size from another. So, <h1> is the largest heading tag and <h6> is the smallest one.

C QA

Mostly Asked

DS QA

Mostly Asked

DBMS QA

Mostly Asked

ML QA

Mostly Asked

6. What is the ‘class’ attribute in HTML?

The class attribute is used to specify the class name for an HTML element. Multiple elements in HTML can have the same class value. Also, it is mainly used to associate the styles written in the stylesheet with the HTML elements. In stylesheet, we use ‘.class_name’ to point a specific class.

7. What is the difference between the ‘id’ attribute and the ‘class’ attribute of HTML elements?

Multiple elements in HTML can have the same class value, whereas a value of id attribute of one element cannot be associated with another HTML element.

8. How to create a hyperlink in HTML?

The HTML provides an anchor tag (<a>…</a>) to create a hyperlink that links one page to another page. These tags can appear in any of the following ways:
Unvisited link – It is displayed, underlined and blue.
Visited link – It is displayed, underlined and purple.
Active link – It is displayed, underlined and red.

9. What is the difference between <strong>, <b> tags and <em>, <i> tags?

The effect on a normal webpage of the tags <strong>, <b> and <em>, <i> is the same. <b> and <i> tags stands for bold and italic. These two tags only apply font styling and bold tag <b>, just adds more ink to the text, these tags don’t say anything about the text.

Whereas, <strong> and <em> tags represent that the span of text is of strong importance or more importance and emphatic stress respectively than the rest of the text. These tags have semantic meaning.

10. Difference between link tag <link> and anchor tag <a>?

The anchor tag <a> is used to create a hyperlink to another webpage or to a certain part of the webpage and these links are clickable, whereas, link tag <link> defines a link between a document and an external resource and these are not clickable.

11. What are empty elements?

HTML elements with no content are called empty elements. For example: <br />, <hr /> etc. They are also called self-closing elements.

12. What is the use of a span tag? Give one example.

The span tag is used for following things:

  • For adding color on text

  • For adding background on text

  • Highlight any color text

13. Which type of video formats are supported by HTML5?

HTML 5 supports three types of video format:

  • mp4

  • WebM

  • Ogg

14. What are Semantic Elements?

Semantic elements are those which describe the particular meaning to the browser and the developer. Elements like <form>, <table>, <article>, <figure>, etc., are semantic elements.

15. What is the difference between “display: none” and “visibility: hidden”, when used as attributes to the HTML element.

When we use the attribute “visibility: hidden” for an HTML element then that element will be hidden from the webpage but still takes up space. Whereas, if we use the “display: none” attribute for an HTML element then the element will be hidden, and also it won’t take up any space on the webpage.

Categories
Recent Posts
Pages