css3 fundamentals Flashcards

1
Q

Scale an item

A

transform: scale( val ); // or (xScale, yScale)

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

Skew an item

A

transform: skew(val); // or skewX or Y

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

How can you transform an element with perspective and rotation?

A

transform: perspective(100px) rotateX(45deg); // p needs to come first.

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

transform-style: preserve-3d; Does what?

A

If it’s on a parent with 3D effects, the children can have their own 3D effects based on parent’s space.

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

How can you change the vanishing point in a 3D transform?

A

Use perspective-origin: x y || left bottom || 25% 75%

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

What is the property for having an element animate?

A

animation: name-of-animation 3s numIterations

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

What is the format for an animation’s keyframes?

A

@keyframes name-of-animation { 0% { prop: val; } }

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

For vanishing point to be in the very center, do what?

A

width and height of child should be 100% width and height of parent.

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

Hide an element when it’s flipped away from view in 3d space.

A

backface-visibility: hidden;

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

Create a flexbox container

A

display: flex

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

What property controls the direction a flexbox goes?

A

flex-direction: row, row-reverse, column, column-reverse

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

What if you don’t want flexbox to keep items on one line?

A

flex-wrap: wrap (nowrap or wrap-reverse)

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

How can you set sequence of items using flexbox?

A

order: ;

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

What is flex-flow property?

A

A combination or shorthand for flex-direction and flex-wrap. E.g. column nowrap or row wrap;

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

what is flex-basis?

A

It specifies the main-size of a flex item. Main size is size along “main” axis.

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

what is flex property and what are defaults?

A

Shorthand for flex-grow, flex-shrink, and flex-basis combined. Default is: 0 1 auto;

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

What are values for justify-content in flexbox?

A

flex-start, flex-end, center, space-between, space-around

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

what is flexbox align-self property?

A

Enables individual item to over-ride flexbox alignment.

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

How can you vertically align flexbox items?

A

align-items: flex-start, flex-end, center, baseline, stretch

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

What does flexbox align-content property do?

A

It aligns along the cross-axis when there is more than one row. Note difference with align-items.

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

Use what property and value to center items along main axis in flexbox?

A

justify-content: center;

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

Use what property/value to center items along cross axis in flexbox?

A

align-items: center;

23
Q

How is align-content different from align-items?

A

align-content only applies when items wrap.

24
Q

What does this mean? flex: 2 0 auto;

A

If applied to an item in a flex-box container, it will be twice as big on main axis than elements with flex-grow of 1.

25
Q

What are the values of transition property?

A

Property-name, duration, transition-timing-function, delay

26
Q

What animation aliases make it easy to go between just two states?

A

@keyframes name-of-anim { from { … } to {…} }

27
Q

Animation property for whether to go back and forth

A

animation-direction: normal, reverse, alternate, etc

28
Q

When should you add will-change property?

A

At the last minute before a change will happen to avoid taxing memory, e.g. by adding it with javascript.

29
Q

What are the values for box-shadow property?

A

x offset, y offset, blur radius, spread radius, color

30
Q

What are the values for box-shadow property?

A

x offset, y offset, blur radius, spread radius, color

31
Q

What is intuitive alternative to rgba() color setting?

A

hsla( 50, 60%, 50%, 1); // hue, saturation, lightness, alpha

32
Q

Set animation easing with what property?

A

-webkit-animation-timing-function: ease-in, ease-out, etc;

33
Q

Easiest way to center an element on both axes?

A

Set parent to display: flex; Set element to margin: auto;

34
Q

what are the -of-type properties?

A

:nth-of-type(n), :first-of-type, :last-of-type, :nth-last-of-type and :only-of-type (there is only one of it)

35
Q

create inner shadow

A

box-shadow: inset 0 0 #10px rgba(0,0,0,0.5); // optional spread variable would come after blur amount of 10px.

36
Q

target a checkbox

A

input[type=checkbox] { … }

37
Q

target form fields but not submit/upload buttons

A

input:not([type=submit]):not( [type=file] );

38
Q

Target first letter for an initial cap or drop-cap

A

p:first-of-type:first-letter

39
Q

Remove space between table cells

A

table { border-collapse: collapse;

40
Q

make a media query

A

@media screen and (min-width: 728px) and (max-width: 1024px) { … }

41
Q

Create a color gradient, left to right, blue for first quarter, then green, then yellow

A

background: linear-gradient( to right, blue, green 25%, yellow); note that space matters before open parens;

42
Q

What is the default value of ‘align-items’?

A

stretch. By default, items fill space on cross-axis;

43
Q

how do you color in an svg solid?

A

.svg-solid { fill: white; }

44
Q

How is flex: 1 different from saying flex-grow: 1 ?

A

With one number, flex basis is set to 0%.

45
Q

Create a layout with 3 equal columns using flex property.

A

flex: 0 0 33.33333%; // or flex: 1 0 33.33333% (if you want rows with only 2 or 1 columns to fill all the space)

46
Q

Use calc to set width to 1/3 of width accounting for a 320px sidebar

A

width: calc( (100% -320px) / 3);

47
Q

Set something’s height to 100% of view port using vh

A

width: 100vh;

48
Q

Find all elements with class .arrow that follow .box as siblings.

A

.box ~ .arrow

49
Q

Find all a tags that link to ‘amazon.com’, ‘www.amazon.com’, etc

A

a[href*=”amazon.com”]

50
Q

Select all list items only if there are 5 or more

A

li: nth-last-child(n+5), (select first through fifth)
li: nth-last-child(n+5) ~ * { … } (select all after the fifth)

51
Q

li:nth-child(-n + 5) selects what?

A

Only list items 1 through 5, not sixth and beyond.

52
Q

Find all tags that link somewhere beginning with ‘http’

A

a[href^=”http”]

53
Q

Find all images that end in .jpg

A

img [ src$=”jpg” ] (note: can’t have space between words)

54
Q

explain background-origin vs. background clip

A

Both take border-box, padding-box, or content-box. Origin places image based on setting; clip overlaps padding or not depending.