Create Your Own Juicy Tabbed Slider

Thanks again i'm back with a very helpful tutorial of Slider for Your Website. We’ll be using the popular Nivo Slider to handle the animation, so let’s dig in!  

Download Source Files 

Demo View It Online


Let’s Dig In!

Alright, so assuming that you’ve gone through the design phase of this tutorial, now you should have a pretty basic slider element in Photoshop (or Fireworks) format. I’m going to write up this tutorial as a “standalone” slider – meaning it’ll essentially be the only element on the page that we create… but using just a few extra steps after the fact, you should be able to add this to your own designs and position/resize it any way that you want!
What’s better is that this is completely skinnable and resizable – so if you’ve made any heavy customizations in the free PSD that we handed out, you’ll be able to incorporate your franken-modifications here as well!

Step 1: Download the Nivo Slider


Go ahead and download the latest version of the Nivo Slider from their page. The version we’ll be using is Version 2.4, but unless they completely overhaul their entire codebase, chances are very good that the steps in this tutorial will still work in version 2.5, 2.6, and ever onward.
It’s important to note that we’re not re-inventing the wheel here. We’re pretty much just going to be using their “demo.html” file as our own base of operations. We won’t deviate far from the official Usage Documentation either.
As a web designer, I do a lot of work where I’m simply modifying and hijacking other people’s open source code – you probably do the same. It’s an important skill to have unless you’re intent on learning each and every major coding language out there and you’re willing to constantly keep your knowledge up to date. Frankly, I think that’s kind of silly – so figuring out how to use other people’s code is one of the most important skills that you can have.
In most cases (as in this one), all that’s truly required is a rough knowledge of HTML and CSS and the ability to read documentation.
We’ll start out the next step by opening up the “demo” folder – so go ahead and do that before we move on.

Step 2: Understanding the Basic Setup

In this step, we’re simply going to attempt to get an idea for how the Nivo Slider works. Every slider out there is going to work a little bit different, so it’s worth taking a few minutes to familiarize yourself with the particular script that you intend to use on a project.
If you take a quick look at the code for the Nivo Slider (inside the demo.html file), you’ll notice that all of the major styling and structure is being handled from the “style.css” file. In fact, the actual HTML code is pretty simple once you’ve referenced the appropriate scripts in the HEAD section of demo.html.
Let’s start our walkthrough by looking at the lines of code from the header. We won’t need to change these, but they need to be present in any file that we want to use the slider on:
  1. <!-- Usually in the <head> section -->  
  2. <link rel="stylesheet" href="nivo-slider.css" type="text/css" media="screen" />  
  3. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>  
  4. <script src="jquery.nivo.slider.pack.js"></script>  
Next, let’s peek at the raw HTML that generates the slider:
  1. <!-- Then somewhere in the <body> section -->  
  2. <div id="slider">  
  3.     <img src="images/slide1.jpg" alt="" />  
  4.     <a href="http://dev7studios.com">  
  5.         <img src="images/slide2.jpg" alt="" title="#htmlcaption" />  
  6.     </a>  
  7.     <img src="images/slide3.jpg" alt="" title="This is an example of a caption" />  
  8.     <img src="images/slide4.jpg" alt="" />  
  9. </div>  
Finally, we won’t be dealing with captions in this particular slider, so you can pretty much disregard the next lines (unless you want to do your own customization of the slider later on):
  1. <div id="htmlcaption" class="nivo-html-caption">  
  2.     <strong>This</strong> is an example of a <em>HTML</em> caption with <a href="#">a link</a>.  
  3. </div>  
So, really, all that’s required for you to understand is the basic HTML that generates the slider (shown above in the second block of code). Since we won’t be dealing with captions in our slider, you can further simplify the code to something like this:
  1. <div id="slider-wrapper">  
  2.     <div id="slider">  
  3.         <img src="images/slide1.jpg" alt="" />  
  4.         <img src="images/slide2.jpg" alt="" />  
  5.         <img src="images/slide3.jpg" alt="" />  
  6.         <img src="images/slide4.jpg" alt="" />  
  7.     </div>  
  8. </div>  
That’s not so bad right? It’s essentially just a couple wrapped DIV elements with images inside.

The CSS for the Nivo Slider

