Grokking CSS for Web Development
Vote

0% completed

​

Borders and Rounded Corners

Remove one word, solid, from the card's border: 4px solid gray, and the border disappears completely. Chrome then reports a border width of 0 pixels, although the rule still says 4px. The reason is that a border has three parts, a width, a style and a color, and without a style there is nothing for the browser to draw.

The border property is a shorthand: one declaration that sets several properties at once. It accepts the width, the style and the color in any order, and each part also has its own property, such as border-width, border-style and border-color.

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content