ionic 3 - show rounded image

Usr picture Usr · Jun 18, 2017 · Viewed 26.8k times · Source

I'm trying to set a round image at the top of a page (like a profile page). The image is rectangular and about 300x200. I've tried these ways:

1) Using the Ion-Avatar Tag

2) Using Ion-Image tag, setting the border radius in the scss

None of these methods worked. The image just kept showing squared (and eventually shrinked) inside a grey circle:

enter image description here

Any suggestions?

Answer

Udhay Titus picture Udhay Titus · Jun 18, 2017

you can try with css

.image {
     height: 5vw; 
     width: 5vw; 
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 5px gray;
    display: inline-block;
    margin-left: auto;
    margin-right: auto;
}

.circle-pic{
    width:50px;
    height:50px;
    -webkit-border-radius: 50%;
    border-radius: 50%;
}
<div class="image">
</div>

<p>or if you want only image try this</p>

 <img class="circle-pic" 
 src="http://autokadabra.ru/system/uploads/users/18/18340/small.png?1318432918" />