R4R
Right Place For Right Person TM
 
R4R HTML FAQS HTML Interview Questions and Answers

 


Tolal:40 Click: 1 2
Previous Home Next

HTML Interview Questions And Answers

Page 1

Ques: 1 What do you understand about DOCTYPE in HTML?

Ans:
DOCTYPE is stands for Document Type Declaration.In an HTML every HTML document is started with DOCTYPE declaration.It may be differ for different versions of HTML.DOCTYPE is used only bySGML tools like as HTML validator. Example of Document Type Declaration in HTML 4 are, <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

Ques: 2 How Cell Padding is differ from Cell Spacing?

Ans:
I have given you how cell padding is differ from cell spacing given below: Cell Padding: Cell Padding in HTML: is used to define the how much space need b/n cell content and cell edges. Syntax: < table width="200" border="1" cellpadding="3"> means that it takes 3 pixels of padding inside the each cell. Cell Spacing: It is also used to format the table.but it differ than cell padding because in cell padding we can set an extra space to seperate the cell content with cell edges.Where as we use cell spacing to set the space b/w the cells. Syntax: < table width="200" border="1" cellspacing="10"> We can use cell padding and cell spacing together like that, < table width="200" border="1" cellpadding="3" cellspacing =�10�>

Ques: 3 How you define index document?

Ans:
Many times we have require index.htm / document because it is a standard for the host-server to look for the document and deploy it.Default document to be displayed in the web.

Ques: 4 How you define HEAD in HTML?

Ans:
Head is placed before the body in the HTML.It is use to display only the general information or unordered collection to information about the HTML document.

Ans:
head tag is the first tag in html. it helps to give title of the page.

Ques: 5 How you define SPAN in HTML?

Ans:
We use SPAN by using <SPAN> tag in HTML.Syntax:<SPAN>............</SPAN>Used to highlightthe any color text, for adding colored text, for adding background image to text. SPAN not a cause of line break. It delimits text and using them we can use style to the \'elemental\' region without any break in Text. Example: p> <span style="color:#FF0000;"> In this page we use span. </span> </p>

Ques: 6 How you define body in HTML?

Ans:
Body in HTML specifies the all contents of the document.Means that it contain the text,images, colors,graphics etc.

Ques: 7 How you display an picture in background of HTML?

Ans:
We can display an picture in background of HTML page using that code. Syntax: <body style="background-image:url(image path)">

Ques: 8 What is Semantic in HTML?

Ans:
I have given two reasons of use Semantic HTML. 1.Always avoid the use of markup that present you HTML document.Like: element, attribute etc. 2.Try to use available markup to differentiate the meanings of phrases and structure in the document. Example: <cite class="booktitle">The Grapes of Wrath</cite> Above,the <cite> element is used because it most closely matches the meaning of this phrase in the text.

Ques: 9 How to differ width=�200� and width=�200%�?

Ans:
There are many differences b/w width="200" and width="200%".I have given you main difference.If you want create a table set width="200".Means that width of table is 200 which is fixed.But When we write width="200%" then 200% table will display in its full view and can changed according the resolution and browser. Example: Where, I use both width="200" and width="200%". <html> <head> <title>Shows the difference of width="200" and width="200%"</title> </head> <body> <table width="200%" border="1" cellspacing="0" cellpadding="0"> <tr> <td>width=&quot;200%&quot;</td> </tr> </table> <br /> <table width="200" border="1" cellspacing="0" cellpadding="0"> <tr> <td>width=&quot;200&quot;</td> </tr> </table> </body> </html>

Ques: 10 How to blink text in IE6?

Ans:
Content that we write b/w the <blink> tag will blink on HTML page. Syntax: <blink>text want to blink</blink>

Ques: 11 How you use scipts on HTML?

Ans:
We use scripts on HTML page for making HTML page Dynamic. TO use scripts on HTML page we use <script> tag. Example: <html> <head> </head> <body> <script type="text/javascript"> document.write("R4R Welcomes You!") </script> </body> </html> output: R4R Welcomes You!

