CSS Flashcards

1
Q

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

A

a selector and a declaration
(a declaration is made up of a property and property 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

.nameOfClassAttribute

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 tag name?

A

just their name

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

(pound)nameOfIdAttribute

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 code, 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

margin, border, padding, and content (height/width)

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

CSS Box Model:
What 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

it is a selector that selects elements that are in a specific state

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 useful for?

A

pseudo classes let you apply style to an elements that are in a specific state

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

left to right

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

CSS Flexbox:
What is the default flexwrap of a flex container?

A

nowrap, all on one line

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

They vertically stack 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?

17
Q

CSS Layout Classes:
What are the three primary components of a page layout? (which helper classes do you need?)

A

Containers. Rows. Columns.

18
Q

CSS Layout Classes:
What is the minimum number of columns that you should put in a row?

A

at least ONE

19
Q

CSS Layout Classes:
What is the purpose of a container?

A

It sets a boundary for the layout (content) by giving it a max-width

20
Q

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

21
Q

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

A

there is no affect to document flow

22
Q

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

A

it would move relative to where it exists in a static position

23
Q

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

A

it becomes removed from the document flow completely

24
Q

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

A

it’ll get positioned within the boundaries of its nearest non-static ancestor

25
CSS Positioning: How do you constrain an absolutely positioned element to a containing block?
the container or parent has to be relative
26
CSS Positioning: What are the four box offset properties?
top/bottom/left/right
27
CSS Cascade: What are the four components of "the Cascade"?
source order, inheritance, specificity, and !important rule
28
CSS Cascade: What does the term "source order" mean with respect to CSS?
it means that the styling provided closer to the bottom of the file will take affect
28
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?
through Inheritance: when certain css properties on a child element can receive value from a parent element if no css for that property is declared on the child element
29
CSS Cascade: List the three selector types in order of increasing specificity
Id 1-0-0 weight value (highest) class 0-1-0 weight value element type 0-0-1 weight value no value (universal selector) (lowest)
30
CSS Cascade: Why is using !important considered bad practice?
-it overrides any other declaration within the same cascade layer and origin -it reverses the cascade order of stylesheets as long as you understand the cascade, you won't need to use the !important flag
31
CSS Transform: What does the transform property do?
the transform property lets you modify an element (rotate, skew, scale, translate)
32
CSS Transform: Give four examples of CSS transform functions
rotate, scale, skew, translate
33
CSS Transitions: The transition property is shorthand for which four CSS properties?
transition property transition duration transition timing function transition delay
34
CSS Media Queries: Give two examples of media features that you can query in an @media rule
min-width, max-width
35
CSS Media Queries: Which HTML meta tag is used in mobile-responsive web pages?
viewport
36
CSS Responsive Layout: What is a breakpoint in responsive Web design?
points (boundaries, size of view page) where a media query is introduced
37
CSS Responsive Layout: What is the advantage of using a percentage (e.g. 50%) width instead of a fixed width (e.g. px) width for a 'column' class in a responsive layout?
the layout of the page will adjust (scale) according to the size of the screen or web page
38
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?
the smaller one will win, because the rules that are closer to the bottom are seen as a priority (source order)