CSS 2 question and answer for oDesk and Elance

Question 1: Which of the following rules is equivalent to the em { color: rgb(255,0,0) } style?

a.em { color: rgb(300,0,0) }

b.em { color: rgb(255,-10,0) }

c.em { color: rgb(110%, 0%, 0%) }

d.em { color: rgb(100%, 0%, 0%) }

e.All of the above (Answer)

 

Question 2: Which of the following are not valid values for the target-new property?

a.window

b.tab

c.none

d.parent (Answer)

e.current (Answer)

 

Question 3: What is the type of the letter-spacing property?

a.length

b.number (Answer)

c.percentage

d.integer

 

Question 4:  What will happen if the following style declaration is applied to an element?

p { margin: 3em 2em }

a.The top and the bottom margins will be 3em and the left and the right margins will be 2em.(Answer)

b.The top and the bottom margins will be 2em and the left and the right margins will be 3em.

c.The top and the left margins will be 3em and the bottom and the right margins will be 2em.

d.The top and the right margins will be 2em and the bottom and the left margins will be 3em.

Question 5:  What will happen if the pause property is used as follows?

h2 { pause: 40s 60s }

a. pause-before will be set to 40 seconds and pause-after will be set to 60 seconds. (Answer)

b. pause-after will be set to 40 seconds and pause-before will be set to 60 seconds.

c. pause-after and pause-before will be set to 40 seconds.

d. pause-after and pause-before will be set to 60 seconds.

 

Question 6: Which of the following properties doesn”t take up space?

a. outline (Answer)

b. border

c. Both a and b

 

Question 7:  backface-visibility:hidden; will this property hide the back side when an element is rotated?

a.Yes (Answer)

b.No

Question 8:  What is the initial value of the animation-iteration-count property?

a.0

b.1 (Answer)

c.5

d.None

 

Question 9: If you set the value of the speak property to digits, how would 22 be spoken?

a.twenty two

b.two two (Answer)

c.twenty and two

d.four

 

Question 10: A/An___________ is defined with ‘grid-columns’, ‘grid-rows’ properties

a.Explicit grid (Answer)

b.Natural grid

c.Default grid

d.None of the above

 

Question 11:  The color in three digit RGB notation is #fb0. What will be its equivalent six digit color code?

a.#fb0fb0

b.#ffbb00 (Answer)

c.#fbfb00

d.None of the above

 

Question 12:  Which of the following is the initial value for the column-fill property?

a.auto

b.balance (Answer)

c.none

 

Question 13: What will be the output of the following rule?

em { color: rgba(0,0,255,1) }

a.Opacity 1 with solid red color

b.Opacity 0 with solid blue color

c.Opacity 0 with solid red color

d.Opacity 1 with solid blue color. (Answer)

e.None of the above

 

Question 14: Which of the given options is/are equivalent to the following rule?

DIV { line-height: 1.2; font-size: 10pt }

a.DIV { line-height: 1.2em; font-size: 10pt } (Answer)

b.DIV { line-height: 12em; font-size: 10pt }

c.DIV { line-height: 120%; font-size: 10pt } (Answer)

d.DIV { line-height: 20%; font-size: 10pt }

e.DIV { line-height: 80%; font-size: 10pt }

 

Question 15: What will happen if the value of the transform-style property is set to flat and the element has children?

a.The element will be shown with 3D effect but the children will be rendered flattened into the 2D plane.

b.The element will be shown with 2D effect but the children will be rendered into the 3D plane.

c.Both the element and its children elements will be rendered in 3D effect.

d.Both the element and its children elements will be rendered in 2D effect. (Answer)

 

Question 16: Which of the following is not a user interface element fragment selector?

a.value

b.choices

c.default. (Answer)

d.repeat-item

e.repeat-index

 

Question 17: Which of the following value of the white-space property will set the value of white-space-collapse to “preserve” and value of the text-wrap to “none”?

a.normal

b.pre

c.nowrap (Answer)

d.pre-wrap

e.pre-line

 

Question 18: What is the maximum value that can be given to the voice-volume property?

a.0

b.10

c.100 (Answer)

d.500

e.None of the above

 

Question 19: If you are using the white-space-collapse property with value collapse, what will be the output of the following string?

John leads his team to the victory, but fails to reach the finals

a.Johnleadshisteamtothevictory,butfailstoreachthefinals.

b.John leads his team to the victory, but fails to reach the finals. (Answer)

c.John leads his team to the victory, but fails to reach the finals.

d.John leads his team to thevictory, but fails to reach thefinals.

 

 

Question 20: Which of the following declarations can be used to cover the whole background?

a.body

{

background: red url(“test.gif”);

background-repeat: repeat-y;

background-attachment: fixed;

}

b.body

{

background: red url(“test.gif”);

background-repeat: repeat-x;

background-attachment: fixed;

}

