I am backend dev, trying to get better at frontend things. I am wondering if there is any way, if you have a group of divs next to each other to draw a border around them when they do not represent a square shape. Here an example of what I am trying:
#child1 {
top: 0px;
left: 0px;
background:red;
}
#child2 {
top: 50px;
left: 0px;
background:blue;
}
#child3 {
top: 0px;
left: 50px;
background:green;
}
.child {
position: absolute;
width: 48px;
height: 48px;
border: 2px black solid;
}
<div>
<div style="position: relative" class="parent">
<div id="child1" class="child">1</div>
<div id="child2" class="child">2</div>
<div id="child3" class="child">3</div>
</div>
</div>
https://jsfiddle.net/udxes0z3/
I would like to have the borders you can see but not the borders between "1" + "3" and "1" + "2".
Is there any way this can done via CSS
? I would like to avoid calculating those borders programmatically (that is what I am currently doing, which is causing performance issues).
Thx for any hints or telling me this is not possible ;-)
*edit
The example is over simplified compared to the "real" problem, actuals shapes may look like this: