HTML - Interview Questions & Answers
1. What is HTML?
HyperText Markup Language, commonly referred to as HTML, is the standard markup language used to create web pages. It is the dominant markup language for creating websites and anything that can be viewed in a web browser. It is written in the form of HTML elements consisting of tags enclosed in angle brackets (like <html>).
2. What are tags?
Content is placed in between HTML tags 0in order to properly format it. It makes use of the less than symbol < and the greater than symbol >. A slash symbol is also used as a closing tag. For example:
3. What are differences between DIV and SPAN?
The difference between SPAN and DIV is that a span element is in-line and usually used for a small chunk of HTML inside a line (such as inside a paragraph) whereas a div (division) element is block-line (which is basically equivalent to having a line-break before and after it) and used to group larger chunks of code.\
4. What is the difference between HTML elements and tags?
HTML elements communicate to the browser how to render text. When surrounded by angular brackets <> they form HTML tags. For the most part, tags come in pairs and surround text.
5. What does DOCTYPE mean?
The term DOCTYPE informs the browser which type of HTML is used on a webpage. In turn, the browsers use DOCTYPE to determine how to render a page. Failing to use DOCTYPE or using a wrong DOCTYPE may load your page in Quirks Mode. See example:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
6. How do you insert a comment in html?
Comments in html begins with “<!–“nd ends with “–>”.
 <!-- COMMENT Lines --–>
7. What is image map?
Image map lets you link to many different web pages using a single image. You can define shapes in images that you want to make part of an image mapping.
8. What’s the difference between standards mode and quirks mode?
Quirks Mode is a default compatibility mode and may be different from browser to browser, which may result to a lack of consistency in appearance from browser to browser.
9. What is the advantage of collapsing white space?
White spaces are blank sequence of space characters, which is actually treated as a single space character in html. Because the browser collapses multiple space into a single space, you can indent lines of text without worrying about multiple spaces. This enables you to organize the html code into a much more readable format.
10. What is the use of using alternative text in image mapping?
When you use image maps, it can easily become confusing and difficult to determine which hotspots corresponds with which links. Using alternative text lets you put a descriptive text on each hotspot link.
Questions & Answers