CSS: Setting All Border Attributes At Once

This entry is part 24 of 26 in the series Basic CSS

Codecrawl.com-Border
A similar shortcut lets you specify border attributes for all four sides at once.

We can use the border attribute.

<!DOCTYPE html>
<html>
<head lang='en'>     
    <meta charset='UTF-8'>
    <title>Codecrawl.com-Border</title>
    <style>
        h3 {
            border: 2px green solid;
        }

        p {
            border-style: solid;
            border-top-color: blue;
            border-bottom-color: red;
            border-width: 2px;
        }
    </style>
</head>
<body>

<h3>Cape Town</h3>

<p>Ushuaia</p>

</body>
</html>
Series Navigation<< CSS: Formatting border sides individually
CSS: Alignment of a paragraph >>
Posted in