我想使用ng-repeat
指令顯示自定義卡的列表,但它始終垂直顯示。水平顯示卡列表,帶有角度和MaterializeCSS的HTML/CSS
<style>
li{
display: inline
}
</style>
<div ng-init="names=['Jani','Hege','Kai']">
<ul >
<li ng-repeat="x in names">
<div class="row">
<div class="col s12 m2 20 " >
<div class="card blue-grey darken-1">
<div class="card-content white-text">
<span class="card-title" id="dani">{{x}}</span>
<p id="p">I am a very simple card. I am good at containing small bits of information.
I am convenient because I require little markup to use effectively.</p>
</div>
<div class="card-action">
<a href="#">This is a link</a>
</div>
</div>
</div>
</div>
</li>
</ul>
</div>
我在做什麼錯?
UPDATE:
display: inline-flex;
解決問題,但把對象一個接一個在同一行。讓我說,4個對象後,我想去下一行,那麼我怎麼設置它?
打完3卡顯示水平線增加:)
嘗試爲'ul'元素添加一個'display:inline-flex;'。 – user3821538