2. the box model
• All HTML elements are rendered as
boxes
• Stylesheets can control how to display
these boxes (color, placement, etc)
• There arepaddingproperties of boxes:
border,
3 basic
and margin
18. speed test 04
#hot p {
width:100px;
border:3px solid yellow;
margin-left:auto;
margin-right:auto;
font-size:30px;
padding:5px;
}
19. types of boxes
• HTML boxes can be categorized into
two types:
1. Block
2. Inline
• They can be controlled by the CSS
property display
20. BLOCK BOX
• Occupies the whole
width of the
container element
• Has whitespace
before and after it
• Dimensions are <p> <h1> to <h6>
<div> <ul> <ol> <li>
controllable
21. inline box
• Only as wide as
its content
• Flows with text
lines
• Dimensions
aren’t easily
controllable <a> <span>
<strong> <em> <img>