How do I create this layout with Twitter Bootstrap...
So that it stacks like this ...
I could do the layout as a table (currently it's an image map, but that was a quick and dirty short term solution), but as I understand bootstrap, the table wouldn't know how to stack the cells. I've seen a number of Bootstrap demos that give "rowspan" like functionality, but in this case I need a "colspan" like function. Can Bootstrap do this?
The Bootstrap grid allows 12 columns with 30 px wide gutters by default, but these numbers can be adjusted. Just check the Grid System block on the Customize page. The @grid-columns field allows to set a different number of columns, and the @grid-gutter-width field lets you change the gutter width.
Bootstrap's grid system uses a series of containers, rows, and columns to layout and align content. It's built with flexbox and is fully responsive. Below is an example and an in-depth explanation for how the grid system comes together.
Bootstrap has a responsive grid system, with custom breakpoints. It offers a mobile-first design that makes a single code scale for multiple devices like phones, tablets, and desktops.
If we want to place the content precisely on a page, then CSS Grid is better, but if we want the flexibility of the layout, then we should go for Bootstrap.
Assuming you want to use Bootstrap 3.1.1 something like this should work. You might have to add some tweaks but it should solve your problem. Basically you put your subheaders and your content blocks together in one column each, so that the stick together on smaller screens.
<div class="container">
<div class="row">
<div class="col-xs-2">
3
</div>
<div class="col-xs-10">
<div class="row">
<div class="col-sm-12">
Research complete
</div>
</div>
<div class="row">
<div class="col-sm-4">
<div>Protocol and data</div>
<div>
<ul>
<li>...</li>
<li>...</li>
<li>...</li>
</ul>
</div>
</div>
<div class="col-sm-4">
<div>Study specific</div>
<div>
<ul>
<li>...</li>
<li>...</li>
<li>...</li>
</ul>
</div>
</div>
<div class="col-sm-4">
<div>Ethics/governance and regulatory</div>
<div>
<ul>
<li>...</li>
<li>...</li>
<li>...</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
JSFiddle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With