Top HTML Interview Questions and Answer 2022

Spread the love

Top HTML Interview Questions and Answer 2022: The full name of HTML is Hypertext Markup Language. The requirements of HTML language are very important for creating a website to design a website. It is never possible to create a website without HTML code, so HTML is called the “Mother Tongue” of the website.

HTML Editor is used to create an HTML file. For example, Notepad is an HTML editor. Like every file, the HTML final has an extension name. That is “.html“.

Also Read: Top php Interview Questions and Answer 2022

HTML is a client-side programming language. Which runs in client side browsers. And displays the data. No logical operational work can ever be done using HTML code. A html file contains HTML code, CSS code, JavaScript, text and images.

Like other software and programming languages, there are many newer versions of HTML. HTML is always up to date. The most latest version HTML are – html 1.0, html 2.0, html 3.2, html 4.01 and xhtml.

It is never possible to display any data in a browser without HTML code. For example, if a text has to be displayed in a browser, then HTML code is required or HTML code is required to display an image file on display.

Top HTML Interview Questions and Answer

In today’s article we will know some of the main HTML related questions and answers asked in HTML interviews. HTML, like all other programming languages, has a lot of queries. But we will discuss some of the most important HTML related questions and answers asked in HTML interviews.

#1 What is the full name of html?

The full name of HTML is Hypertext Markup Language. HTML is also called the “Mother Tongue” of the website.

#2 What is the extension name of the html file?

The HTML code extension name is- “.html”. When we look at a file extension name “.html”, we understand that it is a HTML file.

#3 Where the html file is created?

HTML files are created in the HTML Editor. For example – Notepad, currently used many update HTML editors (Notepad ++).

#4 How html code starts and ends?

The html code starts and ends like- <html> — Here your html codes —</html>. For Example –

<!DOCTYPE html>
<html>
<body>

<h1>Welcome to Blogging Post</h1>
<p>My first Web Page</p>

</body>
</html>

<!DOCTYPE html>” This code is used to indicate what kind of file it is. For example, since we are using HTML code here, HTML is specified here <!DOCTYPE html>.

<html>” This is an HTML tag. Guys, one thing we need to keep in mind is that when we open a tag in HTML, we must close it, otherwise there may be discrepancies in HTML programming.

Also read: CSS Interview Questions and Answers 2022

Here you can see that we have opened the HTML tag and closed it again below. Like <html> — data here </html>. Another example is – we have opened the body tag in this coding and closed that body tag below. Like – <body> — All data here — </body>.

So friends, in a word, when an HTML tag is opened in an html file, the truck must be closed in the right place.

#5 Will support CSS code in html file?

Yes, HTML file will support CSS code. We can use all kinds of CSS code in a html file as per our requirement. For example –



<!DOCTYPE html>
<html>
<body>

<center>
<h1>Welcome to Blogging Post</h1>
</center>

<style>
.test{
     test-size:22px;
     color:red; 
     }
</style>

<div class='test'> We can used all types html code in a html file </div>

</body>
</html>
Will support CSS code in html file

#6 What is the function of “<b>” in HTML files?

This “<b>” code is used to show a text or line in bold on a web page. This code is called “bold tag“. For example –

<!DOCTYPE html>
<html>
<body>

<b>Welcome to Blogging Post</b> // Result - Welcome to Blogging Post

</body>
</html>

If you want, you can add this code to your HTML file, save it and run it. You will see the result. The Result will display like that – Welcome to Blogging Post. Top HTML Interview Questions and Answer.

#7 What is the function of “<u>” in HTML files?

This “<u>” code is used for underline under the text or line in a web page. This code is called “underline tag“. For example –

<!DOCTYPE html>
<html>
<body>

<u>Welcome to Blogging Post</u> // Result - Welcome to Blogging Post

</body>
</html>

You want, you can add this code to your HTML file, save it and run it. You will see the result. The Result will display like that – Welcome to Blogging Post.

#8 What is the function of “<i>” in HTML files?

This “<i>” code is used for italic the text or line in a web page. This code is called “italic tag“. For example –

<!DOCTYPE html>
<html>
<body>

<i>Welcome to Blogging Post</i> // Result - Welcome to Blogging Post

</body>
</html>

If You want, you can add this code to your HTML file, save it and run it. You will see the result. The Result will display like that – Welcome to Blogging Post.

#9 What is the function of “<h>” in HTML files?

This “<h>” code is used for Heading the text or line in a web page. This code is called “Heading tags“. For example

<!DOCTYPE html>
<html>
<body>

<center> 

<h1>Welcome to Blogging Post</h1>

</center>

</body>
</html>

#10 How many <H> tags are there in HTML?

There are 6 level is <h> tag used in HTML code. Like – <h1>, <h2>, <h3>, <h4>, <h5> and <h6>, For example –

<!DOCTYPE html>
<html>
<body>

<center> 

<h1>Welcome to Blogging Post</h1> <br />
<h2>Welcome to Blogging Post</h2> <br />
<h3>Welcome to Blogging Post</h3> <br />
<h4>Welcome to Blogging Post</h4> <br />
<h5>Welcome to Blogging Post</h5> <br />
<h6>Welcome to Blogging Post</h6> <br />

</center>

</body>
</html>

