I want to align a image (logo)to the center (both horizontal and vertical)of the page ?
<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>
the layout that I want, The Image should be align center automatically to the mobile screen.(tab, phone)
Try adding this CSS code, it will center the img both horizontally and vertically.
.home-container .row-center img {
position:absolute;
left: 0;
right: 0;
margin:0 auto;
top:50%;
transform:translateY(-50%);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With