我如何只为bootstrap lg保留一个固定的? [英] How do I keep a fixed with for bootstrap lg only?
问题描述
所以,我对bootstrap很新。
我有一个响应迅速的网站,我没有必要深入学习bootstrap到达那里,但这给我留下了一个(可能)非常简单的问题:
我的头版有一个背光中间栏所以我不必担心我的控件在非常大的显示器上被拉得太长。实际上,这个背光区域的css是< div class =col-lg-8 col-md-12 col-sm-12 BackLight>
。背光是我自己的课。
md和sm工作正常,但我真正想要的是将宽度保持在lg不变。此刻,当我减小窗口宽度时,它会缩小一点。
我真正想要的是col-lg-1200px col-md-12 col-sm -12 BackLight。我如何使用bootstrap,或者我忽略了一个没有bootstrap的简单解决方案?
谢谢^ _ ^
Andy
更新:
我有添加了我自己的媒体类:
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:
@media (min-width: 1200px) {
.BackLight {
width: 1170px !important;
}
}
我仍然有一个小问题,确保BackLight区域居中,但这应该是简单的
I still have a slight issue of making sure the BackLight area is centered, but that should be simple
推荐答案
[初始发布]
覆盖col-lg-12
类在您的页面可能会有帮助。写如下。
[Initial Post]
Overriding thecol-lg-12
class in your page might help. Write like below.
#divId .col-lg-12{
width: 1200px !important;
}
[更新]
所以,我和OP一起尝试解决了!这称为伙伴关系。 :)
以下是他的想法,似乎与我的相似。
[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.
@media (min-width: 1200px) {
.BackLight {
width: 1170px !important;
float: none !important;
}
}
这篇关于我如何只为bootstrap lg保留一个固定的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!