The CSS is what’s going to be doing the heavy lifting, so let’s take a peek at that:
  1. /*============================*/  
  2. /*=== Custom Slider Styles ===*/  
  3. /*============================*/  
  4. #slider-wrapper {  
  5.     background:url(images/slider.png) no-repeat;  
  6.     width:998px;  
  7.     height:392px;  
  8.     margin:0 auto;  
  9.     padding-top:74px;  
  10.     margin-top:50px;  
  11. }  
  12.   
  13. #slider {  
  14.     position:relative;  
  15.     width:618px;  
  16.     height:246px;  
  17.     margin-left:190px;  
  18.     background:url(images/loading.gif) no-repeat 50% 50%;  
  19. }  
  20. #slider img {  
  21.     position:absolute;  
  22.     top:0px;  
  23.     left:0px;  
  24.     display:none;  
  25. }  
  26. #slider a {  
  27.     border:0;  
  28.     display:block;  
  29. }  
  30.   
  31. .nivo-controlNav {  
  32.     position:absolute;  
  33.     left:260px;  
  34.     bottombottom:-42px;  
  35. }  
  36. .nivo-controlNav a {  
  37.     display:block;  
  38.     width:22px;  
  39.     height:22px;  
  40.     background:url(images/bullets.png) no-repeat;  
  41.     text-indent:-9999px;  
  42.     border:0;  
  43.     margin-right:3px;  
  44.     float:left;  
  45. }  
  46. .nivo-controlNav a.active {  
  47.     background-position:0 -22px;  
  48. }  
  49.   
  50. .nivo-directionNav a {  
  51.     display:block;  
  52.     width:30px;  
  53.     height:30px;  
  54.     background:url(images/arrows.png) no-repeat;  
  55.     text-indent:-9999px;  
  56.     border:0;  
  57. }  
  58. a.nivo-nextNav {  
  59.     background-position:-30px 0;  
  60.     rightright:15px;  
  61. }  
  62. a.nivo-prevNav {  
  63.     left:15px;  
  64. }  
  65.   
  66. .nivo-caption {  
  67.     text-shadow:none;  
  68.     font-familyHelveticaArialsans-serif;  
  69. }  
  70. .nivo-caption a {   
  71.     color:#efe9d1;  
  72.     text-decoration:underline;  
  73. }  
If you’re new to CSS, this might look intimidating at first… but most of you will see this for a fairly simple bit of styling code. Everything you need to resize and reskin the slider is here… and we only need to change a handful of lines of script to get this thing looking exactly like our version.
First though, we need to locate and re-skin the images that are currently being used for the slider with our own. If you open up the “/demo/images/” folder, you’ll see there’s just a couple main images that we want to reskin:
  • arrows.png (the Left / Right arrows)
  • bullets.png (the Dot indicators)
  • slider.png (the background frame)
  • background.png (optional)
  • loading.png (optional)

Re-skinning the Assets

If we were coding this slider from scratch, we’d probably start by carefully chopping it in Photoshop, piece by piece. However, since we’re working with a pre-existing set of “assets” (aka, the images used to create the background, bullets and arrows), it’s going to make a little bit more sense to skin the pre-existing assets rather than start from scratch.

Reskin the Bullets

Let’s start with the “bullets.png” file since it happens to be the most straight forward file. Go ahead and open it up in Photoshop:
Notice the basic structure of the file here. There are two graphics that will be positioned using CSS so that one appears at a time.
We already have our own bullet graphics from our own PSD, so we simply want to position them over the original elements and re-save the file:
In this case, we don’t even need to re-size the file at all… so we’re actually done reskinning the bullets! Save this new file over the original “bullets.png”.

Reskin the Arrows

The arrows are going to be one level more difficult, simply because our arrow graphics are larger than the original graphics. That’s fine though – we’ll still start by opening up the “arrows.png” file inside Photoshop.

It’s hard to see the arrows because they are transparent.
Once again, notice the structure of the file – two arrows, side by side this time – that will be positioned using CSS so that only one appears at a time.
The size of the graphic is 60x30px… but ours will have to be large enough to hold both of our bigger arrows. Having measured our own arrows (you can do this using the Rectangular Marquee tool and the Info panel), I’ve decided that the new dimensions should be 70x65px. This will be large enough to hold both arrows, as well as the light shadow that we want to appear next to each one.
We’re going to have to make a few changes to the size and positioning in the CSS, but this completes the initial reskin for the arrows. Save this new file over the original “arrows.png”.

Reskin the Background

Lastly, let’s re-skin the background graphic. The Nivo Slider demo uses an abstract sort of circle background – but we want to use our “frame and shadow” graphic for the background.
This swap is going to be similar to what we did with the arrows, but instead of needing to make our image larger, this time we actually need to save a smaller document. Notice how large the original image is:

998x392px – Scaled Down for the Site.
998x392px is the original background’s dimensions – We want it to be closer to 494x310px to match our own frame. This isn’t tough, but it’s a case where it’s going to make more sense just to grab a direct slice from our original PSD file.
Go ahead and turn off ALL layers (including the background) other than the frame and the shadow, then Crop the image down to about 20-25px of spacing around the frame just to be safe (we won’t want to accidentally crop our shadow):
As with the last two graphics, go ahead and save directly over the original image “slider.png”.

Save Our Image Slides

