HTML Basic Interview Questions

 

Introduction to HTML

1. What is the full form of HTML?

HTML stands for Hypertext Markup Language.


2. What are HTML Elements?

HTML Elements are the building blocks of HTML that describe the structure and content of a web page.

They generally consist of a start tag, content, and end tag.

Syntax:

<tag>Content</tag>
HTML

3. What is the structure of an HTML document?

The basic structure of an HTML document:

<!DOCTYPE html>
<html>
<head>
Metadata elements
</head>
<body>
Document Content
</body>
</html>
HTML

The HTML

head
element consists of HTML elements that define the metadata of an HTML document and the HTML
body
element consists of the content that should be displayed on the web page.


4. What is the extension of an HTML file?

The extension of an HTML file is .html


5. What are the differences between HTML Tags and HTML Elements?

HTML TagsHTML elements
Tags are the starting and ending parts of an HTML element. They begin with 
<
 symbol and end with 
>
 symbol.
It generally consists of a start tag, content, and an end tag.
Ex:- Start tag: 
<p>
<h1>
, End tag: 
</p>
</h1>
Ex:- 
<p>Paragraph</p>
<h1>Heading</h1>

6. What are the uses of HTML?

Some of the uses of HTML are:

  • Structuring web pages: With HTML elements, we can define the headings, paragraphs, and other contents of a web page. Without HTML elements, the text on the webpage would all look the same.
  • Creating Hyperlinks: With Hyperlinks, we can navigate within the HTML document, to other web pages, etc.
  • Embedding images and videos: With HTML elements, we can embed images and videos in the HTML document.

7. What is HTML?

HTML (Hypertext Markup Language) is the standard markup language for creating Web pages.

  • It describes the structure of a Web page.
  • It consists of HTML elements that tell the browser how to display the content.

8. What are the types of tags in HTML?

Paired Tags: Paired tags consist of two tags, the first one is called a start tag and the second one is called an end tag.

Examples:

<h1>Heading</h1>
,
<p>Paragraph</p>
, etc.

Unpaired Tags: Unpaired tags do not have an end tag. They are also known as empty tags.

Examples:

<img src="image.png"/>
,
<br/>
, etc.


9. What are the important parts of an HTML document?

An HTML document generally consists of three parts:

  • A line containing HTML version information.
  • A declarative head element.
  • A body, which contains the document's actual content.

10. Can we design dynamic web pages using HTML?

No, we can't design dynamic web pages with HTML alone.

By Combining HTML with JavaScript, we can create dynamic web pages.


11. What is the use of doctype?

The

doctype
declaration tells the type/version of the HTML document to the browser.

This ensures that the HTML document is rendered in different browsers in the same and expected way.

Example:

<!DOCTYPE html>
<html>
<head></head>
<body>
<h1>Tourism</h1>
</body>
</html>
HTML

12. What is nested HTML?

HTML elements can be nested.

It means that the HTML element can be placed inside another HTML element.

Example:

<div>
<h1>Tourism</h1>
<p>Plan your trip.</p>
</div>
HTML


Post a Comment

Please Select Embedded Mode To Show The Comment System.*

Previous Post Next Post

Contact Form