今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Using negative margin values
- [Instructor] Unlike other box model properties, margin can be used with both positive and negative values. We just used a negative value in the last exercise but let's take a closer look at how it all works. In this example, we'll apply positive and negative values to the second box to see how the surrounding elements are affected by these values. Let's start with a stacked example. Adding a positive value for margin top and margin bottom is as we discussed in previous lessons. It will push the surrounding elements away from the top and bottom sides. But if we change the top value to negative 20, it will bring the proceeding element closer which will make it overlap. The same applies when using a negative bottom value, except that the element below is brought closer. Adding a positive margin right value doesn't show any change. A negative value doesn't either. That's because there are no other elements to the right…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
Intro to the CSS box model58 秒
-
(已锁定)
The box model properties3 分钟 44 秒
-
(已锁定)
Box-sizing and the box model fix4 分钟 23 秒
-
(已锁定)
Inline, block, and display4 分钟 39 秒
-
(已锁定)
Project: Footer styles and icons4 分钟 4 秒
-
(已锁定)
Debugging with developer tools5 分钟 6 秒
-
(已锁定)
Managing box model quirks4 分钟 2 秒
-
(已锁定)
Project: Background image update3 分钟 23 秒
-
(已锁定)
Using negative margin values2 分钟 42 秒
-
(已锁定)
Center aligning with margin3 分钟 42 秒
-
(已锁定)
Project: Adding content wrappers4 分钟 44 秒
-
(已锁定)
Project: Adding a header image5 分钟 56 秒
-
-
-
-
-
-