html - 在 Col-md-3 中显示全宽列

标签 html css twitter-bootstrap-3

我期望的设计是这样的 enter image description here

您在顶部看到的每个 pod 都有相应的内部隐藏内容。在那个加号按钮上单击我将显示它并且显示的内容需要像图像中那样占据全宽。一切正常,除了内部内容(类名 shower)没有对齐全宽。这是我的代码

 $(document).ready(function() {
   $(".cssCircle").click(function() {
     var id = $(this).attr('data-target');

     $(id).show();
   });
 });
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<div class="container charity-listing">
  <ul style="list-style:none;">
    <li class="col-md-3 odd" style="width:22% !important ;border: 1px solid #ccc;border-radius: 8px 8px 8px 8px;margin:4px 4px 4px 4px">
      <div class="pod">
        <img style="position:inherit !important;right:0px !important;width:100%;max-width:100%;height:auto;" src="https://s16.postimg.org/c7m216tvp/images.png">
        <strong title="Charity test">Charity test</strong>
        <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore</p>
        <div class="cssCircle plusSign" data-toggle="modal" data-target="#tabsec0">+</div>
      </div>
      <div class="col-md-12 shower in" style="display:none" id="tabsec0" aria-hidden="false">
        <div class="col-md-4">
          <!--WoW Slider End-->
        </div>
        <div class="col-md-8">
          <h3>Charity test</h3>
          <p>
            <strong>Lorem Ipsum</strong>
            <span>is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.<br />is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.</span>
          </p>
          <p>
          </p>
        </div>
      </div>
    </li>
    <li class="col-md-3 odd" style="width:22% !important ;border: 1px solid #ccc;border-radius: 8px 8px 8px 8px;margin:4px 4px 4px 4px">
      <div class="pod">
        <img style="position:inherit !important;right:0px !important;width:100%;max-width:100%;height:auto;" src="https://s16.postimg.org/c7m216tvp/images.png">
        <strong title="Charity test">Charity test</strong>
        <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore</p>
        <div class="cssCircle plusSign" data-toggle="modal" data-target="#tabsec0">+</div>
      </div>
      <div class="col-md-12 shower in" style="display:none" id="tabsec0" aria-hidden="false">
        <div class="col-md-4">
          <!--WoW Slider End-->
        </div>
        <div class="col-md-8">
          <h3>Charity test</h3>
          <p></p>
          <p>
            <strong>Lorem Ipsum</strong>
            <span>is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry. <br />is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.</span>
          </p>
          <p></p>
        </div>
      </div>
    </li>
    <li class="col-md-3 odd" style="width:22% !important ;border: 1px solid #ccc;border-radius: 8px 8px 8px 8px;margin:4px 4px 4px 4px">
      <div class="pod">
        <img style="position:inherit !important;right:0px !important;width:100%;max-width:100%;height:auto;" src="https://s16.postimg.org/c7m216tvp/images.png">
        <strong title="Charity test">
                    Charity test
                </strong>
        <p>
          Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore
        </p>
        <div class="cssCircle plusSign" data-toggle="modal" data-target="#tabsec0">
          +
        </div>
      </div>
      <div class="col-md-12 shower in" style="display:none" id="tabsec0" aria-hidden="false">
        <div class="col-md-4">
          <!--WoW Slider End-->
        </div>
        <div class="col-md-8">
          <h3>
                        Charity test
                    </h3>
          <p>
          </p>
          <p>
            <strong>
                            Lorem Ipsum
                        </strong>
            <span>
                            is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry. <br />
                            is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.
                        </span>
          </p>
          <p>
          </p>
        </div>
      </div>
    </li>
    <li class="col-md-3 odd" style="width:22% !important ;border: 1px solid #ccc;border-radius: 8px 8px 8px 8px;margin:4px 4px 4px 4px">
      <div class="pod">
        <img style="position:inherit !important;right:0px !important;width:100%;max-width:100%;height:auto;" src="https://s16.postimg.org/c7m216tvp/images.png">
        <strong title="Charity test">
                    Charity test
                </strong>
        <p>
          Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore
        </p>
        <div class="cssCircle plusSign" data-toggle="modal" data-target="#tabsec0">
          +
        </div>
      </div>
      <div class="col-md-12 shower in" style="display:none" id="tabsec0" aria-hidden="false">
        <div class="col-md-4">
          <!--WoW Slider End-->
        </div>
        <div class="col-md-8">
          <h3>
                        Charity test
                    </h3>
          <p>
          </p>
          <p>
            <strong>
                            Lorem Ipsum
                        </strong>
            <span>
                            is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry. <br />
                            is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.
                        </span>
          </p>
          <p>
          </p>
        </div>
      </div>
    </li>
    <li class="col-md-3 odd" style="width:22% !important ;border: 1px solid #ccc;border-radius: 8px 8px 8px 8px;margin:4px 4px 4px 4px">
      <div class="pod">
        <img style="position:inherit !important;right:0px !important;width:100%;max-width:100%;height:auto;" src="https://s16.postimg.org/c7m216tvp/images.png">
        <strong title="Charity test">
            Charity test
        </strong>
        <p>
          Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore
        </p>
        <div class="cssCircle plusSign" data-toggle="modal" data-target="#tabsec0">
          +
        </div>
      </div>
      <div class="col-md-12 shower in" style="display:none" id="tabsec0" aria-hidden="false">
        <div class="col-md-4">
          <!--WoW Slider End-->
        </div>
        <div class="col-md-8">
          <h3>
                Charity test
            </h3>
          <p>
          </p>
          <p>
            <strong>
                    Lorem Ipsum
                </strong>
            <span>
                    is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry. <br />
                    is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.
                </span>
          </p>
          <p>
          </p>
        </div>
      </div>
    </li>
  </ul>