c.body

{

background: red url(“test.gif”);

background-repeat: no-repeat;

background-attachment: fixed;

}

d.body{

background: red url(“test.gif”);

background-repeat: repeat;

background-attachment: fixed;

(Answer)

e.body

{

background-image: url(“test.gif”);

background-repeat: space;

}

 

Question 21:

Which of the following properties allow percentages in their value fields?

a.font-size (Answer)

b.font-variant

c.font-weight

d.line-height (Answer)

 

Question 22: To which of the following elements can the min-width property not be applied?

a.button

b.span (Answer)

c.table row

 

Question 23: Consider the following code and say what will happen if you click on More?

@media print

{

.footnote

{

float: footnote;

content: target-move(attr(href, url)) }

.marker { display: none }

}

 

HTML code:

<p>John was a great writer<a class=”footnote” href=”#words”> [More]</a>.

<p id=words><span class=”marker”>[More]</span> Great poet too.

a.The tool tip will appear saying Great poet too.

b.A pop up will appear saying Great poet too.

c.The page will shift focus to the line Great poet too.

d.Nothing will happen. (Answer)

 

Question 24: Consider the following code:

<style>

.name::after { content: leader(solid) }

</style>

<div>

<span>Shane Mathew</span>

<span class=”number”>9843423232</span>

</div>

What will be the output if the name and the number end up on different lines?

 

a.Shane Mathew….

…9843423232

b.Shane Mathew____

___9843423232 (Answer)

c.Shane Mathew

9843423232

d.Shane Mathew—

—9843423232

 

Question 25:  What is the default value of the text-align property?

a.start

b.end

c.left (Answer)

d.right

e.center

f.justify

 

Question 26:  What is the problem in the following style sheet?

@import “style.css”;

@media print

{

@import “print-main.css”;

BODY { font-size: 10pt }

}

h1 {color: red }

a.Two style sheets can’t be included with @import.

b.The body tag can’t be included inside @media.

c.@import rule is invalid since it occurs inside a @media block. (Answer)

d.It is valid.

 

Question 27: What is the initial value of the opacity property?

a.0

b.1 (Answer)

c.normal

d.none

Question 28: You want to float an image to the top of the next-page. Which of the following styles will help you to achieve the desired result?

a.img { float: next-page; }

b.img { float: top-corner next-page; }

c.img { float: next-page top; }

d.b and c (Answer)

 

Question 29: Consider the following code:

body { text-replace: “a” “b” “b” “c” }

What will be the output of the following string if you implement the text-replace style?

andy lives behind cafe

a.bndy lives behind cbfe

b.cndy lives cehind ccfe

c.andy lives behind café (Answer)

d.andy lives cehind bafe

 

Question 30: Which of the following is not a valid page break?

a.page-break-inside

b.page-break-outside (Answer)

c.page-break-before

d.page-break-after

e.None of the above

 

Question 31: For the clear property, which of the following value is not valid?

a.none

b.left

c.right

d.top (Answer)

 

Question 32: What will happen if the cursor property value is set to none?

a.The default cursor will be displayed. (Answer)

b.No cursor will be displayed.

c.A pointer cursor will be displayed.

d.A text cursor will be displayed.

 

Question 33: State whether following statement is true or false.

The RGB color model is hardware-specific while the HSL is symmetrical to lightness and darkness.

a.True (Answer)

b.False

 

Question 34: Which of the following is not a valid value for the font-stretch property?

a.condensed

b.normal

c.semi-narrower (Answer)

d.expanded

e.semi-expanded

 

Question 35: What will happen if the following style declaration is used in the given HTML code?

<style type=”text/css”>

div.container

{

width:38em;

border:1em solid black;

}

div.split

{

box-sizing:border-box;

width:50%;

border:1em silver ridge;

float:left;

}

 

 

HTML code:

<div>

<div>Box 1.</div>

<div>Box 2.</div>

</div>

a.Two boxes will be stacked one on another.

b.Box 1 will be on the left hand side and Box 2 will be on the right hand side horizontally. (Answer)

c.Box 2 will be on the left hand side and Box 1 will be on the right hand side horizontally.

d.Both boxes will overlap each other.

 

Question 36: What will happen if the following declaration is used?

body

{

background-image: url(“test.png”);

background-attachment: fixed;

background-position: 100% 100%;

background-repeat: no-repeat;

}

a.The image will be shown in the background at the bottom left corner.

b.The image will be shown in the background at the bottom right corner. (Answer)

c.The image will be shown in the background at the top left corner.

d.The image will be shown in the background at the top right corner.

e.The image will be shown in the center of the page.

 

Question 37: Consider the following font definition:

font-weight:normal

What is the other way of getting the same result?

a.font-weight:100

b.font-weight:900

c.font-weight:400 (Answer)

d.font-weight:700

 

Question 38: What effect does the following rule have?

div { grid-rows: 4em (0.25em 1em); }

a.It creates rows with 4em height.

b.It creates a header row with 4em height and alternative rows with 0.25em width and 1em heights.

c.It creates a header row with 4em height and alternative rows with 0.25em and 1em heights.(Answer)

d.It creates a header row with 4em width and alternative rows with 0.25em width and 1em heights.

 

Question 39: If the nav-index property of textbox1 is set to 10, that of textbox2 to 5 and that of textbox3 to 8, what will be the navigation order?

a.textbox1, textbox2 ,textbox3

b.textbox2, textbox3 ,textbox1 (Answer)

c.textbox3, textbox2 ,textbox1

d.textbox1, textbox3 ,textbox2

 

Question 40: ruby-text (in XHTML: rt)

Which of the following display values assign ruby semantics to an arbitrary element as given above?

a.It specifies that an element defines a ruby base.

b.It specifies that an element contains one or more ruby bases.

c.It specifies that an element defines a ruby text. (Answer)

d.It specifies that an element contains one or more ruby texts.

e.It specifies that an element defines a ruby structure.

 any html element which support the id attribute

Question 41:Which of the following is true for a classselector?

a.            It usesa hash as the separator symbol

b.            Itapplies the style to only the first element defined with that style

c.            Itapplies the style to only the last element defined with that style

 d.            It applies the style to all the elementsdefined with that style (Answer)

Question 42: Which of the following does not apply to external styles?

a.            Cleanseparation of design & content

b.            Minimalcode duplication

 c.            Highestpriority (Answer)

d.            Reducespage download time

Question 43: Read the following Code:

 BODY { Background: white url(“bar.gif”);

 Background-repeat: repeat-y;

 Background-position: center;

 }

 What will be the output of this code?

 a.            Image bar.gif will be tiled vertically inthe background in the center of the page.(Answer)

b.            Imagebar.gif will be tiled horizontally in the background in the center of the page

c.            Imagebar.gif will be displayed in the center of the page

d.            Imagebar.gif will be stretched in the center of the page

 Question 44: Which of the following is not a validtext-decoration option?

a.           Text-decoration :line-through

 b.           Text-decoration :in-line (Answer)

c.            Text-decoration :overline

d.           Text-decoration :underline

e.           Text-decoration :none

 Question 45: You defined some links as follows:

 A:link{color:green}

 A:visited{color:blue}

 A:hover{color:red)

 A:active{color:black}

 What will be the color, when the mouse goes over a link?

a.            Green

 b.            Blue (Answer)

c.            Red

d.            Black

Question 46:

 The following is a style definition:

 Td#aln

 {text-align:center;

 color:blue}

 How will you refer to this style in your web page?

A. by using the class attribute in a td cell·

 B. by using the id Attribute in a td cell (Answer)·

C. by using the class attribute in any html element which supports theclass attribute·

D. by using the id attribute in anyhtml element which support the id attribute·

Question 47: Which of the following is not a valid propertyof an aural style sheet?

a.            Cue

b.           Voice-family

 c.            Load  (Answer)

d.            Speak

 Question 48:Your website displays some articles on java programming. Thearticles contain blocks of java code as well. If you want to leave ‘1 cm’ spaceabove and below the code blocks, you would use:

 a.           Code{margin:1cm}

 b.           Code{margin-top:1cm; margin-bottom:1cm}  (Answer)

c.           P{margin:1cm}

d.           P{margin-top:1cm; margin-bottom:1cm}

Question 49: Text text text text

 A      Text text

 Sentence text text

 Inside text text

 A         text ext

 Text     text text

 Text text

 Text text text text

 You have and article of 100 lines. If for instance, you wantto describe the theme with a few lines inside the text highlighted separatelyas show in the image which of the following property will you use?

a.            Outline

b.            Display

c.            Float

d.            Merge

 Question 50: You are fetching customer names from a database. The namesin the database are mostly in lowercase. What is the name of the text propertywhich will facilitate capitalization of these names?

a.            Text-mode

 b.           Text-transform (Answer)

c.           Text-decoration

d.           Text-shadow

e.           Text-case

 

Question: 51: Here is one of the styles defined in your webpage:

 .redborder{

 border-color:#ff0000;

border-width:thin thick

}

What type of border will be displayed if one of theparagraphs defined in the webpage uses this style?

a.            Thiswill display a red border with thin top and bottom

b.            Thiswill display a red border with thick top and bottom

c.            Thiswill display a red border with thick left and right

d.            Thiswill not display any border

 

Question 52: Which of the following are correct values ofthe overflow property?

a.            Visible

b.            Hidden

c.            Scroll

d.            Auto

Ans: A,B,C,D

Question 53: Which of the following is correct?

a.           Blockquote{text-padding:2em 4em 5em}

b.           Blockquote{padding-x:2em 4em 5em}

c.           Blockquote{padding-y:2em 4em 5em}

 d.            Blockquote{padding:2em 4em 5em} (Answer)

 Question 54: Which element property is required to defineinternal styles?

a.            Class

b.            Style (Answer)

c.            span

d.            link

Question 55 Which style property can be used to display only some part of an image?

a.            Snap

b.            Clip

c.            Scroll

d.            Visible

 Question 56 Which of the following is not true for a stylesheet?

 a.            A stylesheet defines how an html element will be displayed (Answer)

b.            Internaland external style sheets can not be used together

c.            Multiplestyle definitions will cascade into one

d.            The samestyle sheet can be used by many html pages

 

HTML 4.01 question and answer for oDesk and Elance

This tutorial will cover the HTML 4.01 test for oDesk and Elance. Let’s see

Question:1
What is the character entity representation of the ‘less than’ sign (its entity name is ‘&lt;’) ?
a.     60;#
b.     &#60;
c.     &60#;
d.     #60&;

Question:2
You want to create a link for your website allowing users to email the webmaster. How will you implement this if the
webmaster’s email is “webmaster@xcompany.com”?
a.      <a href=”mailto:webmaster@xcompany.com”>webmaster</a>
b.     <a href=”webmaster@xcompany.com”>webmaster</a>
c.     <a http=”mail:webmaster@xcompany.com”>webmaster</a>
d.     <mail http=”send:webmaster@xcompany.com”>webmaster</mail>
e.     <a href=”mailto://webmaster@xcompany.com”>webmaster</a>

Question:3
You have to add a list of products in a drop-down list. What will you use to group the identical products under a category name?
a.     Optgroup
b.     option
c.     menu
d.     var

Question:4
How will you specify a comment in an XHTML document?
a.     <!!– Here is a comment… –!>
b.     <– Here is a comment.. –>
c.     <!– Here is a comment.. –>
d.     <! Here is a comment… –!>

Question:5
Which of the following is true for the “<param>” tag?
a.     It doesn’t need a closing tag 
b.     The language attribute cannot be specified with it
c.     The name and type attributes are optional
d.     The class, id and title can be specified for it

Question:6
How will you specify the language attribute in XHTML?
a.     <div lang=”en” xml:lang=”en”>Listing A</div>
b.     <div language=”en”>Listing A</div>
c.     <div language=”en” xhtml:lang=”en”>Listing A</div>
d.     <div xml:language=”en”>Listing A</div>

Question:7
Which of the following is incorrect with regard to the <select> tag?
a.     The “name” should be specified
b.     The “disabled” attribute disables the drop-down list
c.     The “multiple” attribute allows the user to choose multiple options
d.     The text specified in the “value” is displayed in the drop-down list
e.     None of the above

Question:8
Which of the following lines will be allowed by an XHTML parser?
a.     <p>This is the starting of a new paragraph
b.     <P>This is the starting of a new paragraph<P>
c.     Here is a break statement <br></br>
d.     New Horizontal line <hr />

Question:9
You are developing a website. In one of the subscription forms, you need to get the subscription start date from the user.
The HTML code is as follows:
Day <input type=”text” size=”3? />
Month <input type=”text” size=”10? />
Year <input type=”text” size=”4? />
Which of the following will you use if you want to put these 3 text fields together in a box?
a.     <legend>
b.     <box>
c.     <fieldset>
d.     <area>

Question:10
Which of the following is incorrect about the relation between HTML and XHTML?
a.     XHTML is a stricter and cleaner version of HTML *
b.     XHTML is almost identical to HTML 4.01
c.     XHTML and HTML both are used to generate dynamic content 
d.     XHTML brings together the elements of HTML and the syntax of XML

Question:11
Which of the following is correct for an image?
a.     An image must be resized in an editor to fit in the specified space on a webpage
b.     If you have a big image but specify smaller height and width attributes in the <img> tag, only the top left portion of the image will be displayed in the browser
c.     Both a and b are correct
d.     The height and width attributes allow resizing the image on the webpage 

Question:12
A <doctype> defines the document type of any XHTML document. It can be of three types:
a.     Strict, Transitional, and Frameset
b.     Strict, Transitional and Loose
c.     Fixed, Intermediate and Loose
d.     Fixed, Intermediate, Frameset

Question:13
Which of the following statements is correct with regard to DTDs?
a.     A strict DTD allows the user to use cascading style sheets
b.     A transitional DTD displays content in those browsers which don’t support CSS
c.     A frameset DTD is used to partition the browser window
d.     All of the above

Question:14
Which of these tags will create a single space character?
a.     <td>
b.     <th>
c.     &nbsp; 
d.     <b>

Question:15
Which of the following  statements is correct for the <blockquote> tag?
a.     The text under blockquote must be enclosed in a block level element in a strict DTD document
b.     The attribute  named “cite” must be specified
c.     Closing the tag is optional
d.     It doesn’t place an empty line after the text

Question:16
A developer wrote this image tag:
<img src =”states.gif” width =”330? height =”406? alt=”States” usemap =”#statemap” />
What code should follow this?
a.     <map id =”statemap” name=”statemap”>

<area shape =”rect” coords =”0,0,82,126? href=”state1.htm” alt=”State1? />

 </map>
b.     <map id =”statemap” name=”statemap”></map>

<area shape =”rect” coords =”0,0,82,126? href=”state1.htm” alt=”State1? />
c.     <map id =”statemap” name=”statemap”>

<imgarea shape =”rect” coords =”0,0,82,126? href=”state1.htm” alt=”State1? /></map>
d.     <map id =”statemap” name=”statemap”></map>

<imgarea shape =”rect” coords =”0,0,82,126? href=”state1.htm” alt=”State1? />

Question:17
Which attributes of the <table> tag is deprecated in HTML 4.01 and not supported in strict DTD XHTML?
a.     Align 
b.     bgcolor
c.     cellspacing

Question:18
Which of the following represents the basic tag structure of an XHTML document?
a.     <html><head><body></body></html>
b.     <html><body></body></html>
c.     <html><head></head><body></body></html>
d.     <html><head></head></html>

Question:19
Please choose the most appropriate option.

One of the differences between XHTML and HTML 4.01 is that the “name” attribute has been replaced by the “id” attribute

in:
a.     img and applet tags
b.     img and map tags
c.     map and frame tags 
d.     img, map, frame and applet tags
e.     frame, applet, style and map tags

Question:20
You have defined the following image in an XHTML document:

<img src=”/image/logo.gif” id=”img1? />
a.     The code will only work properly in a browser that supports XHTML
b.     The code will work properly in a browser that supports both HTML 4.x and XHTML
c.     The code will only work properly in a browser that supports HTML 4.x
d.     The code is incorrect, it will not work in any browser

Question no. 21
The tag which is used to show monospaced text is:
a. <td>
b. <th>
c. <tt> 
d. <b>

Question no. 22
What would you infer from the following code in an HTML 4.01 Web site? <body topmargin=2 leftmargin=2>
a. The top margin and left margin of the webpage is 2 pixels.
b. The bottom margin and right margin of the web page is 2 pixels.
c. Both of the above.
d. None of the above. The topmargin and leftmargin attributes are not valid HTML 4.01 body attributes.

Question no. 23
You want to display a table listing out customer names and their contact information. The heading of the table is shown in the figure. What is the code for creating the first line of the table heading?
a. <tr>
<th>Customer Name</th>
<th colspan=3>Contact</th>
</tr>
b. <tr>
<th>Customer Name</th>
<th cellpadding=3>Contact</th>
</tr>
c. <tr>
<th>Customer Name</th>
<th rowspan=3>Contact</th>
</tr>
d. <tr>
<th>Customer Name</th>
<th cellspacing=3>Contact</th>
</tr>
<tr> <th>Customer Name</th> <th cellpadding=3>Contact</th> </tr>

Question no. 24
A developer wrote this image tag:
<img src =”states.gif” width =”330″ height =”406″ alt=”States”
usemap =”#statemap” />
What code should follow this?
a. <map id =”statemap” name=”statemap”>
<area shape =”rect” coords =”0,0,82,126″ href=”state1.htm”
alt=”State1″ />
</map> 
b. <map id =”statemap” name=”statemap”> </map>
<area shape =”rect” coords =”0,0,82,126″ href=”state1.htm”
alt=”State1″ />
c. <map id =”statemap” name=”statemap”>
<img area shape =”rect” coords =”0,0,82,126″ href=”state1.htm”
alt=”State1″ /> </map>
d. <map id =”statemap” name=”statemap”>
<img area shape =”rect” coords =”0,0,82,126″ href=”state1.htm”
alt=”State1″ /> </map>

Question no: 25
A few lines in an HTML paragraph are to be formatted differently from the rest of the lines. Which tag will assist in this?
a. div
b. p
c. span 
d. format

Question no. 26
Which of the following attributes comes in handy when borders have to be put between groups of columns instead of every column?
a. col
b. colgroup 
c. rowspan
d. row

Question no. 27
Which of the following set of coordinate values refers to an image defined by the area tag with the value of poly for its shape attribute?
a.coords=”150,217,190,257,150,297,110,257″
b.coords=”150,190,150,110″
c.coords=”150,217,190,257,150″
d. coords=”150,110,190,220,150,150,120″

Question no. 28
For the following items of a <select> list:
<option value=”89″>Item 1</option>
<option value=”90″>Item 2</option>
Which of the following values would be passed on by clicking the submit button on selecting Item 2 from the list?
a. 89
b. 90
c. Item 1
d. Item 2

Question no. 29
The tag that is used to pass the parameters to an applet is:
a. appletpar
b. applet
c. param  
d. val

Question no. 30
Which of the following values for the scrolling attribute for the frame tag is not valid?
a.yes
b.default
c.auto
d. no

Question no. 31
Is the following code valid in HTML 4.01 Strict?
<ul><li><ol><li>A</li><li>B</li><ul><li>Item1</li><li>Item 2</li></ul><li>C</li></ol></li></ul>
a. Perfectly valid. 
b. Invalid because you should not have three levels of nesting in the lists.
c. Invalid because you should not have an unordered list within an ordered list.
d. Invalid because a <ul> tag should not conflict with an <ol> tag at the same list level.

Question no. 32
The following link is placed on an HTML webpage.
<a href=”http://msdn.com/” target=”_blank”> MSDN </a>
What do you infer from it?
a. It will open the site msdn.com in the same window.
b. It will open the site msdn.com in a new window. 
c. It will open the site msdn.com in a frame below.
d. It will not be clickable as it is not formed correctly.

Question no. 33
Which of the following attributes is/are related to the <img> tag?
a. height
b. alt
c. src
d. All of the above

Question no. 34
You are creating several web pages for a website that contain several rather large data tables, many of which are somewhat similar in the number of columns, rows, and in other common table formatting. In addition, CSS will be employed for formatting the tables. Which one of the following types of CSS has the highest priority over the others and typically requires the greatest total amount of code space for the entire website for formatting the various <td> table cells?
a.External style sheet
b.Inline style 
c.Internal style sheet
d. Browser default

Question no. 35
A piece of text contains many blank spaces within it. Which of the following tags would be suitable to display the text as it was originally formatted?
a.td
b.p
c.ls
d. pre 

Question no. 36
Which of the following is/are not true for a paragraph tag in HTML 4.01?
a. The text must be enclosed in <p> and </p> tags.
b. It creates an empty line above its starting line.
c. It cannot be used within a <td> tag.
d. It creates an empty line after its ending line.

Question no. 37
Which of the following statements is correct for the tag?
a. The text under block quote must be enclosed in a block level element in a strict DTD document.
b. The attribute named cite must be specified.
c. Closing the tag is optional.
d. It places an empty line after the text.

Question no. 38
What do you infer from the following code? <a href = “http://www.expertrating.com”> Expert Rating
a.This href is using absolute path for linking. 
b. This href is an example of relative path linking.

Question no. 39
Which of the following values is/are valid for the align attribute of a tag?
a.left 
b.right  
c.center
d. offset

Question no. 40
Which of the following is/are a valid value for the type attribute of the input tag?
a. text
b. icon
c. reset 
d. password

Question:41

What do you understand by cellspacing?

a.     It makes the cell span more than one column
b.     It specifies the space between the cell wall and the contents of the cell
c.     It specifies the space between two cells
d.     It makes the cell span more than one row

Question:42
Which of the following statements is true about the table header, body and footer tags?
a.     The table header, body and footer tags are <tablehead>, <tablebody> and <tablefoot> respectively
b.     The table header, body and footer tags are <tabhead>, <tabbody> and <tabfoot> respectively
c.     It is recommended to first specify the table header followed by the footer and then the body tag 
d.     None of the above

Question:43
Which attribute specifies the submit URL in a form?
a.     method
b.     Action
c.     name
d.     id

Question:44
Which of the following is not correct for a <meta> tag?
a.     It is more useful if it is placed in a head element
b.     It can be used to specify the keywords for the search engines
c.     It can be used to redirect users to other URLs
d.     It is mandatory to specify the name or scheme attributes

Question:45
What do you understand by the following line of code?

<html xmlns=”http://www.w3.org/TR/REC-xml-names”>
a.     xmlns specifies the URL to qualify the names used in the XHTML document
b.     xmlns means html-xml number sequence
c.     Elimination of xmlns tag will result in the document not being validated by a w3.org validator
d.     The page will not be displayed properly if the URL is changed to “http://www.w3.org/1999/xhtml”

Question:46
The following registration form was coded by a programmer in XHTML:
1. <!– Start of the Form Fields –>
2. Name:
3. <input type=”text” name=”name” maxlength=”50? />
4. Registration Date:
5. <input readonly type=”text” value=”javascript:getDate();” />
6. Account Type:
7. <select name=”Account”>
8. <option “selected” value=”Primary”>Primary</option>
9. <option value=”Secondary”>Secondary</option>
10. </select>

Which of the following options is true with regard to this XHTML document?
a.     The syntax of the input tag at line 3 is incorrect
b.     The readonly attribute in line 5 is not correctly coded
c.     The syntax of the select tag is not correct
d.     Maxlength cannot be specified with text boxes

Question:47
Take a look at the following code:
<html>
<head>
<title>HTML AND XHML</title>
<body>
<h1>Defining HTML
</body>
What will happen when you run this code in the browser?
a.     With a .html extension, the page will be displayed with errors
b.     With a .html extension, the page will not be displayed at all
c.     With a .xhtml extension, the page will be displayed with errors
d.     With a .xhtml extension, the page will not be displayed at all

Question:48
On one of your web pages named “Listing.xhtml” you specified a target like this:
<a name=”target4?>Old Listing</a>
How will you make a link to the above target?
a.     <a url=”#target4?>Check Old Listing as well</a>
b.     <a href=”#target4?>Check Old Listing as well</a>
c.     <link url=”target4?>Check Old Listing as well</link>
d.     <a href=”Listing.target4?>Check Old Listing as well</a>

Question:49
You placed four radio buttons on a web form. You want the users to specify whether they are male or female and whether
they are married or single. The code is as follows:
Male: <input type=”radio” checked=”checked” name=”chk” value=”male” />
Female: <input type=”radio” name=”chk” value=”female” />
Married: <input type=”radio” checked=”checked” name=”chk” value=”married” />
Single: <input type=”radio” name=”chk” value=”single” />
What is wrong with the above code?
a.     It will allow the user to choose only the male and the married options
b.     It will allow the user to choose only the female and single options  
c.     It will allow the user to choose only one option out of the four
d.     It will allow the user to choose all the four options at the same time

Question:50
You specified a base tag and anchors as follows:
1. <base target=”_blank”></base>
2. <a href=”http://www.yahoo.com”>Yahoo</a>
3. <a href=”http://www.google.com” target=”_top”>Google</a>

 

Which of the following is true for the above code?
a.     Only the Yahoo link will open in a new window
b.     Only the Google link will open in a new window
c.     Both links will open in a new window
d.     Both links will open in the same window

Question:51
Which of the following is correct regarding the frame attribute of the table tag?
a.     It is used to add a frame to the table *
b.     A “hsides” frame attribute will show the border lines for horizontal sides of the table only
c.     A “hsides” frame attribute will not show the border lines for horizontal sides of the table only
d.     A “hsides” frame attribute will add a scrollable frame on the horizontal sides of the table

Question:52
Which of the following is correct about the <!DOCTYPE …> tag?
a.     It is not considered to be mandatory as per the XHTML specification
b.     It must have a closing tag
c.     It should come just after the <html> tag
d.     Its declaration is not a part of the XHTML document itself
e.     None of the above

Question:53
What do you understand by cellpadding?
a.     It makes the cell span more than one column
b.     It specifies the space between the cell wall and the contents of the cell
c.     It specifies the space between two cells
d.     It makes the cell span more than one row

Question:54
Your website has moved to some other address. How will you automatically redirect a user to that address within 3 seconds

of landing on the old address?
a.     <meta http-equiv=”refresh” content=”3; url=http://www.newurl.com” /> 
b.     <meta http=”refresh” url=”www.newurl.com” />
c.     <meta scheme=”refresh” name=”redirect” http=”www.newurl.com” />
d.     <meta http-equiv=”redirect” content=”3? http=”www.newurl.com” />

Question:55
You want to provide a form field to the users for writing lengthy comments on the quality of the services provided by you.

Which of the following tags will you use?
a.     <textarea rows=”8? cols=”20?> Your comments ….</textarea> 
b.     <textarea row=”8? col=”20?> Your comments ….</textarea>
c.     <textarea rowcount=”8? colcount=”20?> Your comments ….</textarea>
d.     <input type=”text” maxlength=”100? />

Question:56
Your browser supports bidirectional text. Which tag will you use if you need to display text from right to left?
a.     <opposite>Text should go in opposite direction</opposite>
b.     <p direction=”rtl”>Text should go in opposite direction</p>
c.     <bdo dir=”rtl”>Text should go in opposite direction</bdo>  
d.     <text dir=”rtl”>Text should go in opposite direction</text>

Question:57
While writing a strict DTD XHTML document, you want to create a table having 2 columns, both left aligned. What technique
will you choose to do this?
a.     <table align=”left” border=”1?>

<tr><td>Plan A </td>

<td align=”left”>Monthly payment of $60</td>

</tr>

. . .

. . .

</table>
b.     <table border=”1?>

<tr><td align=”left”>Plan A</td>

<td align=”left”>Monthly payment of $60</td>

</tr>

. . .

. . .

</table>
c.     <table align=”left” border=”1?>

<tr><td align=”left”>Plan A</td>
<td align=”left”>Monthly payment of $60</td>
</tr>

. . .

. . .

</table>
d.     <table border=”1?>

<tr><td align=”left”>Plan A</td>
<td>Monthly payment of $60</td>
</tr>
. . .
. . .
</table>

Question:58
Within a table cell “<td>”:
a.     <p></p> tags can’t be used
b.     <ol></ol> tags can’t be used
c.     <table></table> tags can’t be used
d.     <form></form> tags can’t be used
e.     All the above tags can be used 

Question:59
While designing the links page of your website, you want the link to open in a new window. How will you implement this
with XHTML using Transitional doc type?
a.     <anchor href=”http://www.mailer.com”>Mailer</anchor>
b.     <anchor href=http://www.mailer.com target=_blank>Mailer</anchor>
c.     <A HREF=”http://www.mailer.com”>Mailer</A>
d.     <a href=”http://www.mailer.com” target=”_blank”>Mailer</a>  

Question:60
How will you import a style sheet named “basic.css” in your web page?
a.     <import name=”stylesheet” url=”basic.css”>
b.     <link rel=”stylesheet” type=”text/css” href=”basic.css”/>
c.     <style name=”stylesheet” url=”basic.css”>
d.     <link item=”stylesheet” type=”text/css” href=”basic.css”>

Question no. 61
It is not necessary to give the coordinates for an image or object defined within an area tag, if the value of its shape attribute is:
a.circle
b.poly
c.default
d. rect

Question no. 62
Which of the following is not a valid input type of the form tag?
a. checkbox
b. image
c. hidden
d. button
e. All are valid

Question no. 63
Which of the following tags can be used in place of a button tag?
a. legend
b. ol
c. input
d. dl

Question no. 64
Choose the incorrect statement(s):
a. An HTML attribute is additional information included inside a tag.
b. HTML is case sensitive.
c. All the HTML4.01 tags must be paired.
d. Your browser may appear to correctly use newly deprecated code for the present, but its support for deprecated code could be
halted at any time after the browser is updated.

Question no. 65
Which of the following statements is correct for a blockquote?
a. It make the text a bit bigger for emphasizing.
b. It defines the start of a long quote.
c. It makes the text slightly bolder.
b. It defines the start of a long quote.

Question no. 64
Choose the incorrect statement(s):
a. An HTML attribute is additional information included inside a tag.
b. HTML is case sensitive.
c. All the HTML4.01 tags must be paired.
d. Your browser may appear to correctly use newly deprecated code for the present, but its support for deprecated code could be
halted at any time after the browser is updated.

Question no. 65
Which of the following values is/are valid for the align attribute of a tag?
a.left  
b.right  
c.center
d. offset

Question no. 66
What would you infer from the following code in an HTML 4.01 Web site? <body topmargin=2 leftmargin=2>
a. The top margin and left margin of the webpage is 2 pixels.
b. The bottom margin and right margin of the web page is 2 pixels.
c. Both of the above.
d. None of the above. The topmargin and leftmargin attributes are not valid HTML 4.01 body attributes.

Question no. 67
You do not want to resize the frame. The code should be:
a. <frame src = “MyPage.html” name=”HomePage” scrolling=Yes resize = “false”>
b. <frame src = “MyPage.html” name=”HomePage” scrolling=Yes resize = “true”>
c. <frame src = “MyPage.html” name=”HomePage” scrolling=Yes noresize = “true”>
d.<frame src = “MyPage.html” name=”HomePage” scrolling=Yes noresize = “noresize “>

Question no. 68
Which of the following is not an atribute of meta tag?
a. name
b. content
c. type
d. http-equiv

Question no. 69
Choose the incorrect statment.
a. The <em> tag emphasizes the given text by italiczing.

b. The <code> tag indicates that the text inside is an example of typed code.
c. The <var> tag indicates that the text inside the tag has been revised 
d. The <strong> tag strongly emphasizing the text

Question no. 70
The tag is used to pass the parametrs to an applet is:
a. appletpar
b. applet
c. param
d. var

Question no. 71
Which form event is fired on the click of a button tag with its type atribute value equal to submit.
a. onload
b. onsubmit 
c. onload
d. onreset

 

 

Difference between mysql_connect and mysql_pconnect in PHP

mysql_connect and mysql_pconnect both is php function which works with the database connection but with little difference.In the mysql_pconnect “P” stands for persistance connection for the database.Persistent connections are links that do not close when the execution of your script ends.

When we are using  mysql_connect function then always it’s opening and ending the database connection, depending on the request.

But if you using the mysql_pconnect function then  the function would try to find a (persistent) connection that’s already open with the same host, username and password.and if it exists, it uses it.If it does not exist, it creates the link. An ‘identical’ connection is a connection that was opened to the same host, with the same username and the same password (where applicable).

that’s is the difference between mysql_connect  and mysql_pconnect. 

NB: But for general use mysql_connect() is best.