You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
have class work on all components of box model. from starter code to working model
Margins: all values for a single margin property works like a box: Toppx Rightpx Bottompx Leftpx;
Borders: explore different colors, patterns, and thickness.
Padding: explore negative values on the page.
Height, Width, and Box-Sizing: adjust the shape of your box.
I do - 5 mins
Show them display property, float, clear and Positioning
Formative Assessment - 5 mins
notice what happens when you change width, height, margin, and padding for inline, block, and inline-block elements in html file
Take 5 minutes to alter these in the Chrome Dev Tools
We do - Group Activity 30 mins
pair students up (4 groups of 2, 1 of 3)
In the html file you just created add a simple container div containing a single line of text
<divid="container"><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p></div>
set up the styling of the body and the container div, play around with the p element, set the margin(remember top, bottom,right,left), padding(same as margin TBRL).
set the p element to be white, and margin to be red.
/* my copy, not students */body { background: black; }
#container {
background: gray;
width:600px;
margin:0px auto;
border:1px solid black;
}
p {
background: white;
border:20px solid red;
margin-top:20px;
margin-right:20px;
margin-bottom:20px;
margin-left:20px;
padding-top:20px;
padding-right:20px;
padding-bottom:20px;
padding-left:20px;
}
Talking points
Note that we specify the top, bottom, left, and right margin and padding values separately in this example.
This is one way to specify these values, and similar border-top (and so on) settings are available for the border.
This allows you to clearly set any or all border, margin, and padding settings that you need.
/* For example, this is completely acceptable if you only want to specify the top and right margins: */margin-top:30px;
margin-right:8px;
Mini-Formative Assessment
condense everything written above into shorthand syntax
explain shorthand vs long-form pros/cons
border:20px solid red;
margin:0000;
padding:0000;
/* important thing to remember is: */margin: [top] [right] [bottom] [left]
Talking points
You have to give all four values, using 0 to indicate no margin or padding in that direction.
Any legal CSS unit can be used, though these properties are typically set in %, px, or em values. We will learn more about this as we move along.
back to pairing, finish assignment/lab
<!-- nested elements Here is the how you can add some more elements --><divid="container"><divid="none">Lorem ipsum dolor sit amet....</div><divid="margin">Ut enim ad minim veniam....</div><divid="padding">Duis aute irure dolor....</div>
...
</div>
play around with this
see how you can add margin, border and padding to these