Html Interview Question
Html Interview Questions
HTML Interview Question for Freshers
What is HTML ?
HTML stands for HyperText Markup Language. It is used for creating websites and anything that can be viewed in a web browser.
What does DOCTYPE mean ?
The term DOCTYPE tells the browser which type of HTML is used on a webpage. In turn, the browsers use DOCTYPE to determine how to render a page.
Difference between radiobutton and checkbox
Radio button are used for select only one option among multiple option but checkbox are used for select multiple option among list of given option.
Difference between style and <style> tag
Every Html element has a default style. Default background color is white, text color is black, text-size is 12px . For changing these default style of an Html element, you need to use style attribute. And <style> tag are used for use css code inside html page.
Do all HTML tags come in pair ?
No, Some HTML tags that does not need a closing tag. For Examples, <img> tag and <br> tags.
What is a marquee ?
It is used for put scrolling text in a web page.
Syntax
<marquee>Your Text</marquee>
How to put background image of a web page ?
Syntax
<body background = "image.gif">
What are empty elements ?
Syntax
<body background = "image.gif">
What are empty elements ?
HTML elements with no content are called empty elements. For example: <br>, <hr> etc.
Can you create a multi colored text on a web page ?
Yes. To create a multicolor text on a web page use <font color ="color"> </font>
Difference between Html and Html5
Html | Html5 |
---|---|
Doctype declaration in Html is too longer <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | DOCTYPE declaration in Html5 is very simple "<!DOCTYPE html> |
character encoding in Html is also longer <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> | character encoding (charset) declaration is also very simple <meta charset="UTF-8"> |
Audio and Video are not part of HTML4 | Audio and Videos are integral part of HTML5 e.g. <audio> and <video> tags. |
Vector Graphics is possible with the help of technologies such as VML, Silverlight, Flash etc | Vector graphics is integral part of HTML5 e.g. SVG and canvas |
It is almost impossible to get true GeoLocation of user browsing any website especially if it comes to mobile devices. | JS GeoLocation API in HTML5 helps identify location of user browsing any website (provided user allows it) |
Does not allow JavaScript to run in browser. JS runs in same thread as browser interface. | Allows JavaScript to run in background. This is possible due to JS Web worker API in HTML5 |
Works with all old browsers | Supported by all new browser. |
Give Syntax for HTML comment
Syntax
<!-- Insert comment here. -->
How to Reduce Page Load Time ?
Reduce image sizes, remove unnecessary widgets, use single file for JavaScript code, HTTP compression, put CSS at the top and script references at the bottom or in external files, reduce lookups, minimize redirects, use caching technique, etc.
What is the difference between HTML elements and tags ?
HTML elements communicate to the browser how to render text. HTML tag is just opening or closing entity. For example
Syntax
<p> and </p> are called HTML tags
HTML element encompasses opening tag, closing tag, content (optional for content-less tags)
Syntax
<p>This is the content</p> : This complete thing is called a HTML element