The original slider uses images that are 618×246 in size. Our slider uses images that are 430x250px though, so we need to save over the original slide images using our own cropped in versions. You can obviously use your own images here… but for the sake of simplicity, I’ve just cropped in the Pixar images that the demo used.
If you did want to use your own images, obviously you’ll want to name them uniquely (my_image1.jpg, my_image2.jpg, etc.), and then amend the image paths inside the demo.html document.

Tweaking the CSS to Fit Our New Skinned Images

The last step here is probably the trickiest as it requires a lot of trial and error. Our objective is going to be to tweak the original style.css file so that our slider matches our own design. The primary problem is that the original slider uses completely different dimensions for most of the major elements, so we need to carefully, through trial and error, sort out what our own dimensions should be.
Trial and Error in CSS can be done a few different ways – The “hard” way is to simply keep on tweaking the CSS file, saving it, and then previewing it in the browser. The easy way is to use a browser plugin like Firebug to actually test out your adjustments in the browser itself. If you haven’t picked up Firebug yet, I highly recommend doing so now. It’s a simple plugin that attaches to your browser.
I’m going to simply dish out the completed CSS file right now, then we’ll break it down step by step. I’ll mark every major line that was edited with a “/*= NEW =*/” note:
  1. /*============================*/  
  2. /*=== Custom Slider Styles ===*/  
  3. /*============================*/  
  4. #slider-wrapper {  
  5.     background:url(images/slider.png) no-repeat;  
  6.     width:494px/*= NEW =*/  
  7.     height:310px;  /*= NEW =*/  
  8.     margin:0 auto;  
  9.     padding-top:23px/*= NEW =*/  
  10.     margin-top:50px;  
  11. }  
  12.   
  13. #slider {  
  14.     position:relative;  
  15.     width:430px;  /*= NEW =*/  
  16.     height:250px;  /*= NEW =*/  
  17.     margin-left:32px;  /*= NEW =*/  
  18.     background:url(images/loading.gif) no-repeat 50% 50%;  
  19. }  
  20. #slider img {  
  21.     position:absolute;  
  22.     top:0px;  
  23.     left:0px;  
  24.     display:none;  
  25. }  
  26. #slider a {  
  27.     border:0;  
  28.     display:block;  
  29. }  
  30.   
  31. .nivo-controlNav {  
  32.     position:absolute;  
  33.     left:163px;  /*= NEW =*/  
  34.     bottombottom:12px;  /*= NEW =*/  
  35.     background#000000;  /*= NEW =*/  
  36.     -moz-border-radius: 10px;  /*= NEW =*/  
  37.     -webkit-border-radius: 10px;  /*= NEW =*/  
  38.     padding3px;  /*= NEW =*/  
  39.     border2px solid #CCC;  /*= NEW =*/  
  40.     opacity: 0.7;  /*= NEW =*/  
  41.     z-index: 99;  /*= NEW =*/  
  42.     }  
  43.       
  44.     .nivo-controlNav:hover{opacity: 1;}  /*= NEW =*/  
  45.       
  46. .nivo-controlNav a {  
  47.     display:block;  
  48.     width:22px;    
  49.     height:22px;   
  50.     background:url(images/bullets.png) no-repeat;  
  51.     text-indent:-9999px;  
  52.     border:0;  
  53.     margin-right:0px;  /*= NEW =*/  
  54.     float:left;  
  55. }  
  56. .nivo-controlNav a.active {  
  57.     background-position:0 -22px;  
  58. }  
  59.   
  60. .nivo-directionNav a {  
  61.     display:block;  
  62.     width:35px;  /*= NEW =*/  
  63.     height:65px;  /*= NEW =*/  
  64.     background:url(images/arrows.png) no-repeat;  
  65.     text-indent:-9999px;  
  66.     border:0;  
  67. }  
  68. a.nivo-nextNav {  
  69.     background-position:-35px 0;  /*= NEW =*/  
  70.     rightright: -40px;  /*= NEW =*/  
  71. }  
  72.   
  73. a.nivo-nextNav:hover{rightright: -41px;}  /*= NEW =*/  
  74.   
  75. a.nivo-prevNav {  
  76.     left:-40px;  /*= NEW =*/  
  77. }  
  78. a.nivo-prevNav:hover{left: -41px;}  /*= NEW =*/  
  79.   
  80. .nivo-caption {  
  81.     text-shadow:none;  
  82.     font-familyHelveticaArialsans-serif;  
  83. }  
  84. .nivo-caption a {   
  85.     color:#efe9d1;  
  86.     text-decoration:underline;  
  87. }  
  88.   
  89. .nivo-directionNav a{top: 40%;}  /*= NEW =*/  
Looking closely, you’ll notice that all of the changes (with the “/*= NEW =*/” note) fall into the same basic categories:
  • Width
  • Height
  • Positioning (left, right, top, bottom)
