10 Most Important HTML Interview Questions & Answers

1.What is <!Doctype html> in HTML5?

Doctype stands for Document Type Declaration. It informs the web browser about the type and version of HTML used in building the web document. This helps the browser to handle and load it properly.

2. What is difference between div and span in HTML?

The <div> tag is a block level element.The <span> tag is an inline element.
It is best to attach it to a section of a web page.It is best to attach a CSS to a small section of a line in a web page.
It accepts align attribute.It does not accept align attribute.
This tag should be used to wrap a section, for highlighting that section.This tag should be used to wrap any specific word that you want to highlight in your webpage.

3. What is semantic tags and non semantic tags in HTML?

Semantic Elements
These elements simply mean, elements with meaning. The reason being, there definition in the code tells the browser and the developer what they are supposed to do. Framing in simpler words, these elements describe the type of content they are supposed to contain.

Following is the list of some semantic elements :

  • article
  • aside
  • details
  • figcaption
  • figure
  • footer
  • form
  • header
  • main
  • mark
  • nav
  • table
  • section

Non-Semantic elements
Unlike, semantic elements they don’t have any meaning. They don’t tell anything about the content they contain. They can be used with different attributes to mark up semantics common to a group.

Following is the list of some non-semantic elements:

  • div
  • span

4. What is difference between html and html5?

Mobile friendlinessHTML is less mobile friendlyHTML5 is more mobile friendly
Drag and Drop featureIt does not support drag and drop effects.It supports drag and drop effect
Media supportDoes not support audio and video without use of flash playerSupport Audio and Video with use of <audio> and <video> tag .
Javascript supportDoes not support javascript to run in browserSupport javascript to run in background with the help of JS – web worker API
Vector GraphicsHTML uses vector graphics with the help of various technologies such as VML, Flash, etc.Vector graphics is an important part of HTML5 as we use SVG and canvas in it.
Storage optionFor storage browser cache can be used as temporary storageFor storage Application cache, web SQL database, and web storage can be used in HTML5
Error HandlingHTML can not handle inaccurate syntax and any other error . Here inaccurate syntax means that the written syntax (order of tags ) is different from the original syntax . Example of basic syntax : <html> <head> <title> </title> </head> <body> </body> </html>HTML5 can handle inaccurate syntax and other errors.
2-D shapes drawingShapes like circle, rectangle, triangle, etc. are not possible to draw in HTMLShapes like circle, rectangle, triangle, etc. are easy to draw in HTML5 .’
Efficiency, speedAs it’s older version, it is not fast, efficient, and flexible with respect to HTML5.HTML5 is efficient , faster and flexible in comparison to HTML .
Browser supportMost old browsers support HTMLNew browsers support HTML5 such as Firefox, chrome etc.

5. What is Iframe tag in Html5?

An inline frame (iframe) is a HTML element that loads another HTML page within the document. It essentially puts another webpage within the parent page. They are commonly used for advertisements, embedded videos, web analytics and interactive content.

6. What are the formatting tags in html?

HTML Formatting is a process of formatting text for better look and feel. HTML provides us ability to format text without using CSS. There are many formatting tags in HTML. These tags are used to make text bold, italicized, or underlined. There are almost 14 options available that how text appears in HTML and XHTML.

In HTML the formatting tags are divided into two categories:

  • Physical tag: These tags are used to provide the visual appearance to the text.
  • Logical tag: These tags are used to add some logical or semantic value to the text.

7. What is difference <b> and <Strong> tag in html?

HTML <strong> Tag
The <strong> tag in HTML is the parsed tag and used to show the importance of the text. Make that text bold.


<strong> Contents... </strong>

HTML <b> Tag
The bold tag or <b> is also one of the formatting elements of HTML. The text written under <b> tag makes the text bold presentationally to draw attention.


<b> Contents... </b>

The main difference between these two tag is that the strong tag semantically emphasizes on the important word or section of words while the bold tag is just offset text conventionally styled in bold. Below is the code to show this difference.

8. What is view port attribute in html?

The viewport is the user’s visible area of a web page. The viewport varies with the device, and will be smaller on a mobile phone than on a computer screen. Before tablets and mobile phones, web pages were designed only for computer screens, and it was common for web pages to have a static design and a fixed size.

9. What is attribute in html?

An HTML attribute is a piece of markup language used to adjust the behavior or display of an HTML element. For example, attributes can be used to change the color, size, or functionality of HTML elements.

