I want to create image avatar like avatar contact of skype,can you help me ?, I try use border radius-border but lucky
3 Answers
I think you can use border-radius on img tags, too.
img{
border-radius: 50%;
}
<img src="https://c2.staticflickr.com/4/3016/3071708735_ddaf5d361b.jpg" alt="">
1 Comment
bbosternak
You are right :), post edited
Try like this: Demo
div.avatar {
border-radius:50%;
overflow:hidden;
width:100px;
height:100px;
border:1px solid #ccc;
}
div.avatar img {
height:100%;
}
HTML:
<div class="avatar">
<img src="http://www.stockazoo.com/uploads/3/5/4/5/3545172/5579090_orig.jpg" />
</div>
Comments
CSS:
.circleImage {
width: 300px;
height: 300px;
border-radius: 50%;
background: green;
}
HTML:
<div class="circleImage"></div>
Keep the border radius half of the width or height for circular images like in Skype.
3 Comments
jbutler483
or just use 50% as your declaration. Please also note, the border radius property no longer requires prefixing. :)
Luthando Ntsekwa
.....will upvote(+1) after the border radius edit ;-)
Kurenai Kunai
Removed the prefixes and also made it 50%. :) Thank you for suggestions.
border-radius.border-radius