Bootstrap 3面板带有图像

时间:2015-09-18 09:31:26

标签: css twitter-bootstrap-3

我试图重新创建此面板:

enter image description here

我只是想知道是否有人知道如何解决这个问题,我已经完成了html标记。但我不知道如何开始设计它...

我的示例html:

    <div id="mainContainer" class="container">
    <div class="row">
        <div class="col-lg-2 col-md-3 col-sm-4 col-xs-6">
            <div class="panel panel-default">
                <div class="panel-heading">Item 01</div>
                <div class="panel-body"><img src="http://placehold.it/150x150" alt="" class="img-responsive center-block" />
            </div>
        </div>                
    </div>
</div>

1 个答案:

答案 0 :(得分:4)

检查一下这会对你有帮助....

&#13;
&#13;
.my_panel > .panel-body {
  padding: 0px;
}
.my_panel > .panel-body > img {
  width: 100%;
  height: 100%;
}
.my_panel > .panel-footer {
  text-align: center;
}
&#13;
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<div id="mainContainer" class="container">
  <div class="panel panel-default">
    <div class="panel-body">
      <div class="row">
        <div class="col-lg-2 col-md-3 col-sm-4 col-xs-6">
          <div class="panel panel-default my_panel">
            <div class="panel-body">
              <img src="http://placehold.it/150x150" alt="" class="img-responsive center-block" />
            </div>
            <div class="panel-footer">
              <h3>The company</h3>
              <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nostrum, voluptas, sunt vitae mollitia iure perferendis rerum odio! Natus, cupiditate, est, quas, non perspiciatis in quo possimus eos voluptas tempore maxime.</p>
              <a href="#">Read More</a>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
&#13;
&#13;
&#13;