...

View Full Version : adding space between a background & its border



kyllle
11-20-2008, 12:08 PM
Hi guys just want to know how to add space between a background color and its border, basically iv tried padding but with no luck:


<style type="text/css">

.box{
width: 200px;
height: 100px;
background-color: #dedede;
border: 5px solid #000;
padding: 10px;
}


</style>
</head>

<body>
<div class="box"></div>
</body>

abduraooft
11-20-2008, 12:39 PM
You may need to have two divs, like

<style type="text/css">
.box{
width: 200px;
height: 100px;
border: 5px solid #000;
padding: 10px;
postion:relative;
}
.box div{
postion:absolute;
width:100%;
height:100%;
background-color: #dedede;
}
</style>

<div class="box" >
<div></div>
</div>

kyllle
11-20-2008, 03:00 PM
ah loads of thanks Abdul!!!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum