How to avoid double border lines from the list style? Please see the following fiddle for clear picture. I want 1px width of each box but they are double when the come together.
http://jsfiddle.net/awaises/4SLPh/1/
HTML :
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
CSS :
ul{
margin:0; padding:0;
list-style:none;
}
ul li{
width:30%; height:200px;
border:1px solid black;
float:left;
}
Thanks
Add a border-left and border-top to the parent. Add border-right and border-bottom to each of the children.
You can remove the space between the different borders by using the CSS border-collapse property. You can apply this property against the HTML table element. When you apply this against the table element, you'll notice that the table border simply disappears, or "collapses".
To avoid having double borders like in the example above, set the CSS border-collapse property to collapse .
Multiple borders in CSS can be done by box-shadow property. Generally, we can get a single border with border property. Box-shadow property is not for multiple borders, but still, we are creating multiple borders with box-shadow property.
Try adding margin-right:-1px; margin-bottom:-1px;
It's a matter of applying borders to the ul & li selectively.
JSFiddle Demo
CSS
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
ul{
margin:10px; padding:0;
list-style:none;
border-left:1px solid black;
border-top:1px solid black;
overflow:hidden;
}
ul li{
width:33.3333%; height:200px;
border-bottom:1px solid black;
border-right:1px solid black;
float:left;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With