Jquery 引导按钮对齐小屏幕宽度
好的,我正在为我正在构建的一个小型调查网站设计一些按钮,我很高兴它在桌面上的外观,但是当我将浏览器窗口的大小调整到类似于手机的大小时,我无法让按钮在彼此下方对齐。桌面大小的版本有两行,一行有3个按钮,另一行有2个按钮 全尺寸桌面看起来还可以: 缩小宽度: 我的按钮代码:Jquery 引导按钮对齐小屏幕宽度,jquery,html,css,twitter-bootstrap,Jquery,Html,Css,Twitter Bootstrap,好的,我正在为我正在构建的一个小型调查网站设计一些按钮,我很高兴它在桌面上的外观,但是当我将浏览器窗口的大小调整到类似于手机的大小时,我无法让按钮在彼此下方对齐。桌面大小的版本有两行,一行有3个按钮,另一行有2个按钮 全尺寸桌面看起来还可以: 缩小宽度: 我的按钮代码: <div class="panel-body" style="padding-bottom:0px;"> <div class="row"> <div class="b
<div class="panel-body" style="padding-bottom:0px;">
<div class="row">
<div class="btn-group btn-group-justified mg0 pd0"role="group" aria-label="...">
<div class="col-xs-6 col-sm-4 mg0 pd0">
<button type="button" class="btn btn-default btn-lg btn-block" id="btnChoice1" value="<?php echo $aId[0];?>"><?php echo $aTitle[0];?></button>
</div><div class="col-xs-6 col-sm-4 mg0 pd0">
<button type="button" class="btn btn-default btn-lg btn-block" id="btnChoice2" value="<?php echo $aId[1];?>"><?php echo $aTitle[1];?></button>
</div><div class="col-xs-6 col-sm-4 mg0 pd0">
<button type="button" class="btn btn-default btn-lg btn-block" id="btnChoice3" value="<?php echo $aId[2];?>"><?php echo $aTitle[2];?></button>
</div>
</div>
</div><div class="row">
<div class="btn-group btn-group-justified mg0"role="group" aria-label="...">
<div class="col-xs-6 mg0 pd0">
<button type="button" class="btn btn-default btn-lg btn-block" id="btnChoice4" value="<?php echo $aId[3];?>"><?php echo $aTitle[3];?></button>
</div><div class="col-xs-6 mg0 pd0">
<button type="button" class="btn btn-default btn-lg btn-block" id="btnChoice5" value="<?php echo $aId[4];?>"><?php echo $aTitle[4];?></button>
</div>
</div>
</div>
</div>
尝试将classclass=“col-xs-12”
而不是class=“col-xs-6”
添加到按钮divs
这意味着按钮将以xs分辨率占据所有12个网格列,而不是col-6的2个按钮,谢谢我现在得到了它下面的两个按钮需要md声明,现在它已修复,我了解它是如何工作的现在网格xs md lg系统
<div class="btn-group btn-group-justified mg0 "role="group" aria-label="...">
<div class="mg0 pd0 col-xs-12 col-md-6">
<button type="button" class="btn btn-default btn-lg btn-block" id="btnChoice4" value="<?php echo $aId[3];?>"><?php echo $aTitle[3];?></button>
</div><div class="mg0 pd0 col-xs-12 col-md-6">
<button type="button" class="btn btn-default btn-lg btn-block" id="btnChoice5" value="<?php echo $aId[4];?>"><?php echo $aTitle[4];?></button>
</div>
</div>
当屏幕很小时,按钮可以很好地相互对齐,但是桌面大小的屏幕现在有两个按钮相互下方,而不是相邻,因此它现在有3个按钮,1个按钮,1个按钮,其中需要3个按钮,2个按钮…感谢您目前正在寻找类似:class=“col-xs-12 col-md-6“。为了解释,这意味着在“md”中屏幕或更大屏幕上,按钮将以行或2行对齐。所以两个按钮并排。如果你想要3个并排的按钮,你应该使用col-md-4来代替。是的,我刚刚注意到我为下面的两个按钮添加了它们,它们现在可以很好地调整大小了。