HTML Interview Questions

HTML Interview Questions | Freshers & Experienced

  • Calvin
  • 20th Nov, 2019
  • 301 Followers

HTML Interview Questions

Q1. What is HTML?

HTML (HyperText Markup Language), is a markup language that allows an individual to structure the web pages. It was first developed by Tim Berners-Lee in the year 1990.

Q2. What are Tags in HTML?

In HTML, tags are display instructions given to the browser what and how to display. When you write an HTML page, you enter tags for many reasons like to change the format of the text, to display graphics on the web page, or to make a link to another page. There are two types of tags available in HTML paired and singular.

Example of tags in HTML are <a>,<b>,<div>,<ul>,<ol>,<link>, etc

 

Q3. What is !DOCTYPE HTML?

The <!DOCTYPE> must be declared before the <html> tag. This is not an HTML tag; it indicates the version of HTML, which is used to write a webpage.

In HTML version 4.01, the <!DOCTYPE> declaration refers to a DTD (Document Type Definition) , because HTML 4.01 was based on SGML (Standard Generalized Markup Language) . The DTD specifies the rules for the markup language so that the browsers provide the content correctly.

Q4. Who is Father of HTML?

Tim Berners-Lee is known as the Father of HTML. He is a computer scientist, also known as the inventor of the World Wide Web.

Q5. Explain what is a Fieldset in HTML?

The <fieldset> tag is used to group all elements of a form. This is used to draw a box around the related elements.

Example:

<!DOCTYPE html><html><body><form><fieldset><legend>PersonalInformation:</legend><label>Name:</label><inputtype="text"name="name"><label>Email:</label><inputtype="text"name="email"><label>PhoneNo:</label><inputtype="text"name="phone"><label>DateofBirth:</label><inputtype="text"name="dob"></fieldset></form></body></html>

Q6. What use of image map in HTML?

In HTML, an image map is a list of coordinates relating to a specific image, created in order to hyperlink areas of the image to different destinations. The <map> tag is used to set a client-side image-map. An image-map includes an image with clickable areas.

Q7. What is grouping in HTML?

Grouping in HTML is a collection of related elements. Like fieldset, tag is used to group the form elements together. Another example of grouping is <ul> tag which groups its child elements <li> together.

Q8. What is SGML?

SGML (Standard Generalized Markup Language) is a standard for how to define a document markup language or tag set. Such a specification is itself (DTD) document type definition. SGML is not a document language, but a description of how to specify language like HTML. It is just like metadata.

Q9. What is the DOM?

DOM stands for Document Object Model. The HTML DOM specifies a standard way for accessing and manipulating HTML documents. It represents an HTML document as a tree-structure.

Q10. What are best tools for debugging HTML?

Below are the few best tools for debugging HTML

  • Firefox Developer Tools
  • Chrome Developer Tools
  • Web developer extension for Firefox
  • Safari Developer Tools
  • Fiddler

Q11. Enlist types of heading supported by HTML?

HTML consists of six levels of headings. A heading element shows all the font changes, paragraph breaks before and after, and any white space necessary to render the heading. H1, H2, H3, H4, H5, and H6 are the heading elements. H1 is the highest (or most important) level and H6 is the least important.

Q12. What is use of an iframe tag in HTML?

<iframe> tag is an inline markup that is used to embed another document within the current HTML document. It is supported by all major browsers like Mozilla, chrome, internet explorer, safari, opera.

Syntax

<iframe src="external-url"></iframe>

Q13. How to add multiline comments in HTML?

Writing comments in HTML code is good practice, in the complex documents they can use to indicate sections of documents. A comment will be ignored by any web browser. Comments help you and others to understand your code and to improves code readability.

HTML multiline comments are put inside <!-- ... --> tags. So, content placed within <!-- ... --> tags will be treated as a comment and will be completely ignored by the browser.

Example :

<!DOCTYPE html><html><body><!-- This is a comment --><p>This is a paragraph.</p><!-- Comments are not displayed in the browser --></body></html>

Result: This is a paragraph

Q14. Explain types of list elements avaialable in HTML?

In HTML there are two main types of list elements <ol> and <ul> which refers to ordered list and unordered list respectively. <li> ..</li> is used to insert list.

Example :

<!DOCTYPE html><html><body><p>Here is ordered and unordered list:</p><ol> Fruits name:<li> Apple </li><li> Mango </li><li> Banana </li></ol><ul> Vegetable name:<li> Tomato </li><li> Bringle </li><li> Spinach </li></ul></body></html>

Output:

Here is an ordered and unordered list:

    Fruits name:
  1. Apple
  2. Mango
  3. Banana
    Vegetable name:
  • Tomato
  • Bringle
  • Spinach
 

Q15. How to create mailto link in HTML?

Mailto link is a type of HTML link activates the default mail client on the computer for sending an e-mail. The web browser needs a default e-mail client software installed on the computer in order to activate the e-mail client.

If you have Microsoft Outlook, as your default mail client, pressing a mailto link will open a new mail window. The mailto link will be written like a regular link with extra parameters inside the href attribute:

Example

<a href="mailto:name@email.com">Link text</a>

The above creates a link and clicking that it will open the default email on the computer.

Q16. What is difference between UI and UX?

UX is an abbreviation of (User Experience), and UI is an abbreviation of (User Interface). UI is a subset of UX.

The three basic differences between UX and UI designers are:

  1. The purpose and functionality of the product decided by UX. And the quality of the interaction that the end-user has with the product decided by UI.
  2. UI design contains artistic component as it is related to the design and interfaces with the product. It affects what the end-user sees, hears, and feels. UX consists of more of a social component for market research and communicating with clients to understand what are their needs.
  3. UX focus on project management and analysis through the entire phase of ideation, development, and delivery. UI contains a technical component to produce the design components for the finished product.

Q17. What is use of <abbr> tag in HTML?

The <abbr> tag specifies an abbreviation or an acronym, like "HTML", "Mr.", "Dec.", "ASAP", "ATM".

Example:

<!DOCTYPE html><html><body><p>The <abbr title= "Hyper Text Markup Language ">HTML</abbr> was Invented in 1989.</p></body></html>

Output

The HTML was Invented in 1989.

Q18. What is recommended location to add external stylesheets in HTML?

Inside the <head> tag of an HTML page is recommended location to add external stylesheets in HTML. You can add external css using <link> tag.

Example

<!DOCTYPE html><html><head><link rel="stylesheet" type="text/css" href="mystyle.css"></head><body></body></html>

Q19. Enlist few basic elements of HTML?

The basic elements of an HTML page are:

  • Header tags : <h1>, <h2>, <h3>, <h4>, <h5>, <h6>
  • Paragraph tag: <p> </p>.
  • Horizontal ruler tag: <hr> inserts line between text.
  • Link tag: <a> (anchor) inserts link to other document.
  • List tags : <ul> (unordered list), <ol> (ordered list) and <li> (list element).
  • An image tag : <img>
  • A divider tag: <div>
  • A text span tag : <span>

Q20. What is use of <hr> tag in HTML?

<hr /> tag in HTML is used to insert a horizontal line.It is an empty tag.

About Author :

  • Author of HTML Interview Questions

    Calvin Carlo

    Calvin is a Senior web developer, a Javascript enthusiast, and a technical writer. He is very interested in learning new technologies and writing technical blogs on It. He loves playing Cricket, watching Hollywood action movies and is big fan of Michael Douglas.

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.