10. What is block level element and inline element in html?

In general, HTML elements can be divided into two categories : block level and inline elements.

Block Level Elements:

  • HTML block level elements can appear in the body of an HTML page.
  • It can contain another block level as well as inline elements.
  • By default, block-level elements begin on new lines.
  • block level elements create larger structures (than inline elements).

List of block level elements

  • p
  • h1, h2, h3, h4, h5, h6
  • ol, ul
  • pre
  • address
  • blockquote
  • dl
  • div
  • fieldset
  • form
  • hr
  • noscript
  • table

HTML Inline elements

  • HTML inline level elements can appear in the body of an HTML page.
  • It can contain data and other inline elements.
  • By default, inline elements do not begin on new lines.
  • inline elements create shorter structures (than block level elements).

List of inline elements

  • b, big, i, small, tt
  • abbr, acronym, cite, code, dfn, em, kbd, strong, samp, var
  • a, bdo, br, img, map, object, q, script, span, sub, sup
  • button, input, label, select, textarea

53 thoughts on “10 Most Important HTML Interview Questions & Answers”

  1. hello!,I love your writing very so much! percentage we keep in touch extra about your article on AOL? I need an expert in this house to unravel my problem. Maybe that is you! Having a look forward to see you.

  2. I just could not go away your web site prior to suggesting that I actually enjoyed the usual information a person provide on your visitors? Is going to be again ceaselessly to check out new posts

  3. Hi, Neat post. There’s a problem with your website in internet explorer, would test this… IE still is the market leader and a huge portion of people will miss your excellent writing because of this problem.

  4. hey there and thanks in your info – I’ve certainly picked up anything new from right here. I did then again experience a few technical points the usage of this web site, as I experienced to reload the web site lots of times previous to I may get it to load correctly. I had been pondering in case your web hosting is OK? No longer that I’m complaining, however slow loading circumstances instances will sometimes impact your placement in google and can damage your high quality score if ads and ***********|advertising|advertising|advertising and *********** with Adwords. Anyway I’m adding this RSS to my email and could glance out for a lot more of your respective intriguing content. Make sure you replace this once more soon..

  5. I must show appreciation to the writer just for bailing me out of this predicament. Just after looking out through the internet and getting methods which were not helpful, I assumed my entire life was gone. Existing without the presence of solutions to the problems you have solved through your post is a crucial case, and the kind which could have in a wrong way damaged my entire career if I hadn’t discovered your website. That ability and kindness in touching the whole thing was vital. I’m not sure what I would’ve done if I had not come upon such a point like this. It’s possible to now look ahead to my future. Thanks a lot so much for your high quality and effective guide. I won’t think twice to refer your web blog to anyone who needs and wants guidelines about this subject.

  6. Hi there! This post couldn’t be written any better! Reading this post reminds me of my old room mate! He always kept talking about this. I will forward this post to him. Fairly certain he will have a good read. Thanks for sharing!

  7. Hi, I think your site might be having browser compatibility issues. When I look at your website in Safari, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, fantastic blog!

  8. Youre so cool! I dont suppose Ive read anything like this before. So nice to seek out anyone with some authentic thoughts on this subject. realy thanks for starting this up. this website is one thing that is needed on the web, somebody with slightly originality. helpful job for bringing one thing new to the web!

  9. I was curious if you ever considered changing the page layout of your blog? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having 1 or two pictures. Maybe you could space it out better?

  10. Whats up very cool site!! Man .. Excellent .. Superb .. I’ll bookmark your web site and take the feeds additionallyKI am satisfied to seek out so many helpful information right here in the publish, we’d like work out extra strategies on this regard, thanks for sharing. . . . . .

  11. Thanx for the effort, keep up the good work Great work, I am going to start a small Blog Engine course work using your site I hope you enjoy blogging with the popular BlogEngine.net.Thethoughts you express are really awesome. Hope you will right some more posts.

  12. Good article and straight to the point. I don’t know if this is in fact the best place to ask but do you guys have any thoughts on where to hire some professional writers? Thanks in advance 🙂

  13. Very good blog! Do you have any tips for aspiring writers? I’m hoping to start my own site soon but I’m a little lost on everything. Would you suggest starting with a free platform like WordPress or go for a paid option? There are so many options out there that I’m totally confused .. Any tips? Thank you!


Leave a Comment

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker🙏.

Powered By
Best Wordpress Adblock Detecting Plugin | CHP Adblock