Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap 3: place sidebar left but having it beneath the content when collapsing

I'm developing a website using Twitter Bootstrap 3, and I do have two problems:

  1. how can I place a sidebar left on large screens, but having it placed under the content when page is collapsed?

This is my structure for instance (I had to place the sidebar right to have it down when collapsing):

    <div class="col-md-8">
      <p>This is content, and when collapsing I want it to be placed over the sidebar! </p>
    </div>
    <div class="col-md-4">
      <p>This is sidebar, and it gets down, but I would like to have it placed at the left side of the content!</p>
    </div>

Thank you very much, Ralf

like image 989
Ralf Glaser Avatar asked Sep 25 '13 15:09

Ralf Glaser


Video Answer


1 Answers

The pull and push classes are great for this, try:

<div class="col-md-8 col-md-push-4">
  <p>This is content, and when collapsing I want it to be placed over the sidebar! </p>
</div>
<div class="col-md-4 col-md-pull-8">
  <p>This is sidebar, and it gets down, but I would like to have it placed at the left side of the content!</p>
</div>
like image 110
kalhartt Avatar answered Sep 26 '22 07:09

kalhartt