课程: HTML and CSS: Creating Navigation Bars
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Understanding the box model of a nav bar
- [Instructor] One of the reasons I love teaching nav bars is because everything you need to know about CSS is contained in this problem that seems so very simple. The first problem you'll ever encounter is how the HTML elements are nested inside of each other. These are the boxes that those HTML elements are creating, and understanding how these boxes are going to fit together. Let's look closely. By using my all-time favorite CSS debugging technique, which is to put a border on it. If you can't see it, you can't style it. So let's just start here by writing a very simple CSS style. We're going to use the star. This is the universal selector. Everything in our document will be selected, and we're going to put a border on it. One pixel solid red, my favorite combination for debugging. And yep, that looks pretty ugly, but you can start to derive some information about looking at the nav bar just by doing this. You can see that we have some short links here. They're only as big as these…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。