I currently have a layout using Bootstrap 5
with multiple rows and columns. My goal is to have the columns aligned within each row, but I am experiencing issues where some borders are not lining up correctly with the columns.
.VI-border {
border-top: 1px solid grey;
border-left: 1px solid grey;
border-right: 1px solid grey;
}
.VI-border-top {
border-top: 1px solid grey;
}
.VI-border-bottom {
border-bottom: 1px solid grey;
}
.VI-border-left {
border-left: 1px solid grey;
}
.VI-border-right {
border-right: 1px solid grey;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.3/css/bootstrap.min.css">
<div class="row VI-border text-center">
<div class="col-sm-1 VI-border-right VI-border-bottom" style="word-break: break-word;">
VI 10
</div>
<div class="col-sm-2 VI-border-right VI-border-bottom">Ammaloramento</div>
<div class="col-sm-1 VI-border-right VI-border-bottom">Gravità</div>
<div class="col-sm-2 VI-border-right VI-border-bottom">Estensione</div>
<div class="col-sm-3 VI-border-right VI-border-bottom">Dettaglio</div>
<div class="col-sm-2 offset-sm-1 VI-border-left VI-border-bottom">Segnalazioni</div>
</div>
<div class="row text-center">
<div class="offset-sm-1 col-sm-2 VI-border-right VI-border-bottom VI-border-left">
Ossidazione
</div>
<div class="col-sm-1 VI-border-right VI-border-bottom">
Lieve
</div>
<div class="col-sm-2 VI-border-right VI-border-bottom">
75 %
</div>
<div class="col-sm-3 VI-border-right VI-border-bottom">
In corrispondenza delle giunzioni, Forte in corrispondenza della giunzione n. 3 da imbocco Sud
</div>
<div class="offset-sm-1 col-sm-2 VI-border-right VI-border-bottom VI-border-left" style="height: 22px;">
Presenti: 0
</div>
</div>
If you examine the code snippet closely (by opening the full page or expanding the snippet), you'll notice that the borders of the second row do not align perfectly with those of the first row. The issue may lie in the borders themselves, but I'm unsure how to fix it while maintaining the border aesthetic.
Any suggestions on how to tackle this problem?