Ques: 12 How you define HTML Frames?

Ans:
Using HTML Frames we can show more than one HTML document on the same browser.Where as each HTML document is called Frame. We use Frames using <frameset> tag.It is used to divide windows into frames. Using frame tag we put HTML document into the each frame. Example: <frameset cols="25%,75%"> <frame src="frame_first.htm?phpMyAdmin=70ac9566533a2665b6597346aab7f985&phpMyAdmin=f43d4e0b88acea2d2a393515f6bf38f2"> <frame src="frame_second.htm?phpMyAdmin=70ac9566533a2665b6597346aab7f985&phpMyAdmin=f43d4e0b88acea2d2a393515f6bf38f2"> </frameset> 25% and 75% specifies the width of the page.Above frame told that frame_first aquire the 25% area on the web browser and frame_second aquire the 75% area on the same same web browser.

Ques: 13 How you use Form's Action Attribute and Submit Button in HTML?

Ans:
Using Submit Button we can sends the form to the server and Action Attribute is specified that which file we send. <form name="input" action="submit_form.php" method="get"><input type="hidden" name="phpMyAdmin" value="f43d4e0b88acea2d2a393515f6bf38f2" /><input type="hidden" name="phpMyAdmin" value="70ac9566533a2665b6597346aab7f985" /> Formname: <input type="text" name="Form"> <input type="submit" value="Submit"> </form> When we click the sumbit button web page than the submit_form is send to the server.

Ques: 14 How you use Text Field,Radio Button and Checkbox in Form?

Ans:
We use above in the <input> tag of the form. Text Field: We used Text fields when we want that user entered like letters, numbers etc. in a form. Example: <form><input type="hidden" name="phpMyAdmin" value="f43d4e0b88acea2d2a393515f6bf38f2" /><input type="hidden" name="phpMyAdmin" value="70ac9566533a2665b6597346aab7f985" /> User name: <input type="text" name="username"> <br> Password: <input type="password" name="password"> </form> Radio Buttons: We use Radio Buttons when we want that user select one of a limited number of choices. Example: <form><input type="hidden" name="phpMyAdmin" value="f43d4e0b88acea2d2a393515f6bf38f2" /><input type="hidden" name="phpMyAdmin" value="70ac9566533a2665b6597346aab7f985" /> <input type="radio" name="Gender" value="male"> Male <br> <input type="radio" name="Gender" value="female"> Female </form> Checkboxes: We use Checkboxes When we want that user can select one or more options of a limited number of choices. Example: <form><input type="hidden" name="phpMyAdmin" value="f43d4e0b88acea2d2a393515f6bf38f2" /><input type="hidden" name="phpMyAdmin" value="70ac9566533a2665b6597346aab7f985" /> I have a computer: <input type="checkbox" name="electronicdevice" value="Computer"> <br> I have a TV: <input type="checkbox" name="electronicdevice" value="TV"> <br> I have a AC: <input type="checkbox" name="electronicdevice" value="AC"> </form>

Ques: 15 How you understand about Forms output?

Ans:
Using Forms in HTML we can select client input in different manner. In form is use to contain form elements.Using Form elements we can allow the user to enter information (like: text fields, textarea fields, drop-down menus, radio buttons, checkboxes, etc.) in a form. We start form by using <form><input type="hidden" name="phpMyAdmin" value="f43d4e0b88acea2d2a393515f6bf38f2" /><input type="hidden" name="phpMyAdmin" value="70ac9566533a2665b6597346aab7f985" /> tag. <form><input type="hidden" name="phpMyAdmin" value="f43d4e0b88acea2d2a393515f6bf38f2" /><input type="hidden" name="phpMyAdmin" value="70ac9566533a2665b6597346aab7f985" /> <input> <input> </form>

Ques: 16 How you define list in HTML?

