From the course: CSS Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Managing box model quirks

Managing box model quirks - CSS Tutorial

From the course: CSS Essential Training

Managing box model quirks

- [Instructor] So far, we've looked at a couple ways to test and inspect the different box model styles. Now let's look at some known quirks, and how to manage them. We'll start by focusing on the two paragraph elements, and discuss the behavior I mentioned in the previous lesson, margin collapsing. I've added a background color to this example so we can see the space between the paragraphs, which is coming from a default margin style. Since HTML was created for research documents, it makes sense for paragraphs to have this default style. Otherwise, it would just be a big block of text. And just note that not all HTML elements have default margin or padding styles. But let's say you wanted to remove the space or make it smaller. Currently this space is being occupied by the margin bottom of the first paragraph in the margin top of the second paragraph. If we were to remove the bottom margin of the first…

Contents