1. What is the advantage of collapsing white space?
Ans: The browser collapses the multiple white spaces into a single white space in HTML.This allows the developers to arrange the HTML code in a well organized and legible format.
2. Is it possible to list elements straight in an html file?
Ans: Yes, it is possible with the use of indents.
3. Does a hyperlink apply only to text?
Ans:The hyperlinks can be applied to both text as well as the images. It means that even the images can become clickable links with a capability to take the visitor to the next page.
This can be done simply by using <a href> tag.
4.What hierarchy is being followed when in style sheets?
Ans: Inline style takes priority over embedded style sheets. Embedded style take priority over external style sheets. If a single selector includes three different style definitions, the definition that is closest to the actual tag gets the priority.
5.What happens if the list-style-type property is used on a non-list element like a paragraph?
Ans: Here the property will be ignored without having any effect on the paragraph.
6.What is the advantage of using frames?
Ans: Frames make it easier to navigate through a site. The links that appear in the frame can appear through out the site.
7.How can I hide my source?
Ans: You can’t hide your source as it is required by the browser to display your document.
8.How will you align a table to the right or left?
Ans: To align the table to the right, you can use <TABLE ALIGN=”right”>. To align the table to the left, you can use <TABLE ALIGN=”left”>
9.Why doesn’t <TABLE WIDTH=”100%”> use the full browser width?
Ans: This is because the graphical browser is designed to leave a margin between the display area and actual content. The navigator also leaves some space for the scroll bar on the right side of the display area. Though, if the page is not long enough, the scroll bar doesn’t appear.
10.How would you automatically transfer your visitors to a new web page?
Ans: You can do it with the help of meta tag mentioned below:
<META HTTP-EQUIV=”Refresh” CONTENT=”2″; URL=”http://www.yourname.com”>
Place this tag between <HEAD></HEAD> .
It will load yousite.com in 2 seconds.
11.You want only a vertical scrollbar and no horizontal scrollbar on your page. How would you do it?
Ans: This can be done by defining the frame with SCROLLING = auto and having content to just fit into this frame.
SCROLLING=“yes” gets the scroll bar on both the sides, even when not needed.
SCROLLING=“no” doesn’t get the scrollbars at all, even when they are needed.
12.How do you refer to the .css file in the web page?
Ans: .css file in the web page can be referred with the use of <link> tag.
It should be kept between <head></head> tag.
<link href=”/css/mystyle.css” type=”text/css” rel=”stylesheet” />
12.What is a better way to design the layout of a web page – a table tag or div?
Ans: The better way to design the layout of the webpage is by using the <div> tag.
The <table> tag is used to present the data in tabular format.
13. What is a <dl> tag in HTML?
Ans: <dl> is a definition list tag used in HTML.
It is used with <dt> and <dd>.
<dt> list the item while <dd> describes it.
14.What are empty HTML elements?
Ans: HTML elements with no content are called empty elements. For eg: <br>
15. How to create nest tables within tables in HTML?
Ans: We can create nest table i.e. table inside a table.
14.To create table we use following attributes:
Ans: <table>……</table>: declare starting and ending of table.
<tr>…</tr>: declare table row.
<td>…</td>: table data.
<td>first cell of the outer table</td>
<td>second cell of the outer table, creating second table inside the first table
<td>first cell of the second table</td>
<td>second cell of the second table</td>
15.Explain Non Breaking space in HTML.
Ans: When we add many spaces in the content then HTML remove all space except one space this is Non Breaking Space. To overcome this problem we use ‘& nbsp;'(without space between & and nbsp;). Suppose we want to add 3 space between two words then we have to use & nbsp; three time.
actual code:- hello I m Rohit Srivastava.
Display as:- Hello I m Rohit Srivastava.
But when we use & nbsp:
Actual code:- Hello & nbsp; & nbsp ; & nbsp; I m Rohit Srivastava.
Display as:- Hello I m Rohit Srivastava
NOTE: (without space between & and nbsp;)
16.How do I link to a location in the middle of an HTML document?
We can link to a location in the middle of an HTML document. Using Following steps:
Label the destination of the link : There are two ways of labeling destination using Anchor:
<h2><a name=”destination”>Destination: Explanation</a></h2>
<h2 id=”Destination_ID”> Destination: Explanation </h2>
Link to the labeled destination : We can link with the destination in the same URL page and with Different URL page.
Same URL: <a href=”#Destination”> Visit to destination</a> or
Different URL: <a href=”thesis.html#section2″>go to Section 2 of my thesis</a>
16.Explain Cell Padding and Cell Spacing.
Ans: Cell Padding : It refers to the gap or space between the cell content and cell border or cell wall.
Cell Spacing : It refers to the gap between the two cells of same tables.
In HTML cell spacing and padding both are used with Table Border layout.
<table border cellpadding=2>
<table border cellspacing=2>
<table border cellpadding=2 cellspacing=2>
17.How to create a button which acts like a link?
Ans: To create buttons which act as a hyperlink, there are two ways:
<FORM ACTION=”[url]” METHOD=get>
<INPUT TYPE=submit VALUE=”Text on button”>
<INPUT TYPE=”submit” VALUE=”Go to my link location”
ONCLICK=” http://www.careerride.com/;” />
18.What is difference between HTML and XHTML?
Ans: The differences between HTML and XHTML are:
HTML is application of Standard Generalized Markup Language(SGML) whereas XML is application of Extensible Markup Language(XML).
HTML is a static Web Page whereas XHTML is dynamic Web Page.
HTML allows programmer to perform changes in the tags and use attribute minimization whereas XHTML when user need a new markup tag then user can define it in this.
HTML is about displaying information whereas XHTML is about describing the information.
19.How many types CSS can be include in HTML?
Ans: There are three ways to include the CSS with HTML:
Inline CSS : It is used when only small context is to be styled.
To use inline styles add the style attribute in the relevant tag.
External Style Sheet : Is used when the style is applied to many pages.
Each page must link to the style sheet using the <link> tag. The <link> tag goes inside the head section:
<link rel=”stylesheet” type=”text/css” href=”mystyle.css” />
Internal Style Sheet : Is used when a single document has a unique style.
Internal styles sheet needs to put in the head section of an HTML page, by using the <style> tag, like this:
20.What are logical and physical tags in HTML?
Ans: Logical tags are used to tell the meaning of the enclosed text. The example of the logical tag is <strong> </strong> tag. When we enclosed text in strong tag then it tell the browser that enclosed text is more important than other text.
Physical text are used to tell the browser that how to display the text enclosed in the physical tag.
Some example of the physical tags are: <b>, <big>, <i>
External File : Script in and external file and then include in <head> ….. </head> section.
21.Explain marquee tag.
Ans: Marquee tag : Marquee tag is used when we want that some text or content move in the web page whether horizontally or vertically.