CSS: Formatting border sides individually

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

By default, border attributes to all four sides.

We can specify a certain side of the border with special properties.

Here we apply 2 different colors to the top and bottom borders.

<!DOCTYPE html>
<head lang='en'>     
    <meta charset='UTF-8'>
        p {
            border-style: solid;
            border-top-color: blue;
            border-bottom-color: red;
            border-width: 2px;



Series Navigation<< CSS: Specifying border width and color
CSS: Setting All Border Attributes At Once >>