CSS Flashcards

1
Q

CSS-SYNTAX

What are the names of the individual pieces of a CSS rule?

A

selector, declaration block with opening/closing curly brace, property, and value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
CSS-SYNTAX
In CSS, how do you select elements by their class attribute?
A

With a period (Ex: .title)

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

CSS-SYNTAX

In CSS, how do you select elements by their type?

A

Type selector means matches element names.

h1 { }
h1, h2, h3 { }

(just write the element)

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

CSS-SYNTAX

In CSS, how do you select an element by its id attribute?

A

With a pound/hashtag (Ex. #html)

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

CSS-COLORS

Name three different types of values you can use to specify colors in CSS.

A
RGB Values ( rbg(0,0,0) );
Hex Codes (#111111);
Color Names ( red);
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

CSS-BOX-MODEL

What CSS properties make up the box model?

A

border, margin, and padding

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

CSS-BOX-MODEL

Which CSS property pushes boxes away from each other?

A

margin

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

CSS-BOX-MODEL

Which CSS property add space between a box’s content and its border?

A

padding

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

CSS-PSEUDO-CLASS

What is a pseudo-class?

A
A pseudo-class is applied by the browsers under certain circumstances. 
In some cases...
They select elements that are in a specific state, e.g. they are being hovered over by the mouse pointer and therefore changes appearance
\:hover | :active | :focus
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

CSS-PSEUDO-CLASS

What are CSS pseudo-classes-used for?

A
A pseudo-class is used to define a special state of an element (a class that allows users to change the appearance when interacting with elements).
Makes CSS easier by not having to apply certain classes to each individual element.
Example: It can be used to style an element when a user mouses over it. Style visited and unvisited links differently.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

CSS-FONTS

Name two types of units that can be used to adjust font-size in CSS.

A

pixels and percentages;

also em / rem;

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

CSS-FONTS

What CSS property controls the font used for the text inside an element?

A

font-family property

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

CSS-FLEXBOX

What is the default flex-direction of a flex container?

A

Row

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

CSS-FLEXBOX

What is the default flex-wrap of a flex container?

A

No Wrap

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

CSS-LAYOUT-CLASSES

Why do two div elements “vertically stack” on one another by default?

A

because they are block elements

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

CSS-LAYOUT-CLASSES

What is the default flex-direction of an element with display: flex?

A

row

17
Q

CSS-LAYOUT-CLASSES

What should containers classes alway have?

A

max-width: px or percent

margin: 0 or auto

18
Q

CSS-LAYOUT-CLASSES

What should row classes alway have?

A

display: flex

19
Q

CSS-POSITIONING

What is the default value for the position property of HTML elements?

A

static / normal

20
Q

CSS-POSITIONING

How does setting position: relative on an element affect document flow?

A

it doesn’t

21
Q

CSS-POSITIONING

How does setting position: relative on an element affect where it appears on the page?

A

Only use if you want to move things slightly to the left, right, down, or up;

22
Q

CSS-POSITIONING

How does setting position: absolute on an element affect where it appears on the page?

A

sticks to the closest ancestry that is non-static

23
Q

CSS-POSITIONING

How do you constrain an absolutely positioned element to a containing block?

A

change the ancestor element;

parent div has to be other than static

24
Q

CSS-POSITIONING

What are the four box offset properties?

A

Top, Bottom, Left, and Right

25
Q

CSS-CASCADE

What are the four components of “the Cascade”?

A

Source Order;
Specificity;
Importance;
Inheritance;

26
Q

CSS-CASCADE

What does the term “source order” mean with respect to CSS?

A

Order that CSS uses “in order”;
Ruleset that is lower on the ccs page is used;
If two selectors are identical, the latter of the two will be a priority;

27
Q

CSS-CASCADE

How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?

A

apply it to the parent element (inheritance)

28
Q

CSS-CASCADE

List the three selector types in order of increasing specificity.

A

id > class > element

29
Q

CSS-CASCADE

Why is using !important considered bad practice?

A

makes debugging harder by breaking the order of things

30
Q

CSS-TRANSFORMS

What does the transform property do?

A
Lets you... 
Rotate; 
Scale; 
Skew;
or Translate;
... an element
31
Q

CSS-TRANSFORMS

Give four examples of CSS transform functions.

A

translateX, translateY, rotate, scale

32
Q

CSS-TRANSITION

The transition property is shorthand for which four CSS properties?

A

transition-property;
transition-duration;
transition-timing-function;
transition-delay;

33
Q

CSS-MEDIA-QUERIES

Give two examples of media features that you can query in an @media rule.

A

min-height;

min-width;

34
Q

CSS-MEDIA-QUERIES

Which HTML meta tag is used in mobile-responsive web pages?

A

viewport meta tag

35
Q

CSS-RESPONSIVE-LAYOUT

What is a breakpoint in responsive Web design?

A

a point in the viewport size where the layout will change

36
Q
CSS-RESPONSIVE-LAYOUT
What is the advantage of using a percentage (e.g. 50%) width instead of a fixed (e.g. px) width for a "column" class in a responsive layout?
A

will adapt to the viewpoint sizing

37
Q

CSS-RESPONSIVE-LAYOUT
If you introduce CSS rules for a smaller min-width after the styles for a larger min-width in your style sheet, the CSS rules for the smaller min-width will “win”. Why is that?

A

css rulesets are loaded in top to bottom so bottom one always wins (source order)