首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Ionic构建Android \ Android \ Ionic \\Ionic/Ionic/Ionic后位置发生变化

在Ionic构建Android \ Android \ Ionic \\Ionic/Ionic/Ionic后位置发生变化
EN

Stack Overflow用户
提问于 2016-02-08 10:06:14
回答 1查看 406关注 0票数 0

我正在用Ionic框架开发一个应用程序。

我创建了两个在我的ionic serve上工作很好的按钮,但是在ionic build android之后它们是完全不对齐的。

代码语言:javascript
复制
<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

代码语言:javascript
复制
.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;
}

我试过各种各样的中心技巧,但似乎都失败了。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-02-08 19:36:26

这应该是你的图标的中心:

代码语言:javascript
复制
.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);
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35266887

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档