Top 10 basic HTML interview questions

Q1. What is HTML?

Ans. The HTML stands for Hyper Text Markup Language.This is a standard markup language for documents designed & display in a web browser. HTML contains a lots of elements which tells the browser how to display the content on browser.

Q2. What is an HTML Element?

Ans. An HTML element is a component of the HTML document that tells a web browser how to interpret & display a  HTML document. An HTML element is defined by a opening tag, some content, and an endind tag.

For Example:-

<h1>Welcome to Quiz For You.</h1>
<p>Here you will Lots of interview questions.</p>

Q3. What is the HTML Page Structure?

Ans. The HTML page structure is given below:-

<html>
	<head>
		<title>Page title</title>
	</head>
	<body>
		<h1>This is a heading</h1>
		<p>This is a paragraph.</p>
		<p>This is another paragraph.</p>
	</body>
</html>

Please note that the content inside the body tag will be shown on the browser. The content inside the title tag will be shown on the title bar of the browser or in the tab of the page.

Q4. Who makes the Web standards?

Ans. There is a central organization named The World Wide Web Consortium (W3C) who is responsible for creating and maintaining web standards.

Q5. List the HTML heading types?

Ans. There are mainly 6 HTML heading types that are defined with the h1 tag to h6 tag. Each type of heading tag displays different text sizes of the text. Out of these 6 type headings, the h1 tag is the largest heading tag and the h6 tag is the smallest heading tag. For example:-

<h1> This is a h1 Heading.</h1>
<h2> This is a h2 Heading.</h2>
<h3> This is a h3 Heading.</h3>
<h4> This is a h4 Heading.</h4>
<h5> This is a h5 Heading.</h5>
<h6> This is a h6 Heading.</h6>

The output of the above code is given below:-

This is a h1 Heading.

This is a h2 Heading.

This is a h3 Heading.

This is a h4 Heading.

This is a h5 Heading.
This is a h6 Heading.

Q6. How to create a hyperlink in HTML code?

Ans. To create hyperlinks the HTML provides an anchor tag that links one page to another page. The example is given below:-

<a href="http://quizforyou-in-216390.hostingersite.com/">Quiz For You</a>

The output of the above code is given below:-

Quiz For You

In above example code contains the link to this website. When you will click on Quiz For You text this will open the home page of this website.

Q7. List the HTML table tags name?
Ans. Table tags list is given below:-

Tag NameDescription
<table>This tag define HTML table structure
<thead>This tag group HTML table header headings
<tr>This tag defines HTML table row
<th>This tag is use to display table columns heading
<tbody>This tag group HTML table body content
<tfoot> This tag group HTML table footer headings

Q8. What are the attributes in HTML?

Ans. HTML attributes are special words that are used inside the opening tag to control the element’s behavior. The attributes provide some additional information about a particular element. The attributes are normally used in name/value pairs like name=”value”. For example:-

<a href="http://quizforyou-in-216390.hostingersite.com/" target="_blank">Quiz For You</a>

In the above example code, href & target are attributes and their value are given in inverted comma which tells the browser that the link is given in href attribute to be open in a new tab.

Q9. What is DOCTYPE in HTML?

Ans. Doctype stands for Document Type. It tells the browser about the document type. It helps the browser to handle and load it properly in the browser. The DOCTYPE should be declared in the first line of a webpage.

Q10. List some most useful HTML tags?

Ans. There are lots of useful HTML tags which help us to create beautiful web pages some of them are listed below:-

Tag NameDescription
<P>This tag is used to display content in paragraph format.
<a>This tag is used to link web pages with each other.
<img>This tag is used to insert images in the web pages.
<form>This tag is used to create forms on the web pages.
<input>This tag helps us to take user input in the form.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top