I have a set of divs going left and down like a ladder. Maybe there is a better way to do this, but I get it.
Now I would like to have a div around all these "stairs". something like that:

Please note that these stairs start from the middle (horizontal) of the page. How can I make this outer div according to the specified number of stairs without having to gain height and width?
Another important point is that sometimes there are only 4 steps, which means that the div should be adjusted according to the displayed div.
Here you have a small plunker if you want to check it out:
Plunker
Here's a css stylesheet with the above "stairs"
.box1 {
text-align: center;
border: 1px solid #eaeaea;
border-radius: 2px;
margin-left: 30%;
width: 8%;
height: 40px;
}
.box2 {
text-align: center;
margin-left: 38%;
border: 1px solid #eaeaea;
border-radius: 2px;
width: 8%;
height: 40px;
}
.box3 {
text-align: center;
margin-left: 46%;
border: 1px solid #eaeaea;
border-radius: 2px;
width: 8%;
height: 40px;
}
.box4 {
text-align: center;
margin-left: 54%;
border: 1px solid #eaeaea;
border-radius: 2px;
width: 8%;
height: 40px;
}
.box5 {
text-align: center;
margin-left: 62%;
border: 1px solid #eaeaea;
border-radius: 2px;
width: 8%;
height: 40px;
}
.box6 {
text-align: center;
margin-left: 70%;
border: 1px solid #eaeaea;
border-radius: 2px;
width: 8%;
height: 40px;
}
<div class="boxContainer">
<div class="row box1">
hello 1
</div>
<div class="row box2">
hello 2
</div>
<div class="row box3">
hello 3
</div>
<div class="row box4">
hello 4
</div>
<div class="row box5">
hello 5
</div>
<div class="row box6">
hello 6
</div>
</div>
Run codeHide result
N.Car