css - How do I add ion-avatar on top of ion-card? like the image below -


i new ionic. trying create ion card profile page this. basically, want ion-avatar on top of ion-card shown in image.

how that?

below code:

#content {    position: relative;    // margin-top: auto;    background-color: green;    box-shadow: 0px -1px 10px rgba(0, 0, 0, 0.4);    padding-top: 200px;  }    #profile-info {    position: absolute;    top: -95px;    width: 100%;    z-index: 2;    text-align: center;  }    #profile-image {    display: block;    border-radius: 120px;    border: 1px solid #fff;    width: 128px;    height: 128px;    margin: 30px auto 0;    box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.7);  }
<ion-content has-header="true">    <ion-card id="content">      <ion-avatar id="profile-info">        <img id="profile-image" src="img/bg.jpg">      </ion-avatar>    </ion-card>  </ion-content>

you missing css parameters #content element:

height: 150px; width: 100%; display: block; margin-top: 100px; 

demo: fiddle


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -