Setting Borders

In CSS, you can easily set borders for block elements, including controlling their style, width, and color. You can control the appearance of the border around an element, as well as each individual border (top, right, bottom, and left).

Setting the Border Style

In CSS, the border-style property enables you to set various different border styles, using any of these values: none, hidden, solid, double, dotted, dashed, groove, ridge, inset, and outset. The default border style setting is none, which means that no border is initially displayed. All of these border styles were included in CSS1, except for hidden, which was included in CSS2. The none and hidden values operate the same, except when used with tables.

For instance, here ...

Get Cascading Style Sheets (CSS) by Example 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.