The Dilemma...
I am attempting to position div
elements over a border, while maintaining space on both sides of each div
. Take a look at the scenario:
Note the gaps surrounding the black divs.
I am struggling to find a solution for this issue, aside from the two obvious options of:
- Overlaying a border across the entire width and then using an image with a background to conceal the border behind
- Alternatively, dividing the border into columns and adding margins (seems like the most viable option in my situation)
My Attempts So Far...
Since I am seeking advice on a clever CSS technique here on SO, I have not experimented with anything yet as I am unsure where to begin... Hence, looking for a cool CSS trick...
The Big Question (In case it wasn't clear already)
Are there any alternative methods (besides the ones mentioned earlier), or neat tricks to achieve the setup depicted in the image above?
If there are no solutions beyond what I've already stated, please refrain from answering this question as I can definitely handle writing this code myself, and there are other SO users who could benefit more from your assistance :-)
Update
Below is a jsFiddle displaying how it currently appears without the desired gaps: