The Box Model
Premium Content - Free Preview
An HTML element can take up more space on a page than its content itself. An element is surrounded by 3 other parts:
- The padding around the element
- The border around the padding
- The margin outside the border, to separate from other elements.
For example, here's a paragraph with a padding, border and margin:
The quick brown fox packed my box with five dozen liquor jugs and then jumped over the lazy dogs.
Here's each part marked:
The element itself is in the middle, surrounded by padding in the same color, then a border, and finally a (white) margin on the outside.
End of Free Content Preview. Please Sign in or Sign up to buy premium content.
Comments
Cher
Sep 11, 3:53 AMWhat problem with my code?
Learneroo
Sep 11, 9:54 AMDid you select the image?
Cher
Sep 11, 10:42 AMYes sir, here is my code:
/* CSS */
#sample-pic{
border: solid 2px gray;
}
Learneroo
Sep 11, 11:41 AMOK but I see that your code passed, so there shouldn't be a problem.