html – 如何将图像与离子中的页面中心对齐

我想将图像(徽标)与页面的中心(水平和垂直)对齐?
<ion-view hide-nav-bar="true">
<ion-content class="backgound-red ">
<section class = "home-container">
      <div class="row icon-row">

        <div class="col">
                    <h1 class="text-white text-center">My Application </h1>
          <h4 class ="text-white text-center ">version 1.0.0</h4>
        </div>
    </div>

    <div class="row row-center" >
        <div class="col text-center" >
            <img alt="logo" height="100" src="img/logo.png" >
        </div>
      </div>
    <div class="row icon-row">

        <div class="col ">
            <a class="text-white text-center" href="#" onclick="window.open('http://members.000webhost.com/login.PHP?'); return false;">
              <h5 class ="text-white text-center ">access server</h5></a>
        </div>        
    </div>
    </section>
</ion-content>

我想要的布局,图像应该自动对齐移动屏幕.(标签,手机)

解决方法

尝试添加这个CSS代码,它将水平和垂直居中img.
.home-container .row-center img {
    position:absolute;
    left: 0;
    right: 0;
    margin:0 auto;
    top:50%;
    transform:translateY(-50%);
}

相关文章

Mip是什么意思以及作用有哪些
怎么测试Mip页面运行情况
MIP安装的具体步骤有哪些
HTML添加超链接、锚点的方法及作用详解(附视频)
MIP的规则有哪些
Mip轮播图组件中的重要属性讲解