...

View Full Version : CSS border instead of tables border



jasonc310771
11-01-2008, 11:54 PM
i have played around with this code i wrote but not able to get the borders to work right.

wanting a botrder around the whole DIV, width of 20px, but not the whole browser,

can someone please advise what i am doing wrong



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
<!--
.page {
width: 500px;
height: 400px;
}

.left {
width: 20px;
height: 100%;
background: url(spacer.gif) left top repeat-y;
}

.top {
width: 100%;
height: 20px;
background: url(spacer.gif) left top repeat-x;
}

.middle {
text-align: center;
}

.bottom {
width: 100%;
height: 20px;
background: url(spacer.gif) left bottom repeat-x;
}

.right {
width: 20px;
height: 100%;
background: url(spacer.gif) right top repeat-y;
}
-->
</style>
</head>

<body>
<div class="page">
<div class="left">
<div class="top">
<div class="bottom">
<div class="right">
<div class="middle">afghdfghdfghndfghbdfghbdfghbdfghfghdfgbc<br><br><br><br><br><br><br><br><br><br><br><br><br><br></div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

gnomeontherun
11-02-2008, 12:00 AM
Add this to any element to make it a 20px wide, solid black border. You can see the property here (http://www.w3schools.com/css/css_border.asp).


border: 20px solid #000000;



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum