Bootstrap thumbnails messed up when blocking large display settings
Asked Answered
H

1

6

Using Bootstrap 2.3.2 I used the following solution to block my page adapting to the large display settings:

@media (min-width:970px) and (max-width: 2500px) {
    .container {
        width: 970px;
    }   
}  

... which has been working fine until I created thumbnails:

<div class="container frame">
    <h3>grid problems above 1200px</h3>
    <ul class="thumbnails">
        <li class="span4">
            <div class="thumbnail">Thumbnail #1</div>
        </li>
        <li class="span4">
            <div class="thumbnail">Thumbnail #2</div>
        </li>
        <li class="span4">
            <div class="thumbnail">Thumbnail #3</div>
        </li>
        <li class="span4">
            <div class="thumbnail">Thumbnail #4</div>
        </li>
        <li class="span4">
            <div class="thumbnail">Thumbnail #5</div>
        </li>
    </ul>
</div>

There are three thumbnails in a row, but when I pull the browser window to exceed 1200px, the thumbnails re-arrange and there are only two by row.

How can I solve this?

Do I need to redefine all those bootstrap .span tags?

This is my fiddle: https://jsfiddle.net/michi001/b7n1byvx/

Hint answered 15/2, 2016 at 22:41 Comment(4)
are there alternatives to Trevor's solution?Hint
can you explain why you are looking for alternatives? Is there a reason the css solution doesn't work?Emancipation
@Emancipation yes, I'd have to redefine all .span tags, which seems a rather big modification. My question for an alternative is about finding a simpler way, if there is one. The solution you provided is working great, and I awarded the bounty to you.Hint
Ahh okay hmm, some of the answers here might help you.. #9730763Emancipation
E
3

Bootstrap has a "CSS" rule once you hit "1200px" that changes the width of "span4" elements from 300px to 370px.

So in your css you can add a rule so that "span4" elements stay at the 300px width.

@media (min-width:970px) and (max-width: 2500px) {
  .container {
    width: 970px;
  }
  .span4 {
    width: 300px;
  }
} 

Which keeps the thumbnails 3 across as you cross the 1200 width threshold.

Fiddle:

https://jsfiddle.net/b7n1byvx/2/

Emancipation answered 24/2, 2016 at 20:57 Comment(1)
@Hint please mark this answer as accepted if it answered your question, or leave feedback. ThanksEmancipation

© 2022 - 2024 — McMap. All rights reserved.