The only two exceptions are where we’ve added the background color and rounded corners to the “.nivo-controlNav” element and where we’ve adjusted the default positioning of the “.nivo-directionNav a” element (this second one was previously set by another stylesheet, so we’re overriding the default setting of 45% so our arrows are higher up on the slider).
The other new rule that we’ve added is the “a.nivo-prevNav:hover{left: -41px;}” rules for the left and right buttons. The purpose here is to add a subtle nudge to each button when you mouse over them.
If you’re planning on creating your own resized version of the slider, you’ll want to pay attention to the two spots where the overall height and width of the slider are set. In short, the “#slider-wrapper” and “#slider” elements are what control this – simply adjust the height and width parameters to match your own slider’s dimensions and you should be good to go.

Last Step – UnHiding the Left/Right Arrows

The final modification that I’ve decided to make from the original demo.html file is to unhide the arrow buttons. By default, the Nivo Slide hides these “directional” navigation controls – only showing them when your mouse is hovering over the slider. For us though, these elements are a key aesthetic that we wouldn’t want to hide.
To correct this, the Nivo Slider gives us a simple method of unhiding by adding a single option to the activation script. At the bottom of the demo.html file, find the following:
  1. <script>  
  2.     $(window).load(function() {  
  3.        $('#slider').nivoSlider();  
  4.    });  
  5.      
Now simply add the following option:
  1. directionNavHide:false  
So that the revised code looks like this:
  1. <script>  
  2.     $(window).load(function() {  
  3.         $('#slider').nivoSlider({directionNavHide:false});  
  4.     });  
  5.       
  6.   
  7. There is a full list of customizations that you can make through this method - check out the <a href="http://nivo.dev7studios.com/#usage" onclick="javascript:_gaq.push(['_trackEvent','outbound-article','nivo.dev7studios.com']);">Usage Page on Nivo Slider's</a> website for more notes.  

Conclusion

That’s it for this tutorial! While we haven’t coded a single thing from scratch, we have effective created a custom slider and then realized it in code using one of the best pre-built slider scripts out there on the net right now. I hope you’ve picked up a few new skills in this walkthrough – have fun customizing this and using it in your own design!

Create Custom Page Templates in WordPress

Hi , Today i will talk to yours about Custom template Page in Wordpress , a faculty member at the University of Texas at Dallas (UTD), will demonstrate how to take a typical blog structure, and morph it into custom layouts. Along the way, he discusses the inherent differences between posts and pages, how to create custom page templates, how to expedite the process of adding custom fields, and more.



Thank you so much

Odesk CSS 3 Test Answer 2013

Question:
What will happen if the pause property is used as follows?
h2 { pause: 40s 60s }
Top of Form
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.Bottom of Form

 Question:
Which of the following properties doesn"t take up space?
a. outline (Answer)
b. border
c. Both a and b

Question:
backface-visibility:hidden; will this property hide the back side when an element is rotated?
a.Yes  (Answer)
b.No

 Question:
What is the initial value of the animation-iteration-count property?
a.0
b.1 (Answer)
c.5
d.None
 Question:
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:
A/An___________ is defined with 'grid-columns', 'grid-rows' propertie
a.Explicit grid (Answer)
b.Natural grid
c.Default grid
d.None of the above
               
 Question:
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:
Which of the following is the initial value for the column-fill property?
a.auto
b.balance (Answer)
c.none
 Question:
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:
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:
What is the type of the letter-spacing property?
a.length
b.number (Answer)
c.percentage
d.integer

 Question:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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 class="container">
<div class="split">Box 1.</div>
<div class="split">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:
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:
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:
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:
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:
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.
Question:
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:
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:
To which of the following elements can the min-width property not be applied?
a.button
b.span    (Answer)
c.table row

Question:
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:Consider the following code:
<style>
.name::after { content: leader(solid) }
</style>
<div class="entry">
<span class="name">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:
What is the default value of the text-align property?
a.start
b.end
c.left     (Answer)
d.right
e.center
f.justify

Question:   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:
What is the initial value of the opacity property?
a.0
b.1      (Answer)
c.normal
d.none
Question:
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:
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:
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:
For the clear property, which of the following value is not valid?
a.none
b.left
c.right
d.top    (Answer)
Question:
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:
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

HTML5 Test Answer

Question:
You want to display a table listing out customer names and their contact information. The heading of the table is shown in the given figure. What is the code for creating the first line of the table heading?
a.            <tr>
<th>Customer Name</th>
<th rowspan=3>Contact</th>
</tr>
b.            <tr>
   <th>Customer Name</th>
   <th colspan=3>Contact</th>
 </tr>
c.             <tr>
<th>Customer Name</th>
<th cellpadding=3>Contact</th>
</tr>
d.            <tr>
<th>Customer Name</th>
<th cellspacing=3>Contact</th>
 </tr>
Question:
What is the default background color for the canvas element in HTML 5.0?
a.            Black
b.            White
c.             Transparent
                d.            Gray
Question:
Which of the following are valid values for the contenteditable attribute of the <figure> element in HTML 5.0?
a.            true
b.            false
c.             0
                d.            1
Question:
Which media event is triggered when there is an error in fetching media data in HTML 5.0?
a.            onstalled
b.            onwaiting
c.             onsuspend
                d.            oninvalid
Question:
Which of the following is NOT a valid attribute for the <link> element in HTML 5.0?
a.            hreflang
b.            rel
c.             http-equiv
                d.            media
Question:
Which of the following HTML 5.0 elements is used to embed Java applets into your HTML 5.0 web page?
a.            <applet>
b.            <object>
c.             <source>
                d.            <progress>
Question:
How does a button created by the <button> tag differ from the one created by an <input> tag?
a.            An input tag button can be a reset button too.
b.            A button tag button can be a reset button too.
c.             An input tag button can include images as well.
                d.            A button tag can include images as well.
Question:
Which form event is fired on the click of a button using a button tag with its type attribute value equal to submit?
a.            onload
b.            onsubmit
c.             onunload
                d.            onreset
Question:
How will you return a reference to the parent of the current window or subframe in an HTML 5.0 web application?
a.            window.top
b.            window.parent
c.             window.frameElement
                d.            None of the above
Question:
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:
Which of the following video file formats are currently supported by the <video> element of HTML 5.0?
a.            CCTV
b.            MPEG 4
                c.             Ogg
                d.            3GPP
This question is based upon the figure shown below
Question:
Suppose you add the input code given above to your HTML web page. What result will be returned by the JavaScript function when you click the button marked as A in the image?
a.            number
b.            text
c.             button
                d.            None of the above
Question:
Which of the following statements is correct if you allow the user to select only one radio button from a group of radio buttons?
a.            The name of the input tag must be the same for all the radio buttons.
b.            The value of the input tag must be the same for all the radio buttons.
c.             The display text of the input tag must be the same for all the radio buttons.
                d.            All the radio buttons must be added to the same group using the <optgroup> tag.
Question:
What will be the result if you use the following code to your HTML 5.0 document?
<bdo dir=”rtl”>
Here is some text that should be written to your document.
</bdo>
a.            .tnemucod ruoy ot nettirw eb dluohs taht txet emos si ereH
b.            Here is some text that should be written to your document.
c.             Here is some text that should be written to your document.
                d.            None of the above.
Question:
Which of the following would give a yellow background to the web page?
Note: The code used in the “correct” answer below was deprecated in HTML 4.01! Use styles instead for new code.
a.            <body backcolor=”Yellow”>
b.            <body background=”Yellow”>
c.             <body bgcolor=”Yellow”>
                d.            <body color=”Yellow”>
Question:
How will you change the value of the cookies and items in the Storage objects of the localStorage attributes in HTML 5.0?
a.            By invoking the window.dialogArguments() API method.
b.            By invoking the window. navigator.yieldForStorageUpdates() API method.
                c.             By invoking the window.navigator.appName API method.
Question:
How will the target URL open when you define the <a> element in your HTML 5.0 document as shown below?
<a href=”http://www.yahoo.com” target=”_self”>Click here</a>
a.            The target URL will open in the parent document.
b.            The target URL will open in a new window.
c.             The target URL will open in the same document in which it was clicked.
                d.            The target URL will open in the full body of the window.
Question:
What will be the browsing context if the browsing context name is _top when the HTML 5.0 web page is loading?
a.            It will put the new document in the same window and frame as the current document.
b.            It will load the linked document in the topmost frame.
c.             It is used in the situation where a frameset file is nested inside another frameset file.
                d.            Both a and c.
Question:
Which of the following is an INVALID value for the type attribute of command tag?
a.            checkbox
b.            radio
c.             command
d.            text
Question:
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:
You have the following directory structure.
webroot->products->ordered->delivered
The products directory has a page called Products.html and the delivered directory has a page called Delivered.html. You want to provide a link to the Products page on Delivered.html. The ideal code should be:
a.            <a href=”././Products.html”> All Products </a>
b.            <a href=”../../Products.html”> All Products </a>
c.             <a href=”…/…/Products.html”> All Products </a>
d.            <a href=”../Products.html”> All Products </a>
                e.            <a href=”Products.html”> All Products</a>
Question:
What will be the result if you use the following code to your HTML 5.0 document?
<p>I use <del>MAC</del> <ins>Microsoft</ins>!</p>
a.            I use MAC Microsoft!
b.            I use MAC Microsoft!
c.             I use MAC Microsoft!
                d.            I use MAC Microsoft!
