A
A
Andrew2018-03-05 05:04:12
css
Andrew, 2018-03-05 05:04:12

How to collapse (combine) the borders of adjacent blocks?

In the link example, there are many elements with a 1 pixel border. The borders of neighboring elements merge, resulting in a thick border of 2 pixels. Is it possible to merge the borders of adjacent elements with CSS? Preferably without changing the display property of the elements to table-like values.
https://jsfiddle.net/f7c7qww4/4/
Now it looks like this

spoiler
5a9cacf792791742990215.jpeg

I wish so
spoiler
5a9cad0288fb0329638819.jpeg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Lone Ice, 2018-03-05
@byte916

width: 50px;
height: 40px;
border: 1px solid #000;
box-sizing: border-box;
margin: -1px -1px 0 0;

X
xmoonlight, 2018-03-05
@xmoonlight

https://codepen.io/dalgard/pen/Dbnus

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question