Borders

Now we know how to set the size of an element's content, the next part of the box model is the border.

The border is set as follows:
border: width style color;

Here is an example of a border that is one pixel wide, solid, and green:

border: 1px solid green;

Instructions

Set the border of elements with the id breeds to be 2 pixels wide, solid, and blue.

Notice that the border changed from red to blue. This is because the id selector (#) takes precedence over the universal selector (*).

Start programming for free

By signing up, you agree to the Terms of Service and Privacy Policy.

Or sign up with:

4/9

Borders | Start Coder