我正在尝试使用 CSS 将 ionic View 与中心对齐。这是我的代码
CSS
/*pull the title to the center*/
.pullCenter title{
text-align:center;
}
ionic HTML
<ion-view class="pullCenter" title="Please Login">
但它永远不会与中心对齐。请问有什么问题吗?
最佳答案
将此添加到您的 .config
示例代码:
ionicApp.config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider) {
$ionicConfigProvider.navBar.alignTitle('center')
});
或
尝试在标记
中添加align-title="center"
喜欢
<ion-view class="pullCenter" title="Please Login" align-title="center">
希望对您有所帮助。
关于html - 使用css强制将 ionic View 标题对齐到中心,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36357155/