I have eight "simple" panels that I want to layout using Bootstrap 3. The markup is
<div class="dashboard">
<div class="dashboard-panel">
<h1>Panel 1</h1>
<p>This is panel 1 (and a random piece of text)</p>
</div>
<div class="dashboard-panel">
<h1>Panel 2</h1>
<p>This is panel 2 (and a random piece of text)</p>
</div>
// ...and so on - up to panel 8.
</div>
I'd like two two rows of four in md column size and four rows of two in sm column size.
I'm using this following LESS rules:
.dashboard {
.make-row();
}
.dashboard-panel {
.make-sm-column(6);
.make-md-column(3);
}
However, this creates problems in that the panels don't always form two rows of four. It depends on how much content is in the respective panels. If one of the panels is relatively short, a third row gets created with other panels until the short panels.
I thought that, as I'm filling up all 12 slots with the first four panels, the next four would move cleanly to the second row.
What am I doing wrong? And how can I make this work while retaining the semantic markup?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…