© Mark J. Collins 2017

Mark J.  Collins, Pro HTML5 with CSS, JavaScript, and Multimedia, 10.1007/978-1-4842-2463-2_12

12. Borders and Backgrounds

Mark J. Collins

(1)Chesterfield, Virginia, USA

Borders

In some of the examples in previous chapters, I added a border around elements to help visualize the space allocated to them. I used a CSS rule like this:

border: 1px solid black;

This uses shorthand notation that sets the three primary aspects of a border: width, style, and color. This is equivalent to setting each of the attributes separately:

border-width: 1px;border-style: solid;border-color: black;

Basic Styles

There are eight border styles , which are demonstrated in Figure 12-1. All the major browsers support these, although the implementation varies ...

Get Pro HTML5 with CSS, JavaScript, and Multimedia: Complete Website Development and Best Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.