From the course: Practical CSS for No-Coders
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Understanding the box model in CSS
From the course: Practical CSS for No-Coders
Understanding the box model in CSS
- [Instructor] Our little webpage is looking okay, given the basic CSS that we've applied to it. However, one of the major things that is lacking is spacing on this page. We know that we have not quite enough room between the text, and the edges of those color bars. Like especially if you look at the word play, and go outside and play, you can see how the bottom of the P and the Y are actually touching the edge of that color box. If we were looking at this on CodePen, there's a little bit of white space between the edges of those color bars, and the edge of the webpage and that big gap between H plus sport, and what's the best exercise? I'd love to see that go away. There are a lot of things that are going on. To fix these problems, we need to understand the spacing properties. That means it's time to discuss the box model in CSS. Every HTML element is a box. The box consists of several properties that…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Understanding type in CSS3m 15s
-
(Locked)
Applying type formatting with CSS4m 59s
-
(Locked)
Understanding and applying size in CSS6m 17s
-
(Locked)
Understanding the box model in CSS3m 52s
-
(Locked)
Working with border, padding, and margin in CSS12m 3s
-
(Locked)
Challenge: Add styling to this page1m 50s
-
(Locked)
Solution: Add styling to this page6m 9s
-
(Locked)
-
-