Skip to content

Commit 8d489bc

Browse files
committed
Add box model diagram to box model exercise
1 parent 96861d4 commit 8d489bc

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

images/7-box-model.png

9.45 KB
Loading

week-1/7-css-box/readme.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# CSS Box Model
22

3-
When the browser builds your webpage, it treats every HTML element as a box. An image box is put next to a text box, which is next to a link box.
3+
When the browser builds your webpage, it treats every HTML element as a box. An image box is put next to a text box, which is next to a link box. CSS calls this the "box model".
44

5-
CSS calls this the "box model". You can modify the "box model" with the CSS properties `width`, `height`, `margin`, `padding` and `border`. Search on Google to learn how these properties work, then complete the steps below.
5+
![Diagram of the CSS box model properties](/images/7-box-model.png)
6+
7+
You can modify the "box model" with the CSS properties `width`, `height`, `margin`, `padding` and `border`. Search on Google to learn how these properties work, then complete the steps below.
68

79
1. Find the `.number` rule in `styles.css`. Play around with the CSS properties in this rule to see how they work.
8-
2. Right now, each message has a large space to its right. Use one of the box model properties you have learned to modify the unread message so that it is positioned on the right, as shown in [this screenshot](/images/7-position.png).
10+
2. Right now, each message has a large space to its right. Use one of the box model properties you have learned to modify the unread message so that it is positioned on the right, as shown in this screenshot:
11+
12+
![Screenshot of expected positions of read nad unread messages](/images/7-position.png).
913

1014
_Try this: Add `* { border: 1px solid red; }` to your CSS code. It will show you the box model of every element._

0 commit comments

Comments
 (0)