O'Reilly logo

HTML5 and CSS3: Visual QuickStart Guide, Seventh Edition by Bruce Hyslop, Elizabeth Castro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting the Border

You can create a border around or on individual sides of an element and then set its thickness, style, and color Image. If you’ve specified any padding (see “Adding Padding around an Element”), the border encloses both the padding and the contents of the element.

Image You add a few more design touches by implementing these borders. In the case of the dotted border on the bottom of the masthead, it also helps visitors distinguish the masthead from the rest of the page at a glance.

#masthead {     border-bottom: 2px dotted #1d3d76;     margin-bottom: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required