From the course: CSS Essential Training
Unlock this course with a free trial
Join today to access over 25,600 courses taught by industry experts.
Project: Heading resets and border styles
From the course: CSS Essential Training
Project: Heading resets and border styles
- [Instructor] In the last project update, we added padding to the content wrap to create space between the text and the edge of the container elements for smaller screens. You may have noticed that adding this padding also caused the space between the header and the About section to disappear. Let's inspect the About heading. We can see that the default margin in the heading tag is still there, but if we inspect the content div, we'll see that the padding pushed the heading down into the container, so the space didn't actually disappear, it was just moved inside the container. If I remove the padding, the margin space from the header will push outside of the container. By adding padding to the content wrap, this also means that the space within the top of the About section now comes from two sources, the padding in the content wrap and the default margin in the H2 heading. Since padding is commonly added to…
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)
Introduction to the CSS box model1m 4s
-
(Locked)
Width, height, and display3m 7s
-
(Locked)
Padding, margin, and border4m 59s
-
(Locked)
Center-aligning with margin3m 7s
-
(Locked)
Box-sizing and the box model fix3m 31s
-
(Locked)
Working with developer tools5m 1s
-
(Locked)
Margin collapse and inline spacing2m 48s
-
(Locked)
Creating full-height layouts3m 2s
-
(Locked)
Project: List reset and header updates4m 51s
-
(Locked)
Project: Centering content with margin5m 49s
-
(Locked)
Project: Heading resets and border styles4m 4s
-
(Locked)
-
-
-
-
-
-