HTML Q&A
HTML Q&A - Part1
1) What is HTML?
Answer: HTML (HyperText Markup Language) is a markup language that designs the html documents to be displayed in a web browser
2) What is HTML document?
Answer: HTML document is a text file containing HTML and is saved with .html or .htm
3) What helps in the designing of html document other than html?
Answer: Scripting languages such as JavaScript and CSS (Cascading Style sheets) helps in designing the html document
4) What renders HTML documents into web pages?
Answer: Web browsers render html documents into web pages
5) What are the main components of html document?
Answer: The line that defines the html version, the header section and the body that has the actual content
6) What is document type declaration?
Answer: It defines the version of html. In case of html5 the declaration is <!DOCTYPE html>
7) What are HTML elements?
Answer: HTML elements are parts of html document that defines the structure of document and helps the web browsers in interpreting them. Most of them has opening and closing tags. They comprise of tags, content and attributes. e.g.<p style=”color:green”>Paragraph</p>
8) What are HTML tags?
Answer: HTML tags denotes the beginning and end of HTML elements. e.g.<h1></h1>
9) What are HTML attributes?
Answer: HTML attributes defines how HTML elements look and their behaviour. For example in the html element
<h1 style=”color:green”>Header1</h1>, style=”color:green” is the attribute
10) What is html style attribute?
Answer: It is used to give style to the element. For example the style can be font, colour etc
11) What are the html formatting tags for subscript, superscript, strong text, emphasized text and marked text respectively?
Answer: <sub></sub>, <sup></sup>, <strong></strong>,<em></em>,<mark></mark>
12) What are the html formatting tags for small text, inserted text, deleted text, italic text and bold text respectively
Answer: <small></small>, <ins></ins>, <del></del>,<i></i> and <b></b>
13) What are void elements in html?
Answer: Void elements are those that only have start tags and no ending tags or content in it. They can have attributes. Some examples are <br/>, <img/>
14) What is an anchor tag in html?
Answer: An anchor tag in html can be used to link to different sections of a page, to link to different web pages, link to files, link to code etc
15) What is target attribute in html?
Answer: The target attribute in html specifies how a linked document is opened?
Open a link in a new tab or window: <a href=”http://infotainpoint.com/” target=”_blank”>My link</a>
Open a link in full window: <a href=”http://infotainpoint.com/” target=”_top”>My link</a>
Open a link in parent frame: <a href=”http://infotainpoint.com/” target=”_parent”>My link</a>
Open a link in the same frame: <a href=”http://infotainpoint.com/” target=”_self”>My link</a>
16) What are block level elements in html?
Answer: A block level element creates block by occupying all the horizontal space of parent element and vertical space equal to its contents. It always starts with a newline. e.g. <p> and <div>
17) What are inline elements in html?
Answer: Inline elements occupies the width required and does not start on a new line. e.g. <span>
18) What is hyperlink in html?
Answer: A hyperlink links to another part of the page or to a different page
19) How can you add a comment in html?
Answer: <!—my comment –>
20) What is an ordered list?
Answer: An ordered list displays elements in numbers. It is denoted by <ol>
21) What is an unordered list?
Answer: An unordered list displays elements in bullet format. It is denoted by <ul>
22) What is description list?
Answer: It is a list of terms and their descriptions (key-value pairs)
23) What is an image map?
Answer: It is an image with different clickable areas. The image map is defined by <map> and area by <area>
<map name=”mymap”>
<area shape=”rect” coords=”0,0,90,130″ href=”test.htm” alt=”test”>
</map>
24) How can the text be scrolled in html?
Answer: Using the <marquee> tag
25) What is <div> tag in html?
Answer: It is a division in html document that contains more than one element. The elements can be grouped and cascading style sheets can be applied
26) What is <span> tag in html?
Answer: It is an inline container for inline elements that can used to group elements for styling
27) What is URL in html?
Answer: URL(Uniform Resource Locator) is a web address. It can contain words like infotainpoint.com or IP address
28) What is the syntax of URL?
Answer: scheme://prefix.domain:port/path/filename
scheme: http or https
prefix: domain prefix. www is the default for http
domain: e.g. infotainpoint.com
port: port number at host. 80 is the default for http
path: path at the server. Root directory of site if omitted
filename: the name of resource
29) What is URL encoding?
Answer: URL encoding converts the non-ASCII characters into a format that can be sent over the internet as URLs can only be sent over the internet using ASCII characters. Non-ASCII characters are replaced with a “%” followed by hexadecimals. Spaces are replaced by %20 or “+”
30) How is iframe useful in html?
Answer: iframe is used to display a web page inside another
31) What is cell spacing and cell padding?
Answer: cell spacing is the space between cells of the table while cell padding is the space between content of the cell and the border
32) How do you link to external style sheet from web page?
Answer:
<head>
<link rel=”stylesheet” type=”text/css” href=”test.css”>
</head>
33) What is <usemap>?
Answer:
usemap links <img> and <map>
<img src=”mytest.gif” width=”120″ height=”100″ alt=”mytestmap” usemap=”#mymap”>
<map name=”mymap”>
<area shape=”rect” coords=”0,0,90,130″ href=”test.htm” alt=”test”>
</map>
34) What is web storage?
Answer: Web storage gives the ability to store 10 MB of web application’s data locally in user’s browser. This helps in performance increase
35) What are the 2 types of web storage used to store data locally in html5?
Answer:
Local storage which stores the data that is not automatically cleared or expire when browser is closed or reopened.
Session storage which stores the data for a session. The data will automatically get deleted when the browser is closed
36) What are the graphics html5 supports?
Answer: HTML5 supports Canvas and SVG graphics
37) Which web browsers does html5 support?
Answer: Google chrome, internet explorer, firefox, safari and opera
38) Which video formats can be embedded on web page?
Answer: WebM, MPEG4, Ogg
39) Which audio formats can be embedded on web page?
Answer: MP3, WAV, Ogg Vorbis
40) What is CDN (Content Delivery Network)?
Answer: CDN refers to group of servers distributed geographically that provide fast delivery of internet content
41) Where is charset defined in html document?
Answer: Charset is defined in meta tag
42) <iframe> can be used for nesting of web pages. True or false?
Answer: True
43) What is rowspan attribute in html?
Answer: It specifies the number of rows a cell should span
44) What is colspan attribute in html?
Answer: It specifies the number of columns a cell should span
45) How can you make an element hidden in html and also make it not to take any space on the webpage?
Answer: This can be achieved using “display: none” attribute
46) What will the attribute “visibility:hidden” do?
Answer: This will make an element hidden in html but it takes up space
47) What does © or © mean in html?
Answer: copyright symbol