我想將卡片中的文本垂直和水平居中放置。但它只是居中橫向。我不知道我能做什麼不同。Ionic:卡片中垂直居中文本
的index.html
<body id="bb" ng-app="starter" ng-controller="AppCtrl" style="background-color: lightblue;height:1000px;">
<div class="card">
<div class="item item-divider">
<h2><b>Joke {{jokeNo}}</b></h2>
</div>
<div class="item item-text-wrap">
<h1>{{joke}}</h1>
</div>
</div>
<div class="control">
<button id="nextJokeButton" class="button button-outline button-positive" ng-click="loadJoke()">
Another one
</button>
<button id="rateButton" class="button button-outline button-positive" ng-click="rate()">
Rate us
</button>
</div>
</body>
的style.css
#nextJokeButton{
margin-top:50px;
}
.control{
text-align:center;
}
.card{
height: 30%;
margin-top:5%;
text-align:center;
vertical-align: middle;
margin-top: 50px;
}
h1 {
font-size: 23px;
}
在此先感謝
嘗試'display:table-cell;'在css中。 – Quantumplate
仍然無法正常工作... – Kewitschka