13 Boxes Flashcards
Each html element sort of acts like there is a box around it (even inline elements)
t or f
true
CSS rules must be surruonded by “
t or f
F
They can also be ‘
Control the height and width of a box
height: 300px;
width: 300px;
Between px, em, and %, which are best to control the size of a webpage for various sizes?
em and %
What happens with a p inside a div: div.box { height: 300px; width: 300px; } p { height: 75%; width: 75%; ;}
it’s height and width is set to 75% of the containing element
225px wh
What happens with the div box div.box { height: 50%; width: 50%; }
it’s height and width is set to 50% of the containing element (the browser window in this case)
set a max and min width/height
td.description { min-width: 450px; max-width: 650px; text-align: left; padding: 5px; margin: 0px;}
p {
min-height: 10px;
max-height: 30px;}
Define what happens when the box shrinks smaller than the text (made it disappear, make it scroll)
p. one {
overflow: hidden;}
p. two {
overflow: scroll;}
What’s the difference between padding, margin and border
Border is the thickness of the box
Margin is the space outside the box border (in between boxes)
Padding is the space between the box border and content
Set the border width generally
and
on specific sides (2 ways)
p.one {
border-width: 2px;}
p.two {
border-width: thick;}
border-top-width border-right-width border-bottom-width border-left-width OR p.three { border-width: 1px 4px 12px 4px;} top, right, bottom, left
Set border as solid
border-style: solid;
Set the border as a double line (both lines together make the border-width)
border-style: double;
Set the border as dotted or dashed
p. two {border-style: dotted;}
p. three {border-style: dashed;}
Set border:
- as if sticking out from the page
- as if carved into page
- as in embedded into the page
- as if embossed
p. six {border-style: ridge;}
p. five {border-style: groove;}
p. seven {border-style: inset;}
p. eight {border-style: outset;}
Hide the border
border-style: hidden;
border-style: none;