Top 10 HTML Interview Questions And Answers

Nov 11, 2019 Eduardo Zambrano

What is HTML?

  • Html stands for Hypertext markup language
  • HTML is the language of the world wide web and is used to create a website.
  • HTML defines the structure of the webpage using markup.
  • The elements in HTML are represented by tags.
  • Html documents are made up of two things: Tags and content

What are Tags in HTML?

  • Contents are placed between HTML tags to format it.
  • HTML tags comes in pairs like <tag_name> amd </tag_name> (Eg. <p>This is a paragraph</p>).
  • The first tag in a pair is start tag (or opening tag) and the last tag in pair is the last tag (or closing tab).

Is there any pair they do not come in pair?

  • Yes. There are some tags they do not come in pair. Examples include <img> tag and <b> tag.

What are HTML Documents?

  • All HTML pages are starting with a document type declaration (<!DOCTYPE html>).
  • The HTML document itself begins with <html> and </html>
  • The visible part of the body will be inside <body> and </body>

How to insert a comment in HTML?

  • <!-- This is a comment -->

How do we set style in HTML Tag?

  • The style in the HTML tag can be done using style tag.
  • <name_of_the_tag style style="property:value;"></name_of_the_tag>

What are the different formating of HTML Text?

  • HTML uses elements like <strong>,<b>,<i> to format text.
  • Formating is used to display different styles of text.
    • <b> - This is Bold text
    • <i> - This is itallic text
    • <em> This is Emphasized text
    • <mark> - This is marked text
    • <strong> - This is important text
    • <del> This is deleted text
    • <sub> This is subscript text
    • <sup> This is superscript text
    • <ins> This is inserted text

What is the purpose of <br> tag?

  • <br> tag is used to seperate lines of text and also to seperate sections of text.

Is there any other tag to separate sections of text other than <br>?

  • Yes. <p> tag and <blockquote> can be used to separate sections of text.

What are the different types of lists in HTML?

  • Ordered list
  • Unordered list
  • Description Lists
  • Nested HTML Lists
  • Directory List
  • Menu List

Can a hyperlink apply only for text only?

  • No. Hyperlink can apply for images too as well as text.