Lesson 4 Flashcards
block level elements
occupy any avaible width, regardless of their content and begin on a new line
in-line elements
occupy only the width their content requires and line up on the same line one after the other
what are the most common display values
block, inline,inline-block and none
what happens when you use a display value of none
completely hides the element and renders the page as if the element doesnt exist
what is the box model
every element on a page is a rectangular box and may have width height padding borders and margins
what properties go into a box model
width, height, padding, border and margin
what is the default width of a block element
100%
what elements does width become non-relevant with?
inline and inline block
height
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
on which elements does height and width become irrelevant. and which element can you apply them to
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.
margin
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,
One oddity with the margin property is that vertical margins, top and bottom, are not accepted by which elements
inline-level
padding
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.
Margin & Padding on Inline-Level Elements
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 do colors apply to margins and paddings
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.