Question:
Which of the following is the correct syntax to define a charset in the HTML 5 <meta> element?
a.            <meta http-equiv=”content-type” content=”text/html; charset=ISO-8859-1″>
b.            <meta charset=”ISO-8859-1″>
                c.             Neither a nor b.
Question:**
Which of the following is NOT a supported attribute of the <ol> element in HTML 5.0?
a.            type
b.            reversed
c.             start
                d.            compact
Question:
Which of the following is a valid attribute for the <colgroup> element in an HTML 5.0 document?
a.            char
b.            span
c.             align
                d.            width
Question:
Which of the following is the correct method to load another web page or reload the same page in HTML 5.0?
a.            <head>
<meta http-equiv=refresh content=5>
</head>
b.            <html>
<head>
<title>Auto Reload</title>
<script language=”JavaScript”>
<!–
var time = null
function move() {
window.location = ‘http://site.com’
}
//–>
</script>
</head>
<body onload=”timer=setTimeout(‘move()’,5000)”>
<p>see this page refresh itself in 5 secs.<p>
</body>
</html>
c.             <head>
<meta http-equiv=refresh content=”5;URL=http://yahoo.com >
</head>
 d.            All of the above
Question:
Which of the following elements preserves spaces and line breaks, and displays the text in fixed-width font?
a.            <xmp>
b.            <pre>
c.             <p>
d.            <q>
                e.            <br>
Question:
Which <body> tag event is fired when the user leaves the document?
a.            onunload
b.            onundo
c.             onredo
                d.            onerror
Question:**
Which of the following is an INVALID keyword value for http-equiv attribute when used with the <meta> element in HTML 5.0?
a.            content-type
b.            expires
c.             set-cookie
d.            keywords
e.            refresh
                f.             author
Question:
A computer programming book has to go online. Which of the following tags is ideal for displaying the program snippets?
a.            <emp>
b.            <code>
c.             <dfn>
                d.            <cite>
Question:
Which of the following is NOT a valid value for the type attribute of the <input> element in HTML 5.0?
a.            url
b.            week
c.             tel
d.            radio
e.            datetime-local
f.             All of the above are the valid values for <input> element
Question:
What is the role of the <dfn> element in HTML 5.0?
a.            It is used to define important text.
b.            It is used to define computer code text.
c.             It is used to define sample computer code.
                d.            It is used to define a definition term
Question:
Which of the following is NOT a valid syntax for the <link> element in HTML 5.0?
a.            <link rel=”icon” href=”abc.jpg” sizes=”16×16″>
b.            <link rev=”stylesheet” href=”abc.css” type=”text/css” target=”_parent”>
 c.             <link rel=”alternate” type=”application/pdf” hreflang=”fr”  href=”manual-fr”>
Question:**
Which of the following are valid HTML 5.0 elements?
a.            <canvas>
b.            <summary>
c.             <aside>
 d.            <video>
Question:
Which of the following is NOT a valid syntax for the <h1> element in HTML 5.0?
a.            <h1> This is header 1</h1>
b.            <h1 align=”center”> This is header 1</h1>
c.             <h1 onClick=”dothis(‘sc1′)” >This is header </h1>
                d.            <h1 style=”cursor:auto;”>This is header </h1>
Question:
Which of the following statements are correct with regard to <hr> and <br> elements of HTML 5.0?
a.            <hr> element acts in the same way as the Tab key on your keyboard and <br> element acts in the same way as the SHIFT key on your keyboard.
b.            <hr> element is used to insert the horizontal line within your document and <br> element is used to insert a single line break.
                c.             <hr> element is used to put a line across the page and <br> element acts in the same way as the ENTER key on your keyboard.
Question:
What will be the return value when using the window.navigator.appName API method in an HTML 5.0 web application?
a.            It will return the version of the browser.
b.            It will return the complete User-Agent header.
c.             It will return the name of the platform.
d.            It will return the name of the browser.
Question:
Which of the following languages will you use to paint the graphics designed using the HTML 5.0 <canvas> tag?
a.            VB script
b.            JavaScript
c.             PostScript
                d.            None of the above
Question:
What is the function of the history traversal task source in HTML 5.0?
a.            It is used for features that react to user interaction, for example, keyboard or mouse input.
b.            It is used for features that react to DOM manipulations, for example, the things that happen asynchronously when an element is inserted in the document.
c.             It is used to queue calls to history.back() and similar APIs.
                d.            All of the above.
Question:
Which <iframe> attribute is used to define the restrictions to the frame content in HTML 5.0?
a.            seamless
b.            sandbox
                c.             srcdoc
