background Flashcards

1
Q

What do background properties effect?

A

The background of the selected element/container

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

background-color

A

Fills the container with a specified color

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

opacity

A

Specifies the opacity/transparency of an element. Values 0.0 -> 1.0

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

background-image

A

Specifies the background image of an element with a URL

body {
background-image: url(“myImage.jpg”);
}

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

What is the default setting for a background image?

A

Placed top-left and repeated [V and H], so it covers the entire element.

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

How many background images can you have?

A

As many as you’d like.

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

Should you set a background-color if you already have a background-image?

A

Yes, in case the image fails to load.

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

What background properties can you set with one declaration?

A

body {
background: lightblue url(“img_tree.gif”) no-repeat fixed center;
}
The background property is a shorthand property for:

background-color
background-image
*background-position/background-size
background-repeat
background-origin
background-clip
background-attachment

*must be position/size

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

background-origin

A

sets the starting point for the background image.

padding-box //default starts from upper left padding

border-box //image starts from upper left border

content-box //image starts from the upper left corner of the content

inherit //inherit origin from the parent element

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

background-position

A

Specifies the origin of the image

horizontal% vertical%;

horizontalpx verticalpx

inherit

left || right combined with [top, center, bottom]

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

background-repeat

A

Specifies how to repeat the background

repeat //default x and y

repeat-x //only horizontally
repeat-y //only vertically

no-repeat

space, round, inherit

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

background-size

A

background-size: auto|length|cover|contain|initial|inherit;

x% y%

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

background-attachment

A

How a background image is set to the document

scroll //default will scroll with the page

fixed // will not scroll

local // scrolls with the element’s content

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

Does background have a shorthand property?

A

Yes, can contain many properties with one declaration…

background: color image repeat origin

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

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