Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Lesson 7: Managing the Graphical Interface by Using CSS

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

You created a box and want only the upper-right corner to be rounded with a radius of 30 pixels. Which of the following can you use to create the effect?

a)

border-radius: 30px

b)

border-top-right-radius: 30px

c)

border-right-radius: 30em

d)

border-radius-top-right: 30px

2.

. You want to add a shadow to the inside of a box. Which attribute do you use with the CSS box-shadow property?

a)

h-shadow

b)

v-shadow

c)

spread

d)

inset

3.

You want to add a drop shadow to a box. Which attribute do you use with the CSS box-shadow property to control the size of the shadow?

a)

h-shadow

b)

v-shadow

c)

spread

d)

inset

4.

. In the following code, what does the value #808080 affect?

box-shadow: 10px 10px 5px #808080;

a)

size of the drop shadow

b)

color of the drop shadow

c)

size of the box

d)

color of the box

5.

To apply a 75% transparency to an image or element, which property do you use?

a)

opacity: 25

b)

opacity: 0.25

c)

transparency: 75

d)

transparency: 0.75

6.

In the following code for a linear gradient, what do the numbers in the last set of parentheses define?

background: linear-gradient(to right, rgba(255,255,255,0)

a)

color stops

b)

size and shape of the gradient

c)

horizontal and vertical center values

d)

geometric position

7.

In the following code for a radial gradient, what does the first set of percentages (50% 50%) define?

radial-gradient(50% 50%, 70% 70%, #99CCFF, #3D5266)

a)

color stops

b)

size and shape of the gradient

c)

horizontal and vertical center values

d)

percent of color for both color stops

8.

The following code is associated with Web Open Font Format (WOFF) fonts. Which CSS rule replaces the word RULE?

<style>

RULE { font-family: "font-family-name";

src: url("http://website/fonts/fontfile")

}

</style>

a)

@font-face

b)

@font-woff

c)

@media-font

d)

@keyframe-font

9.

. You want to move an element 150 pixels from the left and 100 pixels from the top. Which of the following code snippets is correct?

a)

b)

c)

d)

a)

translate: transform(100px,150px)

b)

transform: translate(150px,100px)

c)

transform: translate(100px,150px)

d)

translate: transform(150px,100px)

10.

In the following code, how does the method scale(3,6) affect the element to which it is applied?

transform: scale(3,6)

a)

moves the element three units from the top and six units from the right

b)

moves the element three units from the left and six units from the bottom

c)

transforms the height to be three times its original size and the width six times its original size

d)

transforms the width to be three times its original size and the height six times its original size

11.

You want to rotate an element 45 degrees. Which code do you use?

a)

transform: rotate(315deg)

b)

transform: rotate(45deg)

c)

rotate: transform(315deg)

d)

rotate: transform(45deg)

12.

A rectangle contains text. You want the text to appear backwards. What code do you use?

a)

transform: rotateX(180deg)

b)

transform: rotateX(180%)

c)

transform: rotateY(180deg)

d)

transform: rotateY(180%)

13.

You want to turn an element 30 degrees around the x-axis in the 2D plane. What code do you use?

a)

transform: skew(30deg)

b)

transform: skew(30deg,30deg)

c)

transform: skewX(30deg)

d)

transform: skewY(30deg)

14.

Which of the following statements is not true of the CSS3 3D perspective property?

a)

The general syntax is perspective: number.

b)

It applies only to 3D transformed elements.

c)

Lower values (1000 or less) create a more pronounced effect than higher values.

d)

The property defines how a browser renders the width of a 3D transformed element.

15.

In a transition, which property allows a transition to change speed over its duration?

a)

transition-property

b)

transition-delay

c)

transition-duration

d)

transition-timing-function

16.

The following code is associated with animations. Which CSS rule replaces the word RULE?

RULE fadeout {

from { opacity: 1; }

to { opacity: 0; }

}

a)

@animation

b)

@keyframes

c)

@media-animation

d)

@iframes

17.

In the following code, what effect does the ease value have on the animation?

div { animation-duration: 3s;

animation-delay: 0s;

animation-timing-function: ease; }

div:hover { animation-name: fadeout; }

a)

increases the speed of the animation and then slows it down toward the end

b)

decreases the speed of the animation and then speeds it up toward the end

c)

maintains a steady speed throughout the animation

d)

starts the animation at a slow speed and then maintains a steady speed for the duration of the animation

18.

In the following code for an SVG filter, what does in="SourceGraphic" indicate?

<svg>

<defs>

<filter id="a1" x="0" y="0">

<feGaussianBlur in="SourceGraphic" stdDeviation="20" />

</filter>

</defs>

<rect width="150" height="150" stroke="plum" stroke-width="3"

fill="plum" filter="url(#a1)" />

</svg>

a)

the filter name

b)

the blur effect

c)

that the entire element will be blurred

d)

none of the above

19.

What is the result of the following SVG produce?

<svg>

<defs>

<filter id="i1" x="0" y="0">

<feOffset dx="5" dy="5" />

</filter>

</defs>

<rect width="150" height="150" fill="grey" filter="url(#i1)" />

<rect width="150" height="150" fill="blue" />

</svg>

a)

a grey square with a blue drop shadow

b)

a blue square with a grey drop shadow

c)

a grey square with a blue border

d)

a blue square with a grey border

20.

The following JavaScript code creates a canvas object with text. What method do you use in place of the word METHOD?

<script type="text/javascript">

var canvas = document.getElementById("myText");

context = canvas.getContext("2d");

context.font = "30px Arial";

METHOD("Canvas-generated text", 40, 120);

</script>

a)

context.Text

b)

context.fillText

c)

context.fill

d)

context.textFill