Html 在引导程序中创建 3 个并排面板

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20376179/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 22:21:17  来源:igfitidea点击:

Create 3 side by side panel in bootstrap

htmlcsstwitter-bootstrap-3

提问by Phoenix_uy

How can i create 3 panels in bootstrap side by side? I try with this with out luck:

如何在引导程序中并排创建 3 个面板?我不走运地尝试这样做:

<div class="panel panel-default">
   <div class="panel-heading">Main panel</div>
    <div class="row">
        <div class="col-sm-4">
            <div class="panel panel-default">
                 <div class="panel-heading">panel 1</div>
            </div>
        </div>
        <div class="col-sm-6">
             <div class="panel panel-default">
                 <div class="panel-heading">panel 2</div>
            </div>
        </div>
        <div class="col-sm-2">
            <div class="panel panel-default">
                 <div class="panel-heading">panel 3</div>
            </div>
        </div>
    </div>
   </div>
</div>

Result:

结果:

Main panel
    PANEL 1 
    PANEL 2 
    PANEL 3

回答by Ravimallya

You could have to use col-lg-x col-md-x col-sm-xclasses where xis the column number.

您可能必须使用列号col-lg-x col-md-x col-sm-x所在x的类。

It is working fine for me after adding proper media width columns. You can check it http://bootply.com/98480.

添加适当的媒体宽度列后,它对我来说工作正常。你可以检查它http://bootply.com/98480

If you added col-sm-xclasses only, then it will not apply to the devices where viewport is less than 768px.

如果col-sm-x仅添加类,则不适用于视口小于 768px 的设备。