Distribute Boxes

by marakoss

HTML

<div id="container"><div class="box1">test text for text test purporses after test text  </div><div class="box2">test text for text test purporses after test text </div><div class="box3">test text for text test purporses after test text </div><div class="box4">test text for text test purporses after test text </div><span class="stretch"></span>
</div>

CSS

*{
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}
#container {
    border: 2px dashed #444;
    height: 125px;
    
    text-align: justify;
    -ms-text-justify: distribute-all-lines;
    text-justify: distribute-all-lines;
    
    /* just for demo */
    min-width: 612px;
}

.box1, .box2, .box3, .box4 {
    width: 25%;
    height: 125px;
    vertical-align: top;
    display: inline-block;
    *display: inline;
    zoom: 1;
    padding: 0 20px 0 0;
    text-align: left;
}


.stretch {
    width: 100%;
    display: inline-block;
    font-size: 0;
    line-height: 0
}

.box1, .box3 {
    background: #ccc
}
.box2, .box4 {
    background: #0ff
}