
This example uses a different technique to the previous page. Instead of using background images, this example floats the left and right border images into each corner.
Click here to see what the example looks like
To start, most browsers have some default margins, so the body is cleared of any margins and also padding. I don't know of any browser that has default padding, but it's included just in case.
body {margin: 0; padding: 0;}
#column-holder {margin: 0 10px;}
.leftbox {float: left; width: 160px; color: navy; background: white;}
.rightbox {float: right; width: 240px; color: navy; background: white;}
.centerbox {margin: 0 250px 0 170px; color: navy; background: white;}
.topborder {margin: 0 11px 11px 11px; border-top: 1px solid black;}
.content {border-left: 1px solid black; border-right: 1px solid black;}
.bottomborder {margin: 11px 11px 0 11px; border-bottom: 1px solid black;}
.floatleft {float: left;}
.floatright {float: right;}
It's as easy as that, all done with floats and margins. Padding can be added to the content style as needed.
<div id="column-holder">
<div class="leftbox">
<img class="floatleft" src="top_left.gif" width="12" height="12" alt="" />
<img class="floatright" src="top_right.gif" width="12" height="12" alt="" />
<div class="topborder"></div>
<div class="content">L/H Content</div>
<img class="floatleft" src="bottom_left.gif" width="12" height="12" alt="" />
<img class="floatright" src="bottom_right.gif" width="12" height="12" alt="" />
<div class="bottomborder"></div>
</div>
<div class="rightbox">
<img class="floatleft" src="top_left.gif" width="12" height="12" alt="" />
<img class="floatright" src="top_right.gif" width="12" height="12" alt="" />
<div class="topborder"></div>
<div class="content">R/H Content</div>
<img class="floatleft" src="bottom_left.gif" width="12" height="12" alt="" />
<img class="floatright" src="bottom_right.gif" width="12" height="12" alt="" />
<div class="bottomborder"></div>
</div>
<div class="centerbox">
<img class="floatleft" src="top_left.gif" width="12" height="12" alt="" />
<img class="floatright" src="top_right.gif" width="12" height="12" alt="" />
<div class="topborder"></div>
<div class="content">Main Content Here</div>
<img class="floatleft" src="bottom_left.gif" width="12" height="12" alt="" />
<img class="floatright" src="bottom_right.gif" width="12" height="12" alt="" />
<div class="bottomborder"></div>
</div>
</div><!-- close column-holder -->
How the borders work
As you will have noticed, the center column is actually last in the html, but displays in the middle, before the right column. It can be put first in the html with another technique using negative margins, but that will be for another page.
Download the example with the images Zipped Borders Example so you can try it locally on your computer.
If you wanted to, you could put the right hand column first in the html, and it would still work. This is sometimes useful as search engines will get this column's data first, and maybe index it better.