I am using Bootstrap with a two-column layout for large screen sizes. For smaller screens, there is only one column.
I would like to have the main content in the left-hand column, and illustrations and such in the right-hand column. To make sure that the illustrations are positioned correctly on smaller screens, I must separate the content in the left-hand column into different cells, so that the content in the right-hand column can be positioned between them, like this:
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-6">
The first text on the page.
</div>
<div class="col-xs-12 col-md-6">
<img src="illustration.jpg" alt="">
</div>
<div class="col-xs-12 col-md-6">
The text continues here.
</div>
</div>
</div>
Now, if the image in the right-hand column is quite tall, there will be a gap between the cells in the first column, like this:
+--------------------++--------------------+
| some text that || █▒▒███ |
| is placed in this || ███████████ |
| column || ██ ████████ |
+--------------------+| █ ▄█▄ ████████ |
| █ ▀█▀ █████████ |
| ██ ███████████ |
| █████████▓▓▓▓██ |
| ███████▓▓▓▓██ |
| ███████▓▓▓▓█ |
| ███████▓▓▄▀ |
| ███████▄▀ |
| █████████ |
| ██ █████ |
| █ ▄█▄ ████ |
| █ ▀█▀ ████ |
| ██ ████▀ |
| ███████▀ |
| █▒▒█▀ |
+--------------------+
+--------------------+
| i would prefer |
| this text to |
| follow directly |
| after the text |
| above, and avoid |
| the vertical space |
| caused by the tall |
| image in the right |
| hand column |
+--------------------+
On smaller screens it looks like it should, with the car placed between the texts:
+--------------------+
| some text that |
| is placed in this |
| column |
+--------------------+
+--------------------+
| █▒▒███ |
| ███████████ |
| ██ ████████ |
| █ ▄█▄ ████████ |
| █ ▀█▀ █████████ |
| ██ ███████████ |
| █████████▓▓▓▓██ |
| ███████▓▓▓▓██ |
| ███████▓▓▓▓█ |
| ███████▓▓▄▀ |
| ███████▄▀ |
| █████████ |
| ██ █████ |
| █ ▄█▄ ████ |
| █ ▀█▀ ████ |
| ██ ████▀ |
| ███████▀ |
| █▒▒█▀ |
+--------------------+
+--------------------+
| i would prefer |
| this text to |
| follow directly |
| after the text |
| above, and avoid |
| the vertical space |
| caused by the tall |
| image in the right |
| hand column |
+--------------------+
But how can I make it look something like this on larger screens?
+--------------------++--------------------+
| some text that || █▒▒███ |
| is placed in this || ███████████ |
| column || ██ ████████ |
+--------------------+| █ ▄█▄ ████████ |
+--------------------+| █ ▀█▀ █████████ |
| i would prefer || ██ ███████████ |
| this text to || █████████▓▓▓▓██ |
| follow directly || ███████▓▓▓▓██ |
| after the text || ███████▓▓▓▓█ |
| above, and avoid || ███████▓▓▄▀ |
| the vertical space || ███████▄▀ |
| caused by the tall || █████████ |
| image in the right || ██ █████ |
| hand column || █ ▄█▄ ████ |
+--------------------+| █ ▀█▀ ████ |
| ██ ████▀ |
| ███████▀ |
| █▒▒█▀ |
+--------------------+