<h1> used for main Heading and and others are used for Sub-Heading. You can use it as per your requirement. If You want, you can add this code to your HTML file, save it and run it. You will see the result. Top HTML Interview Questions and Answer.

Also Read: Make IFSC Details Website Using API and PHP – AdSense Earn money

#11 What is the function of “<br>” in HTML files?

“<br>” It is used when a line break is needed in the middle of a sentence or when a sentence needs to be broken. It is used in HTML files. It`s called “Line Break element”. For Example –

<!DOCTYPE html>
<html>
<body>

<center> 

<h1>Welcome to Blogging Post</h1> <br />
<h2>Welcome to Blogging Post</h2> <br />
<h3>Welcome to Blogging Post</h3> <br />
<h4>Welcome to Blogging Post</h4> <br />
<h5>Welcome to Blogging Post</h5> <br />
<h6>Welcome to Blogging Post</h6> <br />

</center>

</body>
</html>
html h tage

#12 What is the function of “<footer>” in HTML files?

The bottom of a web page of a website is called a footer. This “<footer>” tag indicates a folder option. When we create a website or a web page, we must use this footer tag.

#13 What is the function of “<header>” in HTML files?

“<header>” This tag is used at the top of the web page of the website. Here is some important information about the website. For example – website webpage titles, descriptions, canonical links, authorship names, etc.

“<header>” tag Plays a very important role in SEO of a web page. The entire SEO of the website is done using it. Also important JavaScript codes are added to this header tag.

<!DOCTYPE html>
<html>

<header>   
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
   
    <!-- Website Title -->
    <title>Your Web site title</title>
	
    <!-- SEO Meta Tags -->
    <meta name="description" content=" ">
    <meta name="keywords" content=" ">
    <link rel="canonical" href="https://www.yourwebsite.com/">
    <meta name="author" content=" ">
</header>  

<body>
<center> 
<h1>Welcome to Blogging Post</h1> <br />
<h2>Welcome to Blogging Post</h2> <br />
<h3>Welcome to Blogging Post</h3> <br />
<h4>Welcome to Blogging Post</h4> <br />
<h5>Welcome to Blogging Post</h5> <br />
<h6>Welcome to Blogging Post</h6> <br />
</center>
</body>

</html> 

#14 What is the function of “<body>” in HTML files?

This “<body>” tag codes work for all the topics you want to add to the website. That is, depending on the content of your website you are building, Those are the things that are added to this tag. For example –

<body> Blogging Post, We are one of the best website for Different types of Articles, Like Education, Insurance, loan, Cryptocurrency, Tips & Tricks and more, Guidance and helping everyone with sharing awesome article daily.</body>

#15 What is the function of “<nav>” in HTML files?

This <nav> tag is used for Navigation link. This code is used in the menu bar of a website. This is called nav for short.

#16 What is the function of “<audio>” in HTML files?

When we need to add audio in our website or webpage, then we used this audio tag. This tag is only used to add audio, for example .mp3 audio, .ogg audio.

<audio controls>
  <source src="your-audio.ogg" type="audio/ogg">
  <source src="your-audio.mp3" type="audio/mp3">
</audio>

#17 What is the function of “<video>” in HTML files?

When we need to add Video in our website or webpage, then we used this video tag. This tag is only used to add audio, for example .mp4 video, .ogg video.

<video width="320" height="240" controls>
  <source src="your-video.mp4" type="video/mp4">
  <source src="your-video.ogg" type="video/ogg">
</video>

#18 How to add an image to an HTML file?

<img> tags are used to add images to HTML pages, It is never possible to display an image on an HTML web page without this tag. for example –

<img src='here-your-images' height='100px'  width='100px'> 

like -

<img src='bloggingpost.jpg' height='100px'  width='100px'>

Using this image tag, it is possible to display all kinds of image formats with HTML code in a web browser, for example – .jpge, .jpg, .png and .gif

<img src='bloggingpost.jpg'  height='100px'  width='100px'>
<img src='bloggingpost.jpge' height='100px'  width='100px'>
<img src='bloggingpost.png'  height='100px'  width='100px'>
<img src='bloggingpost.gif'  height='100px'  width='100px'>

#19 We can add JavaScript in html?

Yes, We can. We can use all kinds of JavaScript code with HTML. A website needs enough JavaScript to design well. A beautiful website enhances the user experience and is attracted that user to the website.

#20 A html file can run php code?

No it’s not possible. HTML code is not able to run php code because php is server-side programming language and HTML is client side programming language. Server is not required to run HTML code, but server is required to run php, hence called php server-side language.

But in php file we can run effortlessly HTML code. Because the php file is capable of running all the tags in the HTML

So Friends, Those who are web site developers or designers must put these codes in the right place. Those who are experienced developers or are in web design can understand by looking at the code. But those who are new to web design must use these shots. Because there are some rules for creating a website. These rules should be followed.

Because many times it may be that the programmer who designed the website is not able to update the website for some reason. Then another new programmer is needed. At that time, it is not difficult for the programmer to understand where the matter is, That’s why there are some rules that must be used when designing a website.

The last few words

There are many questions related to HTML but in this article we have discussed some of the questions that are most common in HTML interviews.

I hope you enjoyed today’s article. Please share it with your family and friends. If you have any problem with this article, please let us know in the comment box. We will try to resolve your comment as soon as possible.


Spread the love

Leave a Comment