我正在用Ionic框架开发一个应用程序。
我创建了两个在我的ionic serve上工作很好的按钮,但是在ionic build android之后它们是完全不对齐的。
<a href="#/app/ketels-list" class="circle button-custom">
<div class="dark">
<i class="icon ion-android-notifications placeholder-icon"></i>
</div>
<h6 class="master">Vind de <b>betekenis</b> van <b>foutcodes!</b></h6>
</a>CSS
.welcomescreen #welcomecontent .circle{
width: 120px;
height: 120px;
margin: 2.5vh auto 25px;
padding: 10px;
border-radius: 50%;
background-color: rgba(255,255,255,1);
box-shadow: 0px;
}
.welcomescreen #welcomecontent .dark{
width: 100px;
height: 100px;
border-radius: 50%;
background-color: #4f76ad;
box-shadow: 0px;
padding: 23px 27.5px;
}
.welcomescreen #welcomecontent .button-custom {
color: #4f76ad ;
border: 0px;
text-decoration: none;
}
.welcomescreen #welcomecontent .button-custom.active, .welcomescreen #welcomecontent .button-custom:hover, .welcomescreen #welcomecontent .button-custom:focus {
color: #fff;
border-bottom: 0px;
background-color: #4f76ad;
box-shadow: inset 0px 4px 0px 0px rgba(0,0,0,0.2);
}
.welcomescreen #welcomecontent i {
margin: 0 auto;
color: #fff;
font-size: 50px;
}我试过各种各样的中心技巧,但似乎都失败了。

发布于 2016-02-08 19:36:26
这应该是你的图标的中心:
.welcomescreen #welcomecontent .dark {
position: relative;
}
.welcomescreen #welcomecontent i {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate3d(-50%, -50%, 0);
transform: translate3d(-50%, -50%, 0);
}https://stackoverflow.com/questions/35266887
复制相似问题