rv20 Posted May 21, 2009 Share Posted May 21, 2009 I have 3 div boxes side by side and all are contained in a container div, the middle div has padding on the left and right hand sides and hence making a space between the divs, i want though a white line running down the center of the padding to give a seperator effect, the background is black btw, any ideas, So like, <div class = "cont"> <div class = "box1"> <div class = "box2"> <div class = "box1"> </div></div></div> so box2 has a margin margin:0px 30px 0px 29px; here is a pic to illustrate. Link to comment https://forums.phpfreaks.com/topic/159016-how-to-add-a-white-color-line-in-center-of-padding/ Share on other sites More sharing options...
Hybride Posted May 21, 2009 Share Posted May 21, 2009 Since you have padding, I think you can get away with creating a white border, something like border-right:1px solid #fff If not, you'll probably have to put another box in the middle (<div class="box1"><div id="separator"></div><div class="box2>...") and make that into a white background. That's the first thought that came to mind. Sorry if it's a bit complicated! Link to comment https://forums.phpfreaks.com/topic/159016-how-to-add-a-white-color-line-in-center-of-padding/#findComment-838633 Share on other sites More sharing options...
fbm247 Posted May 22, 2009 Share Posted May 22, 2009 This is how i would do it HTML <div id="wrap"> <div id="box1">box 1</div> <div id="box2">box 2</div> <div id="box3">box 3</div> </div> CSS body {background:#000000; color:#FFFFFF;} #wrap {width:600px; height:200px; margin:auto;} #box1 {float:left; width:150px; height:200px; padding:0px 25px 0px 25px;} #box2 {float:left; width:148px; height:200px; padding:0px 25px 0px 25px; border-left:solid 1px #FFFFFF; border-right:solid 1px #FFFFFF;} #box3 {float:left; width:150px; height:200px; padding:0px 25px 0px 25px;} Link to comment https://forums.phpfreaks.com/topic/159016-how-to-add-a-white-color-line-in-center-of-padding/#findComment-839827 Share on other sites More sharing options...
fbm247 Posted May 22, 2009 Share Posted May 22, 2009 I wasn't sure if you had fixed width or not so i just made up some dimensions which you can change to match up to the size you need. Hope it helped Link to comment https://forums.phpfreaks.com/topic/159016-how-to-add-a-white-color-line-in-center-of-padding/#findComment-839829 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.