CSS Backgrounds, Borders, and Images Modules Flashcards

1
Q

Have a background image completely fill the container, even if you have to stretch the image

A

background-size: cover;

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

Have a background image completely display in the container, even if it leaves some empty space

A

background-size: contain;

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

Place a background image so it bleeds to the edge of the box, regardless of padding or border.

A

background-origin: border-box; // also: padding-box; content-box;

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

What’s the syntax for using multiple background images?

A

background-image: url(top.png), url(middle.png), url(bottom.jpg);

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

how is background-origin different than background-clip?

A

Both control how image displays relative to border, padding, or content box. Clip controls painting and origin controls placement.

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

Create a shadow that doesn’t extend to ends of the shape – make it inset by 5 or 10px on right and left.

A

box-shadow: 0 20px 10px -15px; // negative spread creates this effect

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

Create a linear gradient with three colors and set change points

A

background-image: linear-gradient(white 20%, yellow 40%, blue 90%;

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

What prefixed only (as yet) property lets you control image size of background images?

A

image-set: url (small.jpg 1x, medium.jpg 2x);

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

What are two ways to have a blue/yellow gradient extend from bottom to top?

A

linear-gradient( to top, blue, yellow) or (0deg, blue, yellow); or just 0, blue, yellow without deg.

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

Repeat a gradient of vertical lines across container

A

background-image: repeating-linear-gradient(90deg, black, black 10px, white 10px, white 20px);

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

Add a variable for a main color to root element, use the variable.

A

:root { –color: #efefef; };

color: var(–color);

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

What is the default background-clip and what does it mean in terms of backgrounds and borders?

A

default is border-box, meaning background color extends under the border, which is an issue with transparent white over white or dashed white over white.

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

How could you create a fat outline around text using text-shadow?

A

Use commas to create multiple shadows on left, right, top and bottom; add additional shadows to extend the outline (each with an increasing offset).

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

How can you create a single dot using linear gradient, and how might you turn it into a line?

A

background-image:linear-gradient(red, red);
background-size: 100% 1px;
background-repeat: no-repeat;
background-position: 4px 100%;

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