Tuesday, August 19, 2014

HTML/HTML5

HTML/HTML5 interview questions

1). What is HTML?
2). What are tags?
3). Do all HTML tags come in pair?
4). What are some of the common lists that can be used when designing the page?
5). How do you insert comment in HTML?
6). What is image map?
7). Can attribute value be set to anything or are there specific values that they accept? 
8). How do you insert copyright symbol on a browser page?
9). How do you create link to section in same page?
10). If you see web address in a magazine, to which web page does it point?
11). What is use of the using alternative text in image mapping?
12). Does hyperlink apply to text only?
13). How do you change number type in middle of the list?
14). How do you create multicolored text in a webpage?
15). What is the advantage of grouping several checkboxes together?
16). What will happen if you overlap set of tags?
17). What if there is no text between the tags or if text was ommitted by mistake? Will it effect the display of the HTML file?
18). How do you create a link that will connect to another  web page when clicked?
19). Can a single text link point to two different web pages?
20). What is difference between directory,menu and unordered list?
21). Can you change the color of the bullets?
22). What are the limits of the text field size?
23). What is marquee?
24). How do you create text on the web page that will allow you to send an email when clicked?
25). Are there instances where text will appear outside of the browser?
26). How are active links different from normal links?
27). Can I specify fractional weight values such as 670 or 973 for font weight?
28). What is the hierarchy that is being followed when it comes to style sheet?
29). Can several selectors with class names be grouped together?
30). What happens if you open the external CSS file in a browser?
31). How do you make a picture into a background image of the web page?
32). When is it appropriate to use frames?
33). What is difference between html and html5?
34). What is <!DOCTYPE>? Is it necessary to use in HTML5?
35). How many new markup elements you know in HTML5?
36). What are new media elements in html5?
37). Do you know new input type attribute in HTML5?
38). How to add video and audio in HTML5?
39). What is local storage in HTML5?
40). What is sessionstorage object in HTML5? How to create and access?
41). What is the use of canvas element in HTML5?
42)  What purpose does HTML5 serve?
43). What are different types of storage in HTML5?
44). What are new apis provided by html5 standard? Give a breif description of each?
45). What other advantages does HTML5 have?

What is HTML?

- HTML is short for hyper text markup language and is language for www.
- it is standard text formatting language used for creating and displaying pages on the web.
- HTML documents are made up of two things:
Content
Tags that format it for proper display on pages.

What are tags?

- content is placed in between HTML tags in order to properly format it.

Do all HTML tags come in pair?

- no, there are single HTML tags that does not need closing tag.
- examples are <img> tag and <br> tags

What are some of the common lists that can be used when designing the page?

- you can insert any or a combination of following list types:
Ordered list
Unordered list
Definition list
Menu list
Directory list

How do you insert comment in HTML?

- <!-- sample comment-->

What is image map?

- Image map let's 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.

Can attribute value be set to anything or are there specific values that they accept?

- some attribute values can be set to only predefined values.
- other attributes can accept any numerical values that represents number of pixels for a size.

How do you insert copyright symbol on a browser page?

- to insert a copyright symbol, you need to type &copy , or &#169 in an HTML file.

How do you create link to section in same page?

- links can be created using <a> tag, with referencing through the use of the number(#) symbol.
- <a href="#topmost"> BACK TO TOP</a>
Which results in words "BACK TO TOP" appearing on the webpage and links to a bookmark named topmost.
You then create seperate tag command like <a name="topmost"> somewhere on top of the same webpage so that user will be linked to that spot when he clicked on ."BACK TO TOP"

If you see web address in a magazine, to which web page does it point?

- each web page on the web can have separate address.
- most of these addresses are relative to the top most web page..
- the published web address that appears within magazines typically points this top most page.
- from this top level page, you can access all other pages within the web site.

What is use of the 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 let's you put a descriptive text on each hotspot link.

Does hyperlink apply to text only?

- no, hyperlink applies to text as well as images.
- that means you can convert image into a link that will allow user to link to another page when clicked.
- just surround the image within the <a href="">...</a> tag combinations

How do you change number type in middle of the list?

- the <li> tag includes two attributes- type and value.
- the type attribute can be used to change the numbering type for any list item.
- the value attribute can change the number index.

How do you create multicolored text in a webpage?

- to create text with different colors, use the <font color="color">..</font> tags for every character you want to apply a color.
- you can use this tag combination as many times as needed, surrounding single character or an entire word.

What is the advantage of grouping several checkboxes together?

- although checkboxes don't affect one another, grouping checkboxes together helps to organize them.

What will happen if you overlap set of tags?

- if two sets of HTML tags are overlapped, only first tag will be recognized.

What if there is no text between the tags or if text was ommitted by mistake? Will it effect the display of the HTML file?

- if there is no text between the tags, then there is nothing to format, so no formatting will appear.
- some tags, especially tags without closing tag like <img> tag, do not require any text between them

How do you create a link that will connect to another web page when clicked?

- to create hyperlinks, or links that connect to another web page, use the href tag. The general format for this is:
< a href="site"> text</a>
Replace site with the actual page URL that is supposed to be linked to when the text is clicked.

Can a single text link point to two different web pages?

- no. The <a> tag can accept only single href attribute, and it can point to only single web page.

What is difference between directory,menu and unordered list?

- key difference is that the directory and menu lists do not include attributes for changing the bullet style.

Can you change the color of the bullets?

- bullet color is always same as that of the first character in the list item.
- if you surround the <li> and the first character with the set of <font> tags with the color attribute set, the bullet color and the first character will be different color from the text.

What are the limits of the text field size?

- the default size for text field is around 13 characters, but if you include the size attribute, you can set the size value to be as low as 1.
- the maximum size value will be determined by browser width.
- if size of the attribute is set to 0, size will be set to default size of 13 characters.

What is marquee?

- it allows you to put scrolling text in a. Web page.
- to do this, place whatever text you want to appear scrolling within the <marquee> and </marquee> tags.

How do you create text on the web page that will allow you to send an email when clicked?

- to change the text into clickable link to send email, use the mail to command with in the href tag.
- the format is as follows:

<a href=" Mailto: your email address"> text to be clicked</a>

Are <br> tags the only way to separate sections of text?

- the <br> tag is only one way to separate lines of text. Other tags, like the <p> tag and <block quote> tag, also separate sections of text.

Are there instances where text will appear outside of the browser?

- by default, text is wrapped to appear within the browser window.
- however, if text is part of table cell with defined width, the text could extend beyond the browser window.

How are active links different from normal links?

- default color for normal and active link is blue.
- some browsers recognize an active link when mouse cursor is placed over that link, others recognize active links when the link has the focus.
- those that don't have mouse cursor over that link is considered a normal link.

Can I specify fractional weight values such as 670 or 973 for font weight?

- standard does not support fractional weight values.
- acceptable values must end with two zeros.

What is the hierarchy that is being followed when it comes to style sheet?

- inline style sheets
- embedded style sheets
- external style sheets

Can several selectors with class names be grouped together?

- you can define several selectors with the same style definition by separating them with commas.

What happens if you open the external CSS file in a browser?

- the browser cannot open the file as file has different extension.
- the only way to use an external CSS file is to reference it using </link> tag within another HTML document.

How do you make a picture into a background image of the web page?

- <body background="image.gif">

When is it appropriate to use frames?

- frames can make navigating a site much easier.
- if main links to the site are located in a frame that appears on top or along edge of the browser, the content for those links can be displayed in the remainder of the browser window.

What is difference between html and html5?

- html5 is nothing but upgraded version of html where in html5 there are lot of new features
- video
- audio/mp3
- date select function
- placeholder
- canvas
- 2D/3D graphics
- local SQL database added so that no need to do extra plugin like flash player or other library

What is <!DOCTYPE>? Is it necessary to use in HTML5?

- it is an instruction to web browser about what version of html the page is written in.
- it does not have an end tag and it is not case sensitive.
- <!DOCTYPE> declaration must be very first thing in HTML5 document before the <html> tag.
- html5 is based on SGML, and therefore does not require a reference to dtd

How many new markup elements you know in HTML5?

- <article>
- <aside>
- <bdi>
- <command>
- <details>
- <summary>
- <figure>
- <figcaption>
- <footer>
- <header>
- <hgroup>
- <mark>
- <meter>
- <nav>
- <progress>
- <ruby>
- <rt>
- <rp>
- <section>
- <time>

What are new media elements in html5?

- <audio>
- <video>
- <source>
- <embed>
- <track>

Do you know new input type attribute in HTML5?

- tel
- search
- url
- email
- datetime
- date
- month
- week
- time
- datetime-local
- number
- range
- color
- placeholder

How to add video and audio in HTML5?

- canvas element is used to draw graphics images on web page by using javascript like below.
We can add video in html5
<video width="320" height="240" controls="controls">
<source src="mysong.mp4" type="video/mp4">
</video>

What is local storage in HTML5?

- before html5, local storage was done with cookies.
- cookies are not very good for large amounts of data, as they are passed on by every request to the server, so it is very slow and in effective.
- in html5, data is not passed on by every server request, but used only when asked for.
- it is possible to store large amounts of data without affecting websites performance. 

What is sessionstorage object in HTML5? How to create and access?

- sessionstorage object stores the data for one session.
- data is deleted when user closes the browser window.

What is the use of canvas element in HTML5?

- it is used to draw graphics image on web page by using javascript

What purpose does HTML5 serve?

- it aims to reduce the need for proprietary plugin based rich internet application technologies such as adobe flash, microsoft silverlight, apache pivot, and sun javafx.

What are different types of storage in HTML5?

- html5 offers two new objects for storing data on client

Localstorage- stores data with no time limit
Session storage: stores data for one session. The data is deleted when user closes the brower window.

What are new APIs provided by html5 standard? Give a breif description of each?

- time media playback
- offline storage database
- document editing
- drag and drop
- cross document messaging
- browser history management
- mime type and protocol handler registration

What other advantages does HTML5 have?

- cleaner markup
- additional semantics of new elements like <header>,<nav> and <time>
- new form input types and attributes that will take the hassle out of scripting forms

No comments:

Post a Comment