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
Copy file name to clipboardExpand all lines: html/lesson3/tutorial.md
+7-10Lines changed: 7 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -168,22 +168,19 @@ and make the picture a bit smaller
168
168
169
169
### What is the box model?
170
170
171
-
An element can be visualised as a box. The box model tells browsers how the element and its attributes relate to each other.
171
+
An element can be visualised as a box. The box model is a way of describing the stacking of spatial properties of an element, those which effect it's size & spacing on the page. These are: `padding`, `margin`, `border` as well as `height` and `width`.
172
172
173
-
Characteristics that define the box model are `padding`, `margin`, `border`, `height` and `width`.
173
+
**<spanstyle="color: rgb(130,171,182);">blue</span>** represents the values for `height` and `width`. Typically these values are set implicitly based on the content.
174
174
175
-
**<spanstyle="color: LightSkyBlue;">blue</span>**is where `height` and `width` are defined. These properties don't always need to be set. By default they will use relevant sizing dimensions based on the inner content.
175
+
**<spanstyle="color: rgb(185,197,124);">green</span>**represents the `padding`— the space inside the `border`. `padding` adds to the total size of the box. So setting `padding-left: 10px;` and `width: 20px;` would make the element **30px** wide on the page.
176
176
177
-
**<spanstyle="color: mediumpurple;">purple</span>**shows the `padding`— the space between the content and the `border`. The padding also adds to the total width of the box. So if you set `padding: 10px;` and `width: 20px;` your element will be **30px** long.
177
+
**<spanstyle="color: rgb(244,211,139);">yellow</span>**is the `border`— the edge around the content and `padding`. It can be styled in various ways and represents the outer most visible part of an element.
178
178
179
-
**black** is the `border`— the edge around the box. Its _thickness_, _style_ and _color_ can be defined.
179
+
**<spanstyle="color: rgb(239,195,144);">orange</span>** is the `margin`— the spacing outside the border. This separates the element from other elements on the page.
180
180
181
-
**<spanstyle="color: gold;'">yellow</span>** is the `margin`— the transparent area around the box. This separates it from other elements.
182
-
183
-
_only the bottom margin is visible in our example. `padding`, `margin` and `border` can be defined for any or all sides of the box._
184
-
185
-

181
+
Note: `padding`, `margin` and `border` can be applied to any combination of sides, below all three are applied in equal measure to all four sides around the content.
0 commit comments