Advanced CSS Flashcards

1
Q

What property can be used to add a corner to each corner of a box?

A

border-radius

Example: border-radius: 20px;
Example: border-radius: 6px 12px 18px 24px;
Example: border-radius: 50px/100px;

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

How to create an ellipse with CSS?

A

Specify different horizontal and vertical radii by splitting values with a “/”

Example: border-radius: 50px/100px;

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

What is the standard CSS property to apply shadows to a box?

A

box-shadow

Example: box-shadow: 5px 5px 3px 1px #999

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

What are the possible box-shadow values?

box-shadow: 5px 5px 3px 1px #999

A
  1. ) horizontal offset – how far the shadow is nudged to the right (or left if it’s negative)
  2. ) vertical offset – how far the shadow is nudged downwards (or upwards if it’s negative)
  3. ) blur radius — the higher the value the less sharp the shadow. (“0” being absolutely sharp).
  4. ) spread distance — the higher the value, the larger the shadow (“0” being the inherited size of the box)
  5. ) color
  6. ) inset - apply shadows to the inside of a box
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the standard CSS property to apply shadows to text?

A

text-shadow

Example: text-shadow: -2px 2px 2px #999;

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

What is the universal selector?

A

Using an asterisk (“ * ”), you can target everything.

Example: * { } Target everything on a page
Example: #contact * { } Target everything under this ID

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

What is a universal selector is commonly used for?

A

The universal selector is commonly used to “reset” many of a browser’s default styles.

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

What is a child selector?

A

A greater-than symbol (“>”) can be used to specify something that is a child of something else.

Example: #genus_examples > li { border: 1px solid red }

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

What is an adjacent selector?

A

A plus sign (“+”) is used to target an adjacent sibling of an element, essentially, something immediately following something.

Example: h1 + p { font-weight: bold }

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

What is the general sibling selector?

A

A general sibling selector uses a tilde (“~”) and will match an element following another regardless of its immediacy.

Example: h1 ~ p { font-weight: bold }

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

What does HSL stand for?

A

hue, saturation, and lightness

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

What is the a in RGBa?

A

Alpha, as in “alpha transparency”.

This allows you to set the transparency of a box or text.

Example: color: rgba(0,0,0,0.8);

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

True or False? Anywhere where you can use rgb, you can used rgba.

A

True

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

What is Hue, saturation, and lightness?

A

It gives you direct control over the aspects of a color’s shade rather than its logical ingredients.

Example: color: hsl(36, 100%, 50%)

  1. ) Hue from 0 to 360 on a color wheel
  2. ) Saturation from 0% to 100% or grey to full color
  3. ) Lightness from 0% (black) to 100% (white) 50% (normal)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is HSLa?

A

HSLa combines hue, saturation, and lightness with alpha transparency

Example: hsla(0, 75%, 75%, 0.5)

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

They can be used to import other CSS files, apply CSS to a particular media, or embed uncommon fonts

A

At-Rules

17
Q

What are the three types of At-Rules?

A
  1. ) @import
  2. ) @media
  3. ) @font-face
18
Q

What is the @import rule used for?

A

This is used to bolt another stylesheet onto your existing one. @import rules must be placed at the top of a stylesheet.

Example: @import url(morestyles.css);

19
Q

What are media rules?

A

@media can be used to apply styles to a specific media, such as print

Example: @media screen, projection { }

20
Q

How would you embed fonts in a web page so that a typeface can be used even if it isn’t sitting on the user’s computer?

A

The at-rule @font-face

Example:
@font-face { 
    font-family: "font of all knowledge";
    src: url(fontofallknowledge.woff);
}
21
Q

What are attribute selectors?

A

Attribute selectors allow you to style an element’s box based on the presence of an HTML attribute or of an attribute’s value

Example: abbr[title]
Example: input[type=text]
Example: input[type=text][disabled]
Example: [attribute^=something] (starts with something)
Example: [attribute$=something] (ends with something)
Example: [attribute*=something] (contains something)

22
Q

_______ allow you to easily animate parts of your design without the need for JavaScript.

A

Transitions

Example:  
a:link {
    transition: all .5s linear 0;
    color: hsl(36,50%,50%);
}

a:hover {
color: hsl(36,100%,50%);
}

23
Q

What is the difference between transitions and states?

A

States: Binary animations are either on or off

Transitions: Smooth animation, slowly transitioning from state to state

24
Q

True or False? You can apply multiple background images to a single element.

A

True.

Example:
background-image: url(this.jpg), url(that.gif), url(theother.png);

25
Q

The ________ property allows you to stretch or compress a background image.

A

background-size

26
Q

The _____ property defines where the background area of a box actually starts

A

background-origin

27
Q

What provides powerful manipulation of the shape, size, and position of a box and its contents?

A

Transforms

Example: transform: rotate(-10deg)
Example: transform: skew(20deg,10deg);
Example: transform: scale(2);
Example: transform: translate(100px,200px);
Example: transform: rotate(-10deg) scale(2);

28
Q

Manipulating a box over two dimensions, transform can be used to do what 4 things?

A
  1. ) Rotate - Turn the box
  2. ) Skew - Tip the horizontal and vertical
  3. ) Scale - Change width and height
  4. ) Translate - Shift a box horizontally and vertically
29
Q

What does the matrix function do?

A

Combines transforms into one function – rotating, skewing, scaling, and translating.

30
Q

________ are used to show a smooth dissolve from one color to another.

A

Gradients

31
Q

What are the two types of gradients?

A

Linear and Radial

Example: background: linear-gradient(yellow, red);
Example: background: radial-gradient(yellow, green);
Example: background: repeating-linear-gradient(white, black 15px, white 30px);

32
Q

_______ enable you to specify different design choices depending on screen size?

A

Media Queries

33
Q

What do media queries target?

A

Mobile phones, tablets, and varying browser window sizes

34
Q

What type of screen sizes do media queries target?

A

1.) Browser-size
Example: @media screen and (max-width: 1000px) { }

2.) Orientation-specific
Example: @media screen and (orientation: landscape) { }
Example: @media screen and (orientation: potrait) { }

3.) Device-specific
Example: @media screen and (min-device-height: 768px) and (max-device-width: 1024px) { }