I have a few divs aligned horizontally. How do I make the spacing between them automatic so that if I resize the screen or add another div, there will be equal spacing between d
You may use inline-block
+ text-align:justify;
for older browser generating an extra last invisible line with :after
, or flex
+ justify-content:space-betwween;
.ib {
text-align:justify;
}
.ib:after {
content:'';
display:inline-block;
width:99%;
}
.flex {
display:flex;
justify-content:space-between;
}
.d100 {
width:100px;
height:2em;
background:blue;
display:inline-block;
}