Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
So, I'm pretty new to bootstrap.

I have a quite responsive site and I haven't had to learn bootstrap too in depth to get there, but that leave me with a (probably) very simple question:


My front page has a "back-lit" middle column so I don't have to worry about all my control being stretched too far on very large monitors. In fact, the css for this back-lit area is <div class="col-lg-8 col-md-12 col-sm-12 BackLight">. Backlight is my own class.

md and sm work fine, but what I really want is to keep the width at lg constant. At the moment, it shrinks a little when I decrease the window width.

What I really want is "col-lg-1200px col-md-12 col-sm-12 BackLight". How do I do that with bootstrap, or am I overlooking a really simple solution without bootstrap?

Thanks ^_^
Andy



UPDATE:

I have added a media class of my own:
CSS
@media (min-width: 1200px) {
    .BackLight {
            width: 1170px !important;
    }
}


I still have a slight issue of making sure the BackLight area is centered, but that should be simple
Posted
Updated 11-Sep-15 0:18am
v2

1 solution

[Initial Post]
Overriding the col-lg-12 class in your page might help. Write like below.
CSS
#divId .col-lg-12{
    width: 1200px !important;
}

[Update]
So, me and OP tried together and solved it !!! This is called partnership. :)

The below is his idea which seems to be similar as mine.
CSS
@media (min-width: 1200px) {
    .BackLight {
        width: 1170px !important;
        float: none !important;
    }
}
 
Share this answer
 
v3
Comments
Andy Lanng 11-Sep-15 6:16am    
.col-lg-12 is also used within the forms :S

Although you have given me an idea ^_^
Then narrow down to a div or something like...

#divId .col-lg-12{
width: 1200px !important;
}
Andy Lanng 11-Sep-15 6:21am    
similar to my idea ^_^
@media (min-width: 1200px) {
.BackLight {
width: 1170px !important;
float: none !important;
}
}

Add that to your solution and I'll accept it ^_^
Okay cool. Glad you solved.
Andy Lanng 11-Sep-15 6:21am    
Add that to your solution and I'll accept it ^_^

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900