wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

HTML & CSS Certification Review

Total questions: 71

Worksheet time: 36mins

Name
Class
Date
1.

1. Which two outcomes will this code fragment accomplish? (Each correct answer presents a

complete solution. Choose two.)

a)

A. On pre-HTML5 browsers, the happy.wav file will not play, and instead Hello World will be displayed. d

b)

B. On an HTML5 browser that supports .wav files, the happy.wav file will be played and Hello World will be hidden.

c)

C. On an

HTML5 browser that supports .wav files, the happy.wav file will be played

and Hello World will be displayed.

d)

D. on

pre-HTMLS browsers, the happy.wav file will play and Hello World will be

hidden.

2.

Which three properties can be used with the TouchEvent object in the Safari touch API? (Choose three.)

a)

A. offsetTop

b)

B. clientHeight

c)

C. scale

d)

D. touches

e)

E. rotation

3.

A Language used to store configuration settings and data

a)

CSS

b)

JavaScript

c)

HTML

d)

XML

e)

Declaration

4.

A Language that controls the formatting and style of a document.

a)

Declaration

b)

HTML5

c)

CSS

d)

JavaScript

e)

XML

5.

A language that uses tags to display blocks of text and features such as media

a)

CSS

b)

JavaScript

c)

HTML5

d)

XML

e)

Declaration

6.

A language used to program document object interactions and event responses

a)

HTML5

b)

JavaScript

c)

XML

d)

Declaration

e)

CSS

7.

Which CSS3 code styles the text color of EM elements to be red and semi-transparent

a)

em { color: rgba(100%, 0%, 0%, 50%); }

b)

em { color: rgba(255, 0, 0, 0.5); }

c)

em { color: #ff00007f; }

d)

em { color: rgba(255, 0, 0, 127); }

8.

Which two terms represent interfaces in the File API? (Choose two.)

a)

A. Font

b)

B. Blob

c)

C. Keygen

d)

D. FileList

9.

On a Windows touch device, which gesture serves the same purpose as a right-click of the mouse?

a)

A. swipe

b)

B. pinch

c)

C. tap

d)

D. hold

10.

Which two code segments declare JavaScript functions? (Choose two.)

a)

A. varfunct=(a);

b)

B. function Foo(a){ }

c)

C. var a=new Foo();

d)

Foo=function(a){ ...}

11.

Which code fragment sets up a timer that calls a function named "adjust" every second?

a)

A. setTimeout(adjust, 1000);

b)

B. setInterval(adjust, 1000);

c)

C. setInterval(adjust, 1);

d)

D. setTimeout(adjust, 1);

12.

Match the CSS term VALUE to it's corresponding element.

a)

1.8 em

b)

.container

c)

#container

d)

margin-top

13.

Match the CSS term Property to it's corresponding element.

a)

value

b)

class selector

c)

id selector

d)

margin-top

14.

Match the CSS term id selector to it's corresponding element.

a)

property

b)

class selector

c)

#container

d)

declaration

15.

Which code shows the correct way to nest tags in HTML5?

a)

<p>This is HTML5<b><i>text formatting</b></i></p>

b)

<p>This is HTML5<b><i>text formatting</p></i></b>

c)

<p>This is HTML5<b><i>text formatting</p></b></i>

d)

<p>This is HTML5<b><i>text formatting</i></b></p>

16.

Match the CSS term declaration to it's corresponding element.

a)

margin-top

b)

#container

c)

font-family: Arial

d)

1.8em

17.

Match the CSS term class selector to it's corresponding element.

a)

1.8em

b)

.container

c)

#container

d)

margin-top

18.

Match the CSS position property static to it's corresponding description.

a)

element is positioned relative to the first positioned ancestor

b)

element appears in the order in which it is placed in the document flow.

c)

Element is positioned relative to the browser window.

d)

Relative is positioned based on its parent element's position.

19.

12. Which CSS3 code fragment styles an H2 element only if it is a direct child of a DIV

element?

a)

A. div { background-color: #900;} h2 { background-color: #900; }

b)

B. div > h2 { background-color: #900;}

c)

C. h2 > div { background-color: #900;}

d)

D. div, h2 { background-color: #900;}

20.

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)

A. The input areas overlap with other input areas.

b)

B. The touch screen is not initialized.

c)

C. The input areas are using event handlers to detect input.

d)

D. The defined input areas are not large enough.

21.

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?

a)

function foo() { var j;...}

b)

var j ; function foo() { ... }

c)

j = 0;

function foo () { ... }

d)

function foo () { j = 0; ... }

22.

Which layout can you create by using a single CSS3 region?

a)

A. a table layout

b)

B. a snaked-column layout

c)

C. a multiple column liquid layout

d)

D. a multiple column fixed layout

23.

An HTML5 application can be used without going through a manufacturer's approval

process if:

a)

A. the browser on the device supports HTML5.

b)

B. the manufacturer has unlocked the device's SIM card.

c)

C. the application has been compiled.

d)

D. the

developer has the correct application ID.

24.

17. Which three components define the URL used for localStorage data in HTML5? (Choose three.)

