Skip to content

Instantly share code, notes, and snippets.

@KhanMaytok
Last active August 29, 2015 14:27
Show Gist options
  • Save KhanMaytok/27fdcbeff29ebf086bca to your computer and use it in GitHub Desktop.
Save KhanMaytok/27fdcbeff29ebf086bca to your computer and use it in GitHub Desktop.
Absolute center in ionic
<ion-content padding="false" scroll="false" has-bouncing="false">
<div id="form">
<div class="list">
<label class="item item-input" id="company">
<input type="text" placeholder="Company Name*" focus-me="{{cmpFocus}}" ng-model="user.companyname" maxlength="100">
</label>
<div class="padding submitbtn">
<button type="submit" class="button" ng-click="registration(user);">SUBMIT</button>
</div>
</div>
</div>
</ion-content>
<style>
.scroll {
height: 100%;
}
#form{
position: fixed;
top: 50%;
left: 50%;
width: 100%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.padding{
text-align: center;
}
.button{
background-color: #0080a8;
border-radius: 5px;
color: #90d8ef;
border-color: #90d8ef;
width: 40%;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment