【发布时间】:2015-12-28 07:19:42
【问题描述】:
我想在 Ionic ion-scroll 中水平垂直居中 <span> 元素的“列表”,并且尝试了几乎所有我能找到的“居中”样式,但就是无法使其居中...
<body ng-app='app' ng-controller='Index as vm'>
<ion-content scroll=false>
<div style="padding: 0px;height=80px;width:30%;align=center" >
<ion-scroll class="center" scrollbar-x=false direction="x"
style="text-align:center;background-color:pink;height: 80px;width:99%;white-space: nowrap">
<span class='center' style="text-align:center;margin:5px;background-color:red;align=center" ng-repeat='d in vm.data'>{{d}}</span>
</ion-scroll>
</div>
</ion-content>
</body>
Here 是上述的 Plunk。
我已将 <span> 元素着色为红色,将容器着色为粉红色,以便我们可以看到 <span> 相对于容器的位置。
这里有人有什么建议吗?
提前感谢您的帮助。
【问题讨论】:
标签: html css angularjs ionic-framework ionic