a)

A. scheme

b)

B. user credentials

c)

C. hostname

d)

D. unique port

e)

E. query

25.

Match the HTML5 input attribute Maxlength to the corresponding descriptions

a)

Provides a way to set a regular expression that the value must match

b)

Provides a way to set a default text until focus is placed in an element

c)

provides a way to set form elements as mandatory

d)

provides a way to allow more than one file email address in a single input.

e)

None of the above

26.

Match the HTML5 input attribute pattern to the corresponding descriptions

a)

provides a way to set a regular expression that the value must match

b)

Provides a way to set default text until focus is placed in an element

c)

provides a way to set form elements as mandatory

d)

provides a way to allow more that one file email address in a single input.

27.

Which HTML5 tag is used to mark text that has been added to the original document?

a)

A. &lt;q>

b)

B. &lt;pre>

c)

C. &lt;ins>

d)

D. &lt;i>

28.

When applied to an image, the CSS float: right property:

a)

A. positions

the image to the left and displays all of the text to the right of the

image.

b)

B. positions the image to the right of the region and wraps text around the top, left, and bottom.

c)

C. positions the image to the left of the region and wraps text around the top, right, and bottom.

d)

D. positions the image to the right and wraps text to the top and bottom.

29.

Which CSS3 code fragment rounds the corners of a border?

a)

A. border-image: 50px;

b)

B. border-clip: 50px concave;

c)

C. border-radius:50px;

d)

D. border-clip: 50px;

30.

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?

a)

100% { top: 400px; }

b)

0% { top: 0px; }

c)

0% { top: 400px; }

d)

50% { top: 200px; }

31.

23 Match the CSS term Comment to the corresponding CSS code examples.

a)

universal selector

b)

element type selector

c)

pseudo-code

d)

attribute selector

e)

