Effects Flashcards

1
Q

A web page you are working on has a very thin banner image that is contained in a div tag. It was originally intended that the image would be repeated across the banner to create a gradient effect, but the original coder did not complete this functionality. How would you fill the whole banner with the image without changing the image size?

A

body {
background: #ffffff url(“img_tree.png”) no-repeat right top;
}

This is achievable by making use of the background-repeat attribute. If it is set to repeat-x, the image will repeat across the banner container, i.e. background-repeat: repeat-x;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

You wish to show part of a larger image without necessarily editing the image in a graphics program. Give the skeleton code for how you could use CSS to show only the top right part of a large image within a smaller div container showing?

A

divcontainer {background-position: right top;}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

To create a header for a website, your client wants the image not to be savable by right-clicking, so you decided to embed the image in a div tag. Give the skeleton code for this

A

divheader {background-image: url(‘imgname.jpg’);}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Your client wishes to create an animation that would change the font size of a paragraph to 22px when the mouse is positioned over it. However, the client wishes not to use scripting for fear that it would not work if scripting is disabled. Give the skeleton code for how this can be achieved using only CSS.

A

p:hover {font-size: 22px;}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How would you create an animation effect with CSS only using two images, in which the first image changes to the second one on a web page when the mouse is moved over the first image?

A

The strategy is to show the first image in a div tag as its background-image. The hover event can be captured via #image1div:hover and a new background-image can be assigned, which will disappear when the mouse moves out.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Your client wishes to make the color of links that have already been clicked on a web page as red. Write the skeleton CSS to achieve this.

A

a: link {color:#FF0000;} /* unvisited link /
a: visited {color:#00FF00;} /
visited link /
a: hover {color:#FF00FF;} /
mouse over link /
a: active {color:#0000FF;} /
selected link */

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Suppose your friend is a beginner in CSS and comes to you for advice on how to make a mouse-over effect so that the underline of hyperlinks goes away when the mouse
is moved over the links. What advise will you give?

A

This can be done using CSS alone, via a:hover {text-decoration: none;}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

A web page contains help links and the specifications require that the mouse should change to the help cursor when the mouse is moved over these categories of help links. Give your CSS only code skeleton on how you can do this.

A

.helplinks:hover{cursor:help;}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

You are contacted to increase the spacing between all letters to 2px and increase the font size to 18px on a web page. This is required so that the web page can be read more easily by visually challenged readers. Provide your CSS code skeleton.

A

body {font-size: 18px; letter-spacing:2px; }

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A new feature that is part of the CSS3 specification recommendation is having a transparency attribute for images. Most modern browsers have implemented this already. Are you aware of this, and if yes, what is this attribute?

A

Opacity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is background-attachment used for

A

scroll - the background scrolls along with the element.
fixed - The background is fixed with regard to the viewport
local -The background scrolls along with the element’s contents
initial - Sets this property to its default value
inherit- Inherits this property from its parent element.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly