Divs没有相互排序 - bootstrap

时间:2016-09-05 11:40:35

标签: css

我有下一个街区:

{
   "_id":{ },
   "refreshToken":"dba7449db19d20ce77f5a247ef2d9ac06e3387464c011b0424db1064bcfce503",
   "profile":{
      "provider":"fitbit",
      "_json":{
         "activities-heart":[
            {
               "customHeartRateZones":[ ],
               "dateTime":"today",
               "heartRateZones":[
                  {
                     "caloriesOut":2.80434,
                     "max":84,
                     "min":30,
                     "minutes":2,
                     "name":"Out of Range"
                  },
                  {
                     "caloriesOut":0,
                     "max":118,
                     "min":84,
                     "minutes":0,
                     "name":"Fat Burn"
                  },
                  {
                     "caloriesOut":0,
                     "max":143,
                     "min":118,
                     "minutes":0,
                     "name":"Cardio"
                  },
                  {
                     "caloriesOut":0,
                     "max":220,
                     "min":143,
                     "minutes":0,
                     "name":"Peak"
                  }
               ],
               "value":"61.86"
            }
         ],

我想让它们彼此相邻,当涉及到屏幕的wnd时 - 让它们连续下去并继续。 但它只是列出了相同块的大清单。

这是班级:

<% for(var i=0; i<quotes.length; i++) {%>
    <li class="quotes">
      <span><%= quotes[i].profile._json.activities-heart %></span>

    </li>

2 个答案:

答案 0 :(得分:1)

实际上你的html类名和css类名不一样,所以css不能用于这个html。

请更新您的代码: -

&#13;
&#13;
.block {
	float: left!important;
	display: inline!important;
	height: 50px;
	width: 50px!important;
	background-color: #1b6d85;
	margin: 5px;
	margin-top: 15px;
	border-radius: 4px 4px 4px !important;
}
&#13;
<div class="block"> </div>
<div class="block"> </div>
<div class="block"> </div>
<div class="block"> </div>
<div class="block"> </div>
&#13;
&#13;
&#13;

答案 1 :(得分:0)

您可以在此处找到代码的工作版本:

.block { float: left!important; display: inline!important; height: 50px; width: 50px!important; background-color: #1b6d85; margin: 5px; margin-top: 15px; border-radius: 4px 4px 4px !important; }
<div class="block">
test
</div>

<div class="block">
test
</div>
<div class="block">
test
</div>
<div class="block">
test
</div>
<div class="block">
test
</div>