Topic:    Correct Answers
HTML 5 Events
Loading HTML 5 Web pages
HTML 5 Web application APIs
HTML 5 Elements and attributes
HTML 5 syntax
Question:
In HTML 5.0, what is the function of the sandbox attribute when used with <iframe> as shown below?
<iframe src=”aaa ” sandbox=?></iframe>
a.            It is used to define the restrictions to the frame content.
b.            It is used to define the URL of the document that should appear in the iframe.
                c.             It is used to specify that an iframe should appear as if it is part of the document the iframe is in.
Question:
Which of the following statements is/are correct for a blockquote?
a.            It makes the text a bit bigger for emphasizing.
b.            It defines the start of a long quote.
                c.             It makes the text slightly bolder.
Question:
Which event is fired when the history of the browser window changes?
a.            onpopstate
b.            onstorage
c.             onresize
                d.            onhashchange
Question:
Which of the following <link> attributes are NOT supported in HTML 5.0?
a.            sizes
b.            rev
c.             rel
                d.            charset
This question is based upon the figure shown below
Question:
Suppose you placed four radio buttons on a web form. Which of the following statements is correct for the code shown above?
a.            The user can choose only the male and the married options.
b.            The user can choose only the female and single options.
c.             The user can choose only one option out of the four.
d.            The user can choose all the four options at the same time.
                e.            The user can choose one option from Male/Female and one from Married/Single.
Question:
When does the ondragleave mouse event get fired in HTML 5.0?
a.            It gets fired when an element has been dragged to a valid drop target.
b.            It gets fired when an element leaves a valid drop target.
c.             It gets fired at the end of a drag operation.
                d.            It gets fired while an element is being dragged.
Question:**
Which of the following are valid mouse events in HTML 5.0?
a.            ondblclick
b.            ondragstart
c.             ondragenter
d.            onscroll
 e.            ondrop
Question:
Which of the following <iframe> attributes are NOT supported in HTML 5.0?
a.            height
b.            marginheight
c.             sandbox
d.            scrolling
Question:
In HTML 5.0, which of the following attributes of the <object> element refers to the location of the object’s data?
a.            type
b.            codebase
c.             data
 d.            usemap
Question:
In which of the following conditions is a browsing context A allowed to navigate a second browsing context B?
a.            When the browsing context A is a nested browsing context and its top-level browsing context is B.
b.            When the browsing context B is an auxiliary browsing context and A is allowed to navigate B’s opener browsing context.
c.             The origin of the active document of A is the same as the origin of the active document of B.
                d.            All of the above
Question:
Which of the following is an INVALID parameter for the window.navigator.registerContentHandler API method in an HTML 5.0 web application?
a.            url
b.            mimeType
c.             scheme
                d.            title
Question:
How will the target URL open when you define the <a> element in your HTML 5.0 document as shown below?
<a href=”http://www.yahoo.com” target=”_self”>Click here</a>
a.            The target URL will open in the parent document.
b.            The target URL will open in a new window.
c.             The target URL will open in the same document in which it was clicked.
                d.            The target URL will open in the full body of the window.
Question:
You specified a base tag and anchors as follows:
1. <base target=”_blank”>
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 of 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:
When is the window onstorage event triggered in the HTML document?
a.            It is triggered when the window is resized.
b.            It is triggered when a document loads.
c.             It is triggered when a document performs an undo function.
                d.            It is triggered when the window becomes visible.
Question:
In HTML 5.0, how will the script be executed if you use the script element shown below?
<script src=”script.js” type=”text/javascript” defer=”defer”></script>
a.            The script is fetched and executed immediately, before the user agent continues parsing the page.
b.            The script will be executed when the page has finished parsing.
                c.             The script will be executed asynchronously, as soon as it is available.
Question:
Which of the following is correct with regard to the oncanplaythrough event fired by media resources in the HTML 5.0 document?
a.            The script will run when the media has reached the end.
b.            The script will run when the media is played to the end, without stopping for buffering.
c.             The script will run when media data is loaded.
                d.            The script will run when the length of the media is changed.
Question:
What is the output when you use the HTML 5.0 code snippet shown below?
<body onload=”alert(this)”>
a.            It will alert saying “[object HTMLBodyElement]” when the document is loaded.
b.            It will alert saying “[object Window]” when the document is loaded.
c.             It will alert saying “[this]” when the document is loaded.
                d.            The alert message is not properly defined in the body element and an error will be generated when the document is loaded.
Question:
Which of the following represents INVALID syntax for defining an attribute value in an HTML 5.0 document?
a.            <input name =’be evil’ />
b.            <input name=be evil />
c.             <input name = “be-evil” />
                d.            All of the above.
Question:
What is the purpose of the <q> element in HTML 5.0?
a.            It is used to define the start of a term in a definition list.
b.            It is used to define attribute values for one or more columns in a table.
c.             It is used to define the start of a short quotation.
                d.            It is used to define what to show browsers that do not support the ruby element.
