我正在使用Bootstrap 3 Accordion Collapse,現在一切都加載到一列中,我如何製作它以便面板在桌面分辨率和移動模式下使用多列?bootstrap讓手風琴響應?
<div class="row">
<div class="panel-group" id="accordion">
<?php
foreach ($states as &$state) {
?>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#<?php echo $state; ?>">
<?php echo $state; ?></a>
</h4>
</div>
<div id="<?php echo $state; ?>" class="panel-collapse collapse in">
<div class="panel-body">Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat.</div>
</div>
</div>
<?php }
?>
</div>
</div>
編輯
這是我edided HTML
<div class="row">
<div class="col-md-4 col-xs-12">
<div class="panel-group" id="accordion">
<?php
foreach ($states as &$state) {
?>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#<?php echo preg_replace('/\s+/', '', $state); ?>">
<?php echo $state; ?></a>
</h4>
</div>
<div id="<?php echo preg_replace('/\s+/', '', $state); ?>" class="panel-collapse collapse in">
<div class="panel-body">test</div>
</div>
</div>
<?php }
?>
</div>
</div>
</div>
,現在看起來是這樣的。在桌面分辨率
每個'.row'都應該包含'.col-'。如果你總是使用'.col-xs-'類,那麼你將永遠有一個響應式容器 – Lewk