CSS Flashcards

1
Q

CSS Syntax

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

A

Declaration, selector, properties, values

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

Period symbol(.) and name of class

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

Name of 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

Hash tag (#) and name of id

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, HEX Codes, Color Names

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

width, height, border, margin, 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 adds 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 Classes

What is a pseudo-class?

A

A CSS pseudo-class is a keyword added to a selector that specifies a special state of the selected element(s).

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

CSS Pseudo Classes

What are CSS pseudo-classes useful for?

A

It helps users to interact and know if the object responded to users’ request.

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, ems, percentages, points, inch, 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

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

nowrap

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

div starts on a new line and has a full-width.

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-Positioning

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

A

static

18
Q

CSS-Positioning

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

A

Same spot in flow (nothing change)

19
Q

CSS-Positioning

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

A

Same exact place

20
Q

CSS-Positioning

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

A
  • The box is taken out of normal flow and no longer affects the position of other elements on the page. (They act like it is not there).
  • An absolutely positioned element no longer exists in the normal document flow. Instead, it sits on its own layer separate from everything else.
  • Remove from document flow and act as not there (Everything change)
21
Q

CSS-Positioning

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

A

Absolute moves strictly to non-static ancestor

22
Q

CSS-Positioning

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

A

Non-static

23
Q

CSS-Positioning

What are the four box offset properties?

A

Top, bottom. left, right

24
Q

CSS-Cascade

What are the four components of the “Cascade”.

A

Source, order, inheritance, specificity, !important

25
Q

CSS-Cascade

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

A

The order that your CSS rules are written in your stylesheet. The styling top is weak but the styling bottom is strong. The styling gets stronger as progress

26
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

Inheritance.

27
Q

CSS-Cascade

List three selector types in order of increasing specificity

A

type selector, class selector, ID selector

28
Q

CSS-Cascade

Why is using !important considered bad practice?

A

It makes debugging more difficult by breaking the natural cascading in your stylesheets. The only way to override !important is to use other !important or use JavaScript to remove it.

29
Q

CSS-Transforms

What does the transform property do?

A

change space and orientation

30
Q

CSS-Transforms

Give four examples of CSS transform functions.

A

-scale, matrix, rotate, skew, translate

31
Q

CSS-Media-Queries

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

A

Min-width, max-width

32
Q

CSS-Media-Queries

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

A

Viewport meta tag

33
Q

CSS-Transforms

The transition property is shorthand for which four CSS properties?

A

Transition-property transition-duration, transition-timing-function and transition-delay

34
Q

CSS Responsive Layout

What is a breakpoint in responsive Web design?

A

In responsive design, a breakpoint is the “point” at which a website’s content and design will adapt in a certain way in order to provide the best possible user experience.

35
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

We don’t know how big user’s screen will be so the percentage can define a size as relative to an element’s parent object. Percentage of that content would fill the viewport.

36
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 cascade that the bottom CSS applied first.