I've been looking for some examples (here) to help guide me with drawing two circles with a line between them (sort of like point A to point B graphic) using CSS. I'm very new to custom-CSS so forgive me if this is something simple I am missing in my config.
I have the CSS created with the graphic being displayed on my webpage, but depending on screen-size, my outer-circle can become deformed - I think it has something to do with my display: flex
maybe? See the following screenshots:
Good design
Here is my CSS code specific to making the graphic
.circuit-graphic {
display: flex;
align-items: center;
justify-content: center;
}
.circuit-graphic .circle {
width: 60px;
height: 60px;
border: 2px solid #dc3545;
border-radius: 50%;
position: relative;
}
.circuit-graphic .circle:before {
display: block;
content: '';
width: 40px;
height: 40px;
background: #dc3545;
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.circuit-graphic .line {
width: 100%;
border: 5px solid #dc3545;
}
and I set it in my HTML like so in pseudo
<div class="row align-items-center">
<div class="col-auto">
[.........]
</div>
<div class="col">
<div class="circuit-graphic">
<div class="circle"></div>
<div class="line"></div>
<div class="circle"></div>
</div>
</div>
<div class="col-auto">
[.........]
</div>
</div>
The goal I am trying to achieve is have two boxes on either side of the screen, with this graphic between them that can change it's width dynamically based on the screen size.
See my working example here.