CSS Add A Border

Using CSS you can add a border around any element on your page that you choose. Keep in mind that if you've define a padding for your element, then the border will encompass that padding as well.

There are 8 border styles that you can choose from:

To add a border around an element: NameOfElement {border-style: style}. Where style can either be ridge, inset, outset, dashed, dotted, double, groove, or solid.

Once you have a border around an element, you can then define the color and the thickness of the border.


CSS Setting The Color Of A Border

To set the color of the border: NameOfElement {border-color: color} Where color can be the name of the color or the hexadecimal value of a color.


CSS Setting The Width Of A Border

To set the width of the border: NameOfElement {border-width: Xpx} Where X is the value of the width in pixels.

Next: CSS Floating Elements

Template Design | Elque 2007