Question:
Which of the following events is NOT supported in HTML 5.0?
a.            oninput
b.            oninvalid
c.             ondrop
                d.            onreset
Question:
How will you cancel the timeouts that are set with the setInterval() API method identified by the handlers in HTML 5.0?
a.            window.clearInterval (handle)
b.            window.clearTimeout (handle)
c.             window.setInterval (code, timeout)
                d.            window.setTimeout (code, timeout)
Question:
Which of the following tags would assist in creating named groups within a select list?
a.            opt
b.            group
c.             optgroup
                d.            selectgroup
Question:
You are writing the code for an HTML form and you want the browser to retain the form’s input values. That is, if a user submits the form and presses the browser’s back button, the fully populated form is displayed instead of a blank form. Which of the following HTML 5.0 attributes will you use?
a.            accept
b.            autofocus
c.             autocomplete
                d.            formtarget
Question:
Which HTML 5.0 element will you use to group the related options in a drop-down list?
a.            optgroup
b.            option
c.             menu
d.            var
                e.            nav
This question is based upon the figure shown below
Question:
How will you bind the datalist option (shown below) with an <input> element, whose type attribute is set to url, to get the result shown in the image?
a.            User should define an accept attribute to the input element whose type is url.
b.            User should define multiple attribute to the input element whose type is url.
c.             User should define a list attribute to the input element whose type is url.
                d.            User should define a placeholder attribute to the input element whose type is url.
Question:
What does the icon attribute of the HTML 5.0 command tag define?
<command icon=”?”>Click Me!</command>
a.            It is used to define the url of an image to display as the command.
b.            It is used to define the name of the radiogroup this command belongs to.
c.             It is used to define if the command is checked or not.
                d.            It is used to define if the command is available or not.
Question:
In HTML 5.0, which of the following is NOT a valid value for the type attribute when used with the <command> tag shown below?
<command type=”?”>Click Me!</command>
a.            button
b.            command
c.             checkbox
                d.            radio
Question:
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:
Which event is fired when an element loses its focus in HTML 5.0 document?
a.            onfocus
b.            onload
c.             onblur
                d.            onselect
Question:
What is the purpose of the <keygen> element in HTML 5.0?
a.            It is used to define a keyboard text in an HTML 5.0 web page.
b.            It is used to generate a public-private key pair in an HTML 5.0 web page.
c.             It is used to define a definition term in an HTML 5.0 web page.
                d.            It is used to define a variable in an HTML 5.0 web page.
Question:
Which of the following is NOT a valid attribute for the <video> element in HTML 5.0?
a.            controls
b.            autoplay
c.             disabled
                d.            preload
Question:
While rendering your HTML 5.0 web page, which of the following <link> element files will get skipped by a compliant user agent if you include the link elements shown below in your document?
<link rel=”stylesheet” href=”A” type=”text/plain”>
<link rel=”stylesheet” href=”B” type=”text/css”>
a.            A link element whose href is “B”
b.            A link element whose href is “A”
                c.             None of the above
Question:
Which media event will be fired when a media resource element suddenly becomes empty?
a.            onerror
b.            onended
c.             onloadeddata
d.            onemptied
Question:
Which of the following is NOT an attribute of the <meta> element in HTML 5.0?
a.            charset
b.            content
c.             http-equiv 
d.            scheme
Question:
Which of the following statements is correct if you invoke the window.prompt (message, default) web application API method in HTML 5.0?
a.            It will only show the modal text field prompt with the given message to the user.
b.            It will show the modal text field prompt with the given message to the user, and ask the user to respond with a positive or negative response.
c.             It will show the modal text field prompt with the given message to the user, and ask the user to either respond with a string value or abort.
                d.            Both b and c.
Question:
Which of the following is NOT a valid value for the <iframe> sandbox attribute in HTML 5.0?
a.            url
b.            allow-scripts
c.             allow-same-origin
                d.            allow-forms
Question:
What is the function of onobsolete, an application cache API method in HTML 5.0?
a.            It reflows the HTML document using updated cached content.
b.            It triggers an event when the cache content has been marked as obsolete.
c.             It triggers an event when the cache content has been updated.
                d.            It updates the cache for the current document in the background.
Question:
Which of the following <section> elements have the correct attribute assignment as per HTML 5.0?
a.            <section id=”example”>…</section id=”example”>
b.            <section id=”example”>…</section id=”example2″>
c.             <section id=”EXAMPLE”>…</section>

HTML 5 Elements and attributes 63%
HTML 5 Events 86%
HTML 5 syntax 88%
HTML 5 Web application APIs 75%
Loading HTML 5 Web pages50%
d.            <section id=”Example”>…</section>
                e.