/* this is for

32.

Match the CSS term pseudo-class to it's corresponding CSS code example

a)

*

b)

p

c)

a:hover

d)

input [type = "text"]

e)

/* this is for

33.

Match the CSS term attribute selector to the corresponding CSS code examples.

a)

*

b)

p

c)

a:hover

d)

input [type ="text"]

e)

/* this is for

34.

Match the CSS term universal selector to it's corresponding CSS code example.

a)

*

b)

p

c)

a:hover

d)

input[type="text"]

e)

/* this is for

35.

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?

a)

Option A

b)

Option B

c)

Option C

d)

Option D

36.

Which three event attributes are used with the CAPTION element in HTML5? (Choose three.)

a)

A. onmouseover

b)

B. ondblclick

c)

C. onkeydown

d)

D. onconnect

e)

E. onabort

37.

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)

A. It plays the myVacation.avi video if the browser supports it; otherwise, plays the myVacation.ogg video if the browser supports it.

b)

B. It

plays two videos: first myVacation.avi, and then myVacation.ogg.

c)

C. It plays both videos simultaneously, myVacation.avi and myVacation.ogg.

d)

D. It prompts the user to choose which format of the myVacation video it should lay, .avi or .ogg.

38.

28. Which CSS position value is used to position an element relative to the browser window?

a)

A. position: relative;

b)

B. position: absolute;

c)

C. position: static;

d)

D. position:

fixed;

39.

Which two HTML properties can JavaScript access to change the text value of an HTML element? (Choose two.)

a)

A. innerHTML

b)

B. nodeType

c)

C. title

d)

D. nodeValue

40.

. 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)

A. the tagName property

b)

B. the className property

c)

C. the style property

d)

D. the class attribute

41.

Which three code fragments define an HTML input control? (Choose three.)

a)

A. <input type="combobox">

b)

B. <input type="optionbutton">

c)

C. <input type="url">

d)

D. <input type="tel">

e)

E. <input type="search">

42.

When you are testing a touch interface, which two gestures can you simulate by using a

mouse? (Choose two.)

a)

A. tap

b)

B. pinch

c)

C. flick

d)

D. rotate

43.

Which JavaScript method allows you to register multiple handlers for a single touch event?

a)

A. dispatchEvent

b)

B. initUIEvent

c)

C. addEventListener

d)

D. initEvent

44.

Which code fragment prepares the HTML5 application to be used offline?

a)

<!DOCTYPE html>

b)

<html manifest="app.appcache">

c)

<html xmln=http://www.w3.org/1999/xhtml">

d)

<html lang="en">

45.

Which two are WebSocket events? (Choose two.)

a)

A. onconnect

b)

B. onmessage

c)

C. ondatareceived

d)

D. onopen

46.

Which attribute prefills a default value for an input element in HTML5?

a)

A. name

b)

B. placeholder

c)

C. autocomplete

d)

D. required

47.

Which code fragment will display an image file while the video is downloading?

a)

<video width="740" height="416" src="fireworks.jpg">

b)

<video width="740" height="416" poster="fireworks.jpg">

c)

<video width="740" height="416" autoplay="fireworks.jpg">

d)

<video width="740" height="416" preload="fireworks.jpg">

48.

Which HTML5 code fragment shows a way to validate numeric input as having a value

from 1 to 100, inclusive?

a)

<input type="num" min="1" max="100">

b)

<input type="positive" limit="100">

c)

<input type="number" low="1"high="100">

d)

<input type="number" min="1" max="100">

49.

You create an instance named "location" of a geolocation object. Which code fragment will initiate periodic updates of a device's geographic location?

a)

A. location= navigator.geolocation;

b)

B. location.watchPosition(showLocation);

c)

C. location.getCurrentPosition(showLocation);

d)

D. location.clearNatch(watchid);

50.

Which tag is used to create a drop-down list in HTML5?

a)

A. &lt;ul>

b)

B. &lt;select>

c)

C. &lt;datalist>

d)

D. &lt;dd>

51.

What does "V" stand for in the file type SVG?

a)

A. Video

b)

B. Vertical

c)

C. Vector

d)

D. Variable

52.

Which two touch gestures require a multi-touch device? (Choose two.)

a)

A. hold

b)

B. tap

c)

C. pinch

d)

D. spread

53.

When content from a flow is loaded into a region, overflowed content:

a)

A. attempts to fit into the region by auto-adjusting the styles.

b)

B. continues into the next region.

c)

C. is truncated and an error flag is set.

d)

D. is buffered for download.

54.

Which three are valid JavaScript variables? (Choose three.)

a)

A. xyz1

b)

B. .Int

c)

C. int1

d)

D. _int

e)

E. 1xyz

55.

Which are two features of SVG? (Choose two.)

a)

A. uses high performance pixel-based graphics

b)

B. can be modified by using CSS

c)

C. uses high performance raster-based graphics

d)

D. can be modified by using JavaScript

56.

In HTML5, the autofocus attribute:

a)

A. defines the cursor location when a form is first accessed.

b)

B. controls

the movement between fields in a form.

c)

C. adds a default value to the field in a form.

d)

D. enables one field and disables all others.

57.

You write the following JavaScript code. (Line numbers are included for reference only.)

a)

A. function Student (someName) { fullname = someName; }

b)

B. function Student (someName) { this.fullname = someName; }

c)

C.. function Student (fullname) { this.fullname = fullname; }

d)

D.. function Student (someName) { var fullname = someName; }

58.

The data in a specific HTML5 local storage database can be accessed from:

a)

A. Different browsers on the same device.

b)

B. Different browsers on different devices.

c)

C. The same browser on different devices

d)

.D. The same browser on the same device.

59.

Which item specifies resources for an offline HTML5 application?

a)

A. a CSS style sheet

b)

B. an HTML5 file

c)

C. a JavaScript file

d)

D. a cache manifest file

60.

. In CSS, the flow-into property deposits:

a)

A. the flow into the content.

b)

B. the regions into a flow.

c)

C. the flow into the regions.

d)

D. content into the flow.

61.

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. a circle at the given point

b)

B. a square at the given point

c)

C. a semi-circle at the given point

d)

D. a line from one point to another

62.

Your HTML5 code includes this code segment:


Which JavaScript code fragment will determine that a visitor has selected the "Chocolate" radio button?

a)

A. if (document.getElementByID ("chocolate").value = true)

b)

B. if (document.getElementByID ("chocolate").checked == true)

c)

C. if (document.getElementByID ("chocolate").checked = true)

d)

D. if (document.getElementByID ("chocolate").value == true)

63.

Which HTML5 tag defines superscript text?

a)

A. &lt; small >

b)

B. &lt;script>

c)

C. &lt;sup>

d)

D. &lt;sub>

64.

Which two CSS properties can be used to position multiple HTML elements next to one another? (Choose two.)

a)

A. display

b)

B. position

c)

C. overflow

d)

D. float

65.

Which code fragment will display the Play and Pause controls in the audio interface?

a)

<audio controls="controls">

b)

<audio preload="controls">

c)

<audio preload="auto">

d)

<audio autoplay=autoplay">

66.

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)

A. vartxtContents = document.getElementById('text1').value;

b)

B. vartxtContents = document.getEIementyById('myText').value;

c)

C. vartxtContents=document.getElementById('text1');

d)

D. vartxtContents = document.getElementById('myText');

67.

When you are working with the path API, what is the purpose of the clip method?

a)

A. pastes a shape object in from the system clipboard

b)

B. constrains the rendered output of the shape object

c)

C. copies the shape object to the system clipboard

d)

D. stores the shape object for later reference in script

68.

Which CSS property defines which sides of an element where other floating elements are not allowed?

a)

A. float

b)

B. position

c)

C. display D. clear

d)

D. clear

69.

Match the JavaScript object Document to its corresponding characteristics or methods.

a)

postState()

b)

has an indefinite lifetime

c)

onLoad()

d)

has a lifetime of the window

e)

play()

70.

Match the JavaScript object history to its corresponding characteristics or methods.

a)

pushState

b)

localStorage

c)

document

d)

sessionStorage

e)

location

71.

Match the JavaScript object localStorages to the corresponding characteristics or methods.

a)

pushState()

b)

has an indefinite lifetime

c)

onLoad()

d)

has a lifetime of the window

e)

play()