CSS Flashcards

1
Q

In CSS, how do you select elements by their [class] attribute?

A

you have a . in front of the class.

for example:

.article

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

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

A

just type at the name of the type: h1, body, header, etc.

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

In CSS, how do you select an element by it [id] attribute

A

you use the #{name of idea) to select the element with the ID

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

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

A
  • RGB Values: rgb(xxx, xxx, xxx)
  • Color Names: very light blue
  • Hex codes (#xxxxxx)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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

A

Static

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

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

A

It does not affect document flow

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

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

A

It will be taken out of normal flow and other elements will ignore that element like it did not exist.

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

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

A

It will position itself compared to its parent element that is NOT STATIC. If there is no non-static element, it will position itself against the Viewport/webpage.

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

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

A

Set position: (non-static:) to any of the parent elements.

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

What are the four box offset properties?

A

Top, Bottom, Left, Right

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

What are the four components of “the Cascade”

A

Source Order, inheritance, specificity, !imporant

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

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

A

The order which the rules are written in your style sheet

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

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

A

You would set the value to inheritance;

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

List the three selector types in order of increasing specificity.

A

element type, id, class.

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

Why is using !important considered bad practice?

A

It breaks the natural css-cascading and it makes debugging harder.

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

The transition property is shorthand for which four CSS properties?

A
It is a shorthand property for : 
transition-delay:
transition-duration
transition-property
transition-timing-function
17
Q

Give Two Examples of media features that you cna query in an @media rule

A

width, height, orientation

18
Q

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

A

meta tag

19
Q

What is a breakpoint in responsive Web design?

A

It is when the page changes the layout or parts of the layout depending on the width of to better suit various screen sizes.

20
Q

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

Percentages better respond to breakpoints, the element will adjust the size depending on the parent node. which will be altered by screen size.

21
Q

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

Because of CSS Cascade order.