Lesson 4 Flashcards

1
Q

block level elements

A

occupy any avaible width, regardless of their content and begin on a new line

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

in-line elements

A

occupy only the width their content requires and line up on the same line one after the other

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

what are the most common display values

A

block, inline,inline-block and none

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

what happens when you use a display value of none

A

completely hides the element and renders the page as if the element doesnt exist

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

what is the box model

A

every element on a page is a rectangular box and may have width height padding borders and margins

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

what properties go into a box model

A

width, height, padding, border and margin

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

what is the default width of a block element

A

100%

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

what elements does width become non-relevant with?

A

inline and inline block

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

height

A

The default height of an element is determined by its content. An element will expand and contract vertically as necessary to accommodate its content. To set a specific height for a non-inline element, use the height property

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

on which elements does height and width become irrelevant. and which element can you apply them to

A

inline-level elements will not accept the width and height properties or any values tied to them. Block and inline-block elements will, however, accept the width and height properties and their corresponding values.

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

margin

A

The margin property allows us to set the amount of space that surrounds an element. Margins for an element fall outside of any border and are completely transparent in color. Margins can be used to help position elements in a particular place on a page or to provide breathing room,

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

One oddity with the margin property is that vertical margins, top and bottom, are not accepted by which elements

A

inline-level

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

padding

A

very similar to the margin property;
falls inside of an element’s border, should an element have a border.
used to provide spacing directly within an element. works vertically on inline-level elements
. This vertical padding may blend into the line above or below the given element, but it will be displayed.

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

Margin & Padding on Inline-Level Elements

A

Margins only work horizontally—left and right—on inline-level elements
Padding works on all four sides of inline-level elements; however, the vertical padding—the top and bottom—may bleed into the lines above and below an element.

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

how do colors apply to margins and paddings

A

For margins, we see the background color of the parent element, and for padding, we see the background color of the element the padding is applied to.

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

borders

A

Borders fall between the padding and margin, providing an outline around an element. The border property requires three values: width, style, and color

17
Q

what are the most common styles of borders

A

most common style values are solid, double, dashed, dotted, and none, but there are several others to choose from.

18
Q

border radius

A

The border-radius property accepts length units, including percentages and pixels, that identify the radius by which the corners of an element are to be rounded. A single value will round all four corners of an element equally; two values will round the top-left/bottom-right and top-right/bottom-left corners in that order; four values will round the top-left, top-right, bottom-right, and bottom-left corners in that order.

19
Q

what are the three values of the box sizing property

A

content-box, padding-box, and border-box

20
Q

content box

A

The content-box value is the default value, leaving the box model as an additive design. If we don’t use the box-sizing property, this will be the default value for all elements. The size of an element begins with the width and height properties, and then any padding, border, or margin property values are added on from there.

21
Q

what are the most common vendor prefixes for box-sizing

A
  • moz-box-sizing:mozilla firefox
  • webkit-box-sizing:chrome and safari
  • ms-box-sizing:internet explorer
22
Q

padding box

A

The padding-box value alters the box model by including any padding property values within the width and height of an element. When using the padding-box value, if an element has a width of 400 pixels and a padding of 20 pixels around every side, the actual width will remain 400 pixels. As any padding values increase, the content size within an element shrinks proportionately.

23
Q

border box

A

Lastly, the border-box value alters the box model so that any border or padding property values are included within the width and height of an element. When using the border-box value, if an element has a width of 400 pixels, a padding of 20 pixels around every side, and a border of 10 pixels around every side, the actual width will remain 400 pixels.

24
Q

what is the best box sizing value and why

A

border box
If we want an element to be 400 pixels wide, it is, and it will remain 400 pixels wide no matter what padding or border values we add to it.

25
Q

width

A

The default width of an element depends on its display value. Block-level elements have a default width of 100%, consuming the entire horizontal space available. Inline and inline-block elements expand and contract horizontally to accommodate their content. Inline-level elements cannot have a fixed size, thus the width and height properties are only relevant to non-inline elements. To set a specific width for a non-inline element, use the width property: