I have a grid created with a ul
list whose inner elements at li
contains a border.
The idea is that when the elements are side by side the edges are manipulated so that there is only a single trace with 1 pixel instead of what happens:
Problem
Sincethelistmustbe100%wideintheareawhereitisinsertedanditsli
elementsmustbe25%ofthewidthofthelist,thegrayborderisappliedtothea
linkwithineachli
soastoavoidthatthe25%widthplusthe2pixelsthattheborder(1pxrightborder+1pxleftborder)occupybreakthelayout:HTML
<ul>
<li>
<a href="#" title="">1</a>
</li>
<li>
<a href="#" title="">2</a>
</li>
<li>
<a href="#" title="">3</a>
</li>
<li>
<a href="#" title="">4</a>
</li>
<li>
<a href="#" title="">5</a>
</li>
<li>
<a href="#" title="">6</a>
</li>
<li>
<a href="#" title="">7</a>
</li>
<li>
<a href="#" title="">8</a>
</li>
</ul>
CSS
ul, li, a{
display:block;
margin:0;
padding:0;
}
ul{
width:100%;
}
li{
float:left;
width:25%;
}
a{
border:1px solid #c9c7c7;
text-align:center;
height:200px;
}
Question
How do I make the final gray border look like this?