Ans:
In HTML we can create ordered,unordered and definition list. HTML list is like that. List *This is first item *This is second item *This is third item *This is fourth item Ordered List: Ordered list define as list of items and they are fully numbered.Our ordered list start with <ol> tag and end with <li> tag. <ol> <li>Abhi</li> <li>Vivek</li> <li>John</li> </ol> output: 1. Abhi 2. Vivek 3. John Unordered List: Unordered list define as list of items and they are write with small black circles.Our ordered list start with <ul> tag and end with <li> tag. <ul> <li>Abhi</li> <li>Vivek</li> <li>John</li> </ul> Definition List: It is not only a list of items. In create list of item with their description. Description list start with <ud> tag and end with <li> tag.In this we list each item by using <dt> and write their description by using <dd> tag. Example: <dl> <dt>Pepsi</dt> <dd>Black cold drink</dd> <dt>Slice</dt> <dd>Yellow cold drink</dd> </dl> output: Pepsi Black cold drink Slice Yellow cold drink We can use <p>(paragraph),<br />(line break), <img>(image),list etc. inside the above three list.

Ques: 17 Write some useful table tags that we use in HTML?

Ans:
I have display the list of some tags that we used in HTML table.These tags are: <table> This is started tag of table.All other table tags works inside this tag. <th> This is used to write header on table. <tr> This is used to create row on table. <td> This is used to create table cells. <caption>This is specifies the table caption. <colgroup>Specifies the group of columns in table. <col> Using then we can set the attribute value for one or more columns in table. <thead> This is used to set table head. <tbody> This is used to set table body. <tfoot> This is used to set table border.

Ques: 18 How to create headings and empty cells in table?

Ans:
Any thing that we write b/w <th>.....</th> tag are display as table heading. Example: <table border="1"> <tr> <th>Heading of column 1</th> <th>Heading of column 2</th> <th>Heading of column 3</th> </tr> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td>row 2, cell 1</td> <td>row 2, cell 2</td> </tr> <tr> <td>row 3, cell 1</td> <td>row 3, cell 2</td> </tr> </table> than table will generated on web browser looks like, Heading of column 1 Heading of column 2 row 1, cell 1 row 1, cell 2 row 2, cell 1 row 2, cell 2 row 3, cell 1 row 3, cell 2 We can create an empty cell with in table like that, <table border="1"> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td>row 2, cell 1</td> <td></td> </tr> <tr> <td></td> <td>row 3, cell 2</td> </tr> </table> Now, than our HTML table looks like, row 1, cell 1 row 1, cell 2 row 2, cell 1 row 3, cell 2 If your does not show the border line around empty cell than you can write &nbsp;(called space) between the tags of empty cells. Like:<td>&nbsp;</td>

Ques: 19 How to create tables in HTML?

Ans:
We use <table> tag to create the table in HTML. After creating an table we use <tr> tag to create the rows.And use <td> to create data cell on each row.These cell can store images,text,tables,list etc. Basic syntax to create an Table are given below: <table border="1"> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> <td>row 1, cell 3</td> </tr> <tr> <td>row 2, cell 1</td> <td>row 2, cell 2</td> <td>row 2, cell 3</td> </tr> </table>

Ques: 20 How we define Src Attribute and Alt Attribute in HTML?

Ans:
We use Src Attribute and Alt Attribute with the image tag(<img>).Image tag is an empty tag.So, their is no need to close img tag. we use src(stands for source)for load the image on the HTML page.Syntax:<img src=\"write here the address or location of image\"> We use Alt Attribute to define the image which you loaded with src Attribute.Syntax:<img src=\"image.gif\" alt=\"Description of image\">Example:<img src=\"logo.gif\" alt=\"R4R logo\"> Some image tags are given below: <map> It is used to define image map. <img> It is used to define an image. <area>Using this we can create the area.Those area we want show as clickable.


Goto Page:

1 2
Share |

HTML Objective

HTML Objective Questions And Answers

HTML Interview Questions And Answers

HTML Subjective Questions And Answers

R4R,HTML Objective, HTML Subjective, HTML Interview Questions And Answers,HTML,HTML Interview,HTML Questions ,HTML Answers

New Updates

R4R
R4R
R4R
R4R
R4R
R4R
R4R
R4R