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: ...

Get HTML5 and CSS3: Visual QuickStart Guide, Seventh Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.