Font size
WorksheetsHTML & CSS Certification
Total questions: 71
Worksheet time: 36mins
1. Which two outcomes will this code fragment accomplish? (Each correct answer presents a
complete solution. Choose two.)
A. On pre-HTML5 browsers, the happy.wav file will not play, and instead Hello World will be displayed. d
B. On an HTML5 browser that supports .wav files, the happy.wav file will be played and Hello World will be hidden.
C. On an
HTML5 browser that supports .wav files, the happy.wav file will be played
and Hello World will be displayed.
D. on
pre-HTMLS browsers, the happy.wav file will play and Hello World will be
hidden.
Which three properties can be used with the TouchEvent object in the Safari touch API? (Choose three.)
A. offsetTop
B. clientHeight
C. scale
D. touches
E. rotation
A Language used to store configuration settings and data
CSS
JavaScript
HTML
XML
Declaration
A Language that controls the formatting and style of a document.
Declaration
HTML5
CSS
JavaScript
XML
A language that uses tags to display blocks of text and features such as media
CSS
JavaScript
HTML5
XML
Declaration
A language used to program document object interactions and event responses
HTML5
JavaScript
XML
Declaration
CSS
Which CSS3 code styles the text color of EM elements to be red and semi-transparent
em { color: rgba(100%, 0%, 0%, 50%); }
em { color: rgba(255, 0, 0, 0.5); }
em { color: #ff00007f; }
em { color: rgba(255, 0, 0, 127); }
Which two terms represent interfaces in the File API? (Choose two.)
A. Font
B. Blob
C. Keygen
D. FileList
On a Windows touch device, which gesture serves the same purpose as a right-click of the mouse?
A. swipe
B. pinch
C. tap
D. hold
Which two code segments declare JavaScript functions? (Choose two.)
A. varfunct=(a);
B. function Foo(a){ }
C. var a=new Foo();
Foo=function(a){ ...}
Which code fragment sets up a timer that calls a function named "adjust" every second?
A. setTimeout(adjust, 1000);
B. setInterval(adjust, 1000);
C. setInterval(adjust, 1);
D. setTimeout(adjust, 1);
Match the CSS term VALUE to it's corresponding element.
1.8 em
.container
#container
margin-top
Match the CSS term Property to it's corresponding element.
value
class selector
id selector
margin-top
Match the CSS term id selector to it's corresponding element.
property
class selector
#container
declaration
Which code shows the correct way to nest tags in HTML5?
<p>This is HTML5<b><i>text formatting</b></i></p>
<p>This is HTML5<b><i>text formatting</p></i></b>
<p>This is HTML5<b><i>text formatting</p></b></i>
<p>This is HTML5<b><i>text formatting</i></b></p>
Match the CSS term declaration to it's corresponding element.
margin-top
#container
font-family: Arial
1.8em
Match the CSS term class selector to it's corresponding element.
1.8em
.container
#container
margin-top
Match the CSS position property static to it's corresponding description.
element is positioned relative to the first positioned ancestor
element appears in the order in which it is placed in the document flow.
Element is positioned relative to the browser window.
Relative is positioned based on its parent element's position.
12. Which CSS3 code fragment styles an H2 element only if it is a direct child of a DIV
element?
A. div { background-color: #900;} h2 { background-color: #900; }
B. div > h2 { background-color: #900;}
C. h2 > div { background-color: #900;}
D. div, h2 { background-color: #900;}
You create an interface for a touch-enabled application.
You discover that some of the input buttons do not trigger when you tap the screen.
You need to identify the cause of the problem.
What are two possible causes? (Choose two.)
A. The input areas overlap with other input areas.
B. The touch screen is not initialized.
C. The input areas are using event handlers to detect input.
D. The defined input areas are not large enough.
You need to ensure the scope of a variable named j is limited to the block of a single function named foo(). Which JavaScript code fragment will accomplish this?
function foo() { var j;...}
var j ; function foo() { ... }
j = 0;
function foo () { ... }
function foo () { j = 0; ... }
Which layout can you create by using a single CSS3 region?
A. a table layout
B. a snaked-column layout
C. a multiple column liquid layout
D. a multiple column fixed layout
An HTML5 application can be used without going through a manufacturer's approval
process if:
A. the browser on the device supports HTML5.
B. the manufacturer has unlocked the device's SIM card.
C. the application has been compiled.
D. the
developer has the correct application ID.
17. Which three components define the URL used for localStorage data in HTML5? (Choose three.)
A. scheme
B. user credentials
C. hostname
D. unique port
E. query
Match the HTML5 input attribute Maxlength to the corresponding descriptions
Provides a way to set a regular expression that the value must match
Provides a way to set a default text until focus is placed in an element
provides a way to set form elements as mandatory
provides a way to allow more than one file email address in a single input.
None of the above
Match the HTML5 input attribute pattern to the corresponding descriptions
provides a way to set a regular expression that the value must match
Provides a way to set default text until focus is placed in an element
provides a way to set form elements as mandatory
provides a way to allow more that one file email address in a single input.
Which HTML5 tag is used to mark text that has been added to the original document?
A. <q>
B. <pre>
C. <ins>
D. <i>
When applied to an image, the CSS float: right property:
A. positions
the image to the left and displays all of the text to the right of the
image.
B. positions the image to the right of the region and wraps text around the top, left, and bottom.
C. positions the image to the left of the region and wraps text around the top, right, and bottom.
D. positions the image to the right and wraps text to the top and bottom.
Which CSS3 code fragment rounds the corners of a border?
A. border-image: 50px;
B. border-clip: 50px concave;
C. border-radius:50px;
D. border-clip: 50px;
You write the following code. (Line numbers are included for reference only.)
You need to make the text animate up the screen from a starting position of 400 pixels.
Which CSS code fragment should you insert at line 13?
100% { top: 400px; }
0% { top: 0px; }
0% { top: 400px; }
50% { top: 200px; }
23 Match the CSS term Comment to the corresponding CSS code examples.
universal selector
element type selector
pseudo-code
attribute selector
/* this is for
Match the CSS term pseudo-class to it's corresponding CSS code example
*
p
a:hover
input [type = "text"]
/* this is for
Match the CSS term attribute selector to the corresponding CSS code examples.
*
p
a:hover
input [type ="text"]
/* this is for
Match the CSS term universal selector to it's corresponding CSS code example.
*
p
a:hover
input[type="text"]
/* this is for
You add a div object to a page.
Which CSS3 code fragment will add a scrollbar only if the content exceeds the width or
height of the object?
Option A
Option B
Option C
Option D
Which three event attributes are used with the CAPTION element in HTML5? (Choose three.)
A. onmouseover
B. ondblclick
C. onkeydown
D. onconnect
E. onabort
What does the following HTML5 code fragment do?
<video controls><source src="myVacation.avi" type="video/avi"><source src="myVacation.ogg" type="video/ogg"></video>
A. It plays the myVacation.avi video if the browser supports it; otherwise, plays the myVacation.ogg video if the browser supports it.
B. It
plays two videos: first myVacation.avi, and then myVacation.ogg.
C. It plays both videos simultaneously, myVacation.avi and myVacation.ogg.
D. It prompts the user to choose which format of the myVacation video it should lay, .avi or .ogg.
28. Which CSS position value is used to position an element relative to the browser window?
A. position: relative;
B. position: absolute;
C. position: static;
D. position:
fixed;
Which two HTML properties can JavaScript access to change the text value of an HTML element? (Choose two.)
A. innerHTML
B. nodeType
C. title
D. nodeValue
. You are creating a page by using HTML5. You add script tags to the page.
You need to use JavaScript to access an element by id and add a class to the element. Which property or attribute should you use?
A. the tagName property
B. the className property
C. the style property
D. the class attribute
Which three code fragments define an HTML input control? (Choose three.)
A. <input type="combobox">
B. <input type="optionbutton">
C. <input type="url">
D. <input type="tel">
E. <input type="search">
When you are testing a touch interface, which two gestures can you simulate by using a
mouse? (Choose two.)
A. tap
B. pinch
C. flick
D. rotate
Which JavaScript method allows you to register multiple handlers for a single touch event?
A. dispatchEvent
B. initUIEvent
C. addEventListener
D. initEvent
Which code fragment prepares the HTML5 application to be used offline?
<!DOCTYPE html>
<html manifest="app.appcache">
<html xmln=http://www.w3.org/1999/xhtml">
<html lang="en">
Which two are WebSocket events? (Choose two.)
A. onconnect
B. onmessage
C. ondatareceived
D. onopen
Which attribute prefills a default value for an input element in HTML5?
A. name
B. placeholder
C. autocomplete
D. required
Which code fragment will display an image file while the video is downloading?
<video width="740" height="416" src="fireworks.jpg">
<video width="740" height="416" poster="fireworks.jpg">
<video width="740" height="416" autoplay="fireworks.jpg">
<video width="740" height="416" preload="fireworks.jpg">
Which HTML5 code fragment shows a way to validate numeric input as having a value
from 1 to 100, inclusive?
<input type="num" min="1" max="100">
<input type="positive" limit="100">
<input type="number" low="1"high="100">
<input type="number" min="1" max="100">
You create an instance named "location" of a geolocation object. Which code fragment will initiate periodic updates of a device's geographic location?
A. location= navigator.geolocation;
B. location.watchPosition(showLocation);
C. location.getCurrentPosition(showLocation);
D. location.clearNatch(watchid);
Which tag is used to create a drop-down list in HTML5?
A. <ul>
B. <select>
C. <datalist>
D. <dd>
What does "V" stand for in the file type SVG?
A. Video
B. Vertical
C. Vector
D. Variable
Which two touch gestures require a multi-touch device? (Choose two.)
A. hold
B. tap
C. pinch
D. spread
When content from a flow is loaded into a region, overflowed content:
A. attempts to fit into the region by auto-adjusting the styles.
B. continues into the next region.
C. is truncated and an error flag is set.
D. is buffered for download.
Which three are valid JavaScript variables? (Choose three.)
A. xyz1
B. .Int
C. int1
D. _int
E. 1xyz
Which are two features of SVG? (Choose two.)
A. uses high performance pixel-based graphics
B. can be modified by using CSS
C. uses high performance raster-based graphics
D. can be modified by using JavaScript
In HTML5, the autofocus attribute:
A. defines the cursor location when a form is first accessed.
B. controls
the movement between fields in a form.
C. adds a default value to the field in a form.
D. enables one field and disables all others.
You write the following JavaScript code. (Line numbers are included for reference only.)
A. function Student (someName) { fullname = someName; }
B. function Student (someName) { this.fullname = someName; }
C.. function Student (fullname) { this.fullname = fullname; }
D.. function Student (someName) { var fullname = someName; }
The data in a specific HTML5 local storage database can be accessed from:
A. Different browsers on the same device.
B. Different browsers on different devices.
C. The same browser on different devices
.D. The same browser on the same device.
Which item specifies resources for an offline HTML5 application?
A. a CSS style sheet
B. an HTML5 file
C. a JavaScript file
D. a cache manifest file
. In CSS, the flow-into property deposits:
A. the flow into the content.
B. the regions into a flow.
C. the flow into the regions.
D. content into the flow.
The variable named "ctx" is the context of an HTML5 canvas object. What does the following code fragment draw? ctx.arc(x, y, r, 0, Math.PI, true);
A. a circle at the given point
B. a square at the given point
C. a semi-circle at the given point
D. a line from one point to another
Your HTML5 code includes this code segment:
Which JavaScript code fragment will determine that a visitor has selected the "Chocolate" radio button?
A. if (document.getElementByID ("chocolate").value = true)
B. if (document.getElementByID ("chocolate").checked == true)
C. if (document.getElementByID ("chocolate").checked = true)
D. if (document.getElementByID ("chocolate").value == true)
Which HTML5 tag defines superscript text?
A. < small >
B. <script>
C. <sup>
D. <sub>
Which two CSS properties can be used to position multiple HTML elements next to one another? (Choose two.)
A. display
B. position
C. overflow
D. float
Which code fragment will display the Play and Pause controls in the audio interface?
<audio controls="controls">
<audio preload="controls">
<audio preload="auto">
<audio autoplay=autoplay">
Your code includes the following fragment: <input type="text" name="text1" id="myText" />
You need to add code that will retrieve the contents of the INPUT element.
Which JavaScript code fragment will accomplish this?
A. vartxtContents = document.getElementById('text1').value;
B. vartxtContents = document.getEIementyById('myText').value;
C. vartxtContents=document.getElementById('text1');
D. vartxtContents = document.getElementById('myText');
When you are working with the path API, what is the purpose of the clip method?
A. pastes a shape object in from the system clipboard
B. constrains the rendered output of the shape object
C. copies the shape object to the system clipboard
D. stores the shape object for later reference in script
Which CSS property defines which sides of an element where other floating elements are not allowed?
A. float
B. position
C. display D. clear
D. clear
Match the JavaScript object Document to its corresponding characteristics or methods.
postState()
has an indefinite lifetime
onLoad()
has a lifetime of the window
play()
Match the JavaScript object history to its corresponding characteristics or methods.
pushState
localStorage
document
sessionStorage
location
Match the JavaScript object localStorages to the corresponding characteristics or methods.
pushState()
has an indefinite lifetime
onLoad()
has a lifetime of the window
play()