</div>

谁能指出我在这里遗漏了什么?

CodePen version for better understanding http://codepen.io/anon/pen/eBMYVx

最佳答案

你应该删除 col-md-4 和 col-md-8 以获得全宽 看看下面的代码

 $(document).ready(function() {
   $(".cssCircle").click(function() {
     var id = $(this).attr('data-target');

     $(id).show();
   });
 });
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<div class="container charity-listing">
  <ul style="list-style:none;">
    <li class="col-md-3 odd" style="width:22% !important ;border: 1px solid #ccc;border-radius: 8px 8px 8px 8px;margin:4px 4px 4px 4px">
      <div class="pod">
        <img style="position:inherit !important;right:0px !important;width:100%;max-width:100%;height:auto;" src="https://s16.postimg.org/c7m216tvp/images.png">
        <strong title="Charity test">
                    Charity test
                </strong>
        <p>
          Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore
        </p>
        <div class="cssCircle plusSign" data-toggle="modal" data-target="#tabsec0">
          +
        </div>
      </div>
      <div class="col-md-12 shower in" style="display:none" id="tabsec0" aria-hidden="false">
     
     
          <h3>
                        Charity test
                    </h3>
       ong>
                            Lorem Ipsum
                        </strong>
            <span>
                            is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry. <br />
                             is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.
                        </span>
          </p>
        
      </div>
    </li>
    <li class="col-md-3 odd" style="width:22% !important ;border: 1px solid #ccc;border-radius: 8px 8px 8px 8px;margin:4px 4px 4px 4px">
      <div class="pod">
        <img style="position:inherit !important;right:0px !important;width:100%;max-width:100%;height:auto;" src="https://s16.postimg.org/c7m216tvp/images.png">
        <strong title="Charity test">
                    Charity test
                </strong>
        <p>
          Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore
        </p>
        <div class="cssCircle plusSign" data-toggle="modal" data-target="#tabsec0">
          +
        </div>
      </div>
      <div class="col-md-12 shower in" style="display:none" id="tabsec0" aria-hidden="false">
      
     
          <h3>
                        Charity test
                    </h3>
          <p>
          </p>
          <p>
            <strong>
                            Lorem Ipsum
                        </strong>
            <span>
                            is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry. <br />
                            is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.
                        </span>
          </p>
       
      </div>
    </li>
    <li class="col-md-3 odd" style="width:22% !important ;border: 1px solid #ccc;border-radius: 8px 8px 8px 8px;margin:4px 4px 4px 4px">
      <div class="pod">
        <img style="position:inherit !important;right:0px !important;width:100%;max-width:100%;height:auto;" src="https://s16.postimg.org/c7m216tvp/images.png">
        <strong title="Charity test">
                    Charity test
                </strong>
        <p>
          Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore
        </p>
        <div class="cssCircle plusSign" data-toggle="modal" data-target="#tabsec0">
          +
        </div>
      </div>
      <div class="col-md-12 shower in" style="display:none" id="tabsec0" aria-hidden="false">
        
       
          <h3>
                        Charity test
                    </h3>
          <p>
          </p>
          <p>
            <strong>
                            Lorem Ipsum
                        </strong>
            <span>
                            is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry. <br />
                            is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.
                        </span>
          </p>
          <p>
         
      </div>
    </li>
    <li class="col-md-3 odd" style="width:22% !important ;border: 1px solid #ccc;border-radius: 8px 8px 8px 8px;margin:4px 4px 4px 4px">
      <div class="pod">
        <img style="position:inherit !important;right:0px !important;width:100%;max-width:100%;height:auto;" src="https://s16.postimg.org/c7m216tvp/images.png">
        <strong title="Charity test">
                    Charity test
                </strong>
        <p>
          Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore
        </p>
        <div class="cssCircle plusSign" data-toggle="modal" data-target="#tabsec0">
          +
        </div>
      </div>
      <div class="col-md-12 shower in" style="display:none" id="tabsec0" aria-hidden="false">
      
       
          <h3>
                        Charity test
                    </h3>
          <p>
          </p>
          <p>
            <strong>
                            Lorem Ipsum
                        </strong>
            <span>
                            is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry. <br />
                            is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.
                        </span>
          </p>
      
      </div>
    </li>
    <li class="col-md-3 odd" style="width:22% !important ;border: 1px solid #ccc;border-radius: 8px 8px 8px 8px;margin:4px 4px 4px 4px">
      <div class="pod">
        <img style="position:inherit !important;right:0px !important;width:100%;max-width:100%;height:auto;" src="https://s16.postimg.org/c7m216tvp/images.png">
        <strong title="Charity test">
            Charity test
        </strong>
        <p>
          Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore
        </p>
        <div class="cssCircle plusSign" data-toggle="modal" data-target="#tabsec0">
          +
        </div>
      </div>
      <div class="col-md-12 shower in" style="display:none" id="tabsec0" aria-hidden="false">
        
       
          <h3>
                Charity test
            </h3>
          <p>
          </p>
          <p>
            <strong>
                    Lorem Ipsum
                </strong>
            <span>
                    is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry. <br />
                    is simply dummy text of the printing and typesetting industry.  is simply dummy text of the printing and typesetting industry.
                </span>
          </p>
        
        
      </div>
    </li>
  </ul>
</div>

关于html - 在 Col-md-3 中显示全宽列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40968052/

相关文章:

html - 向内联输入添加边框

html css - 为什么这个地方在手机中变得不可见

javascript - Html Doctype 标签影响 javascript?

javascript - 如何将文本光标隐藏在 div 元素下方

jquery - 添加了 overflow-y 但现在有新的副作用

html - Bootstrap 3 的表单字段布局问题

javascript - 在 javascript 中创建第二个 html 元素会删除第一个元素

html - 清除 Bootstrap col 上的 float 以居中 div

html - 绝对定位的 div 与相对子级的高度相同

jquery - 预输入 Bootstrap : No dropdown shows for ajax calls?