垂直显示小部件框

时间:2019-06-20 09:58:05

标签: html css twitter-bootstrap inspinia

我目前对每种记录都有这种显示方式。

enter image description here

因此,每条记录有两个框,分别是“下午”和“夜晚”。如您所见,我正在用此代码水平显示每个记录以供参考:

<div id="record_box">

    <div class="row" style="padding-left: 10px; padding-right: 10px;">
        <div class="col-lg-6">
            <div class="widget style1 yellow-bg">
                <div class="row">
                    <div class="col-4">
                        <i class="fa fa-sun-o fa-4x"></i>
                    </div>
                    <div class="col-8 text-right">
                        <span> Afternoon Total Bets </span>
                        <h2 class="font-bold" id="afternoon"></h2>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-6">
            <div class="widget style1 lazur-bg">
                <div class="row">
                    <div class="col-4">
                        <i class="fa fa-moon-o fa-4x"></i>
                    </div>
                    <div class="col-8 text-right">
                        <span> Night Total Bets </span>
                        <h2 class="font-bold" id="night"></h2>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="row" style="padding-left: 10px; padding-right: 10px;">
        <div class="col-lg-6">
            <div class="widget style1 yellow-bg">
                <div class="row">
                    <div class="col-4">
                        <i class="fa fa-sun-o fa-4x"></i>
                    </div>
                    <div class="col-8 text-right">
                        <span> Afternoon Total Bets </span>
                        <h2 class="font-bold" id="afternoon"></h2>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-6">
            <div class="widget style1 lazur-bg">
                <div class="row">
                    <div class="col-4">
                        <i class="fa fa-moon-o fa-4x"></i>
                    </div>
                    <div class="col-8 text-right">
                        <span> Night Total Bets </span>
                        <h2 class="font-bold" id="night"></h2>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

每个记录都在此块内

<div class="row" style="padding-left: 10px; padding-right: 10px;">

但是,如果我想垂直显示每条记录怎么办?在网格中,最大大小是12吗?我有固定的最大数量记录需要显示,只有4条。因此,我可以像col-3那样记录每条记录。我所说的垂直也是指如果我有1条记录,下午在顶部,然后晚上在底部。然后,右边将为空白。像这样:

enter image description here

1 个答案:

答案 0 :(得分:0)

我已经为您创建了基本结构,现在您可以对其进行必要的更改。

css:

.panel-box {
  -moz-transition: all .3s ease;
  -o-transition: all .3s ease;
  -webkit-transition: all .3s ease;
}

.panel-box .panel-heading {
  padding: 20px 10px;border: 1px solid rgba(86,61,124,.2);
}
.panel-box .panel-heading .fa {
  margin-top: 10px;
  font-size: 58px;
}
.panel-box .list-group-item {
  color: #777777;
  border-bottom: 1px solid rgba(250, 250, 250, 0.5);
}

.panel-box .panel-body {
  font-size: 20px;
  color: #777777;
  padding: 20px;
  margin: 0px;border: 1px solid rgba(86,61,124,.2);
}

HTML:

<div class="container">
    <div class="row">
      <div class="col-md-3 text-center">
          <div class="panel panel-box">
            <div class="panel-heading">
              <i class="fa fa-sun-o fa-4x"></i>
            </div>
            <div class="panel-body text-center">
              <span> Afternoon Total Bets </span>
              <h2 class="font-bold" id="afternoon"></h2>
            </div>
          </div>

          <div class="panel panel-box">
            <div class="panel-heading">
              <i class="fa fa-moon-o fa-4x"></i>
            </div>
            <div class="panel-body text-center">
              <span> Night Total Bets </span>
              <h2 class="font-bold" id="night"></h2>
            </div>
          </div>
      </div>
      <div class="col-md-3 text-center">
          <div class="panel panel-box">
            <div class="panel-heading">
              <i class="fa fa-sun-o fa-4x"></i>
            </div>
            <div class="panel-body text-center">
              <span> Afternoon Total Bets </span>
              <h2 class="font-bold" id="afternoon"></h2>
            </div>
          </div>

          <div class="panel panel-box">
            <div class="panel-heading">
              <i class="fa fa-moon-o fa-4x"></i>
            </div>
            <div class="panel-body text-center">
              <span> Night Total Bets </span>
              <h2 class="font-bold" id="night"></h2>
            </div>
          </div>
      </div>
      <div class="col-md-3 text-center">
          <div class="panel panel-box">
            <div class="panel-heading">
              <i class="fa fa-sun-o fa-4x"></i>
            </div>
            <div class="panel-body text-center">
              <span> Afternoon Total Bets </span>
              <h2 class="font-bold" id="afternoon"></h2>
            </div>
          </div>

          <div class="panel panel-box">
            <div class="panel-heading">
              <i class="fa fa-moon-o fa-4x"></i>
            </div>
            <div class="panel-body text-center">
              <span> Night Total Bets </span>
              <h2 class="font-bold" id="night"></h2>
            </div>
          </div>
      </div>
      <div class="col-md-3 text-center">
          <div class="panel panel-box">
            <div class="panel-heading">
              <i class="fa fa-sun-o fa-4x"></i>
            </div>
            <div class="panel-body text-center">
              <span> Afternoon Total Bets </span>
              <h2 class="font-bold" id="afternoon"></h2>
            </div>
          </div>

          <div class="panel panel-box">
            <div class="panel-heading">
              <i class="fa fa-moon-o fa-4x"></i>
            </div>
            <div class="panel-body text-center">
              <span> Night Total Bets </span>
              <h2 class="font-bold" id="night"></h2>
            </div>
          </div>
      </div>
    </div>
  </div>

这将生成如下图所示的结构: enter image description here