
This is the second part in a three part series. Today we will be covering the Border attribute. The first article was on the Background Attribute and the last article will be on the Font Attribute so stay tuned and subscribe. Part one of this CSS series is linked below.
Some background on the Border Attribute
Borders used to be those ugly gray things that surrounded elements such as tables and frames, but now with CSS they are a very powerful tool for designers.
Overview
There are 3 properties available in CSS2 relating to the border attribute.
- border-color : Sets the actual color for the border
- border-style : Sets the style of the border
- border-width : Sets how thick the border will be
Usage of basic properties
Border Color
The border-color property sets a specific color for the border of the chosen element. Here are some examples of what this property may look like.
border-color: #999; border-color: rgb(100,200,200); border-color: red; border-color: transparent;

Border Styles
The border-style property sets the style of the border on the specified element to whatever value it’s given.
border-style: dotted; border-style: dashed; border-style: solid; border-style: double; border-style: groove; border-style: ridge; border-style: inset; border-style: outset; border-style: none; border-style: hidden;

Border Width
The border-width property determines the thickness of the border on any given element.
border: 3px solid #64c8c8; border: .5em solid #64c8c8; border: thin solid #64c8c8; border: 10pt solid #64c8c8;

Speed up the process with short hand
This little piece of code is a gem, you might want to take notes on this one. This combines all three border properties into one for increased productivity.
border: (width) (style) (color); border: 1px solid #999;
Great Examples of Border Usage
1. Kammeradvokaten


This site uses a mixture of typography and borders to bring a truly effective simplistic look. The borders act as organizers for the content. Very well done.
2. Open


This is also another beautiful example of the border attribute. Open has used borders to basically section off each piece of content. Everything is well aligned and they used multiple styles of borders.
My challenge to you
When you are designing that new portfolio or a site for a client, push yourself to incorporate borders in the design. It will not only be a challenge to do it well, but you as a designer will benefit from branching out from the norm. If you do complete this challenge or have completed this challenge please leave a link in a comment so our readers can check them out!

November 16th, 2009 at 8:31 pm
CSS’s Border Attribute – Usage and Best Practices…
Borders used to be those ugly gray things that surrounded elements such as tables and frames, but now with CSS they are a very powerful tool for designers….
November 16th, 2009 at 9:13 pm
Great tutorial! Here’s some simple border use on a website I designed…
November 17th, 2009 at 6:01 pm
So, are you saying that designing a site with borders is somewhat better than using margins and padding?
November 23rd, 2009 at 8:35 am
@Danial, using css to design a site is combining borders with padding/margin. You can see in the examples that he uses a lot of padding.
I guess that since this tutorial is about border Shane is not mentioning the use of padding/margin to keep the focus on the border possibilities.
November 25th, 2009 at 2:50 pm
@daniel
JV is correct. I am not condoning using borders over padding and margin, just the use of borders in general to enhance the layout!
November 25th, 2009 at 5:16 pm
Thanks guys, I was just curious.
Daniel´s last blog ..My Business Card
December 4th, 2009 at 7:35 pm
Good tutorial. For a long time borders had a bad reputation and some people still hesitate to use them, but used correctly they can really improve the neatness of a design.
December 9th, 2009 at 3:22 pm
nice article.
i have no problem using borders – just as needed not because they are there.
January 12th, 2010 at 7:41 pm
Things are getting pretty funky with CSS borders in CSS3. Try out the borders-image property when you get a chance but it’s real difficult to get your head around the syntax. Also Firefox’s -moz-border-bottom-colors is worth playing around with.
Andy Walpole´s last blog ..The internet 10 years ago this month – January 2000
March 7th, 2010 at 4:59 am
Thanks for the pointers. I’m at the stage in building my website that I really need to offset parts of the text in my longer articles and nice, subtle borders are going to do it for me!
Otherwise, my visitors (not all accountants) would get bored very quickly…
We all need help getting to the “bottom line” of the page or an article and borders can emphasize important parts of the text in a very elegant way.
June 6th, 2010 at 6:02 pm
I think I’ll try it out, I simply ruled them out because its hard to make them look good. Thanks for the read!