img {
border-radius: 50%;
height:200px;
width:200px;
}
/*image size, (height & width) both must be same.
if they are not same then no circle.
*/
img.rounded-corners {
border-radius: 30px;
}
img{
width: 200px;
height:200px;
border-radius: 50%;
}
<img src="path/to/photo.png">
<style>
img {
border-radius: 50%;
}
</style>
img {
border-radius: 50%;
height:100px;
width:100px;
}
/* change image height and width to see your image preview.
for me all of the different images dimensions are rounded with this css*/
/*Note :Height and width should be of same size*/
.img-circle {
aspect-ratio: 1;
border-radius: 50%;
object-fit: cover;
width: 100%;
}
Code Example |
---|
Css :: double border color css |
Css :: css gradient 3 color |
Css :: Resetting Default Table Styles |
Css :: curve bottom of square css |
Css :: css transform origin |
Css :: css circle with number |
Css :: ng-deep |
Css :: transform orgin css |
Css :: multi colors in background in css |
Css :: css grid row height with repeat |
Css :: input text only css |
Css :: input type password css |
Css :: background image |
Css :: @font-face css |
Css :: border bottom under text only |
Css :: padding in one line |
Css :: twig date modify |
Css :: border css shorthand |
Css :: mac input shadow |
Css :: how to remove image using css |
Css :: import font css from url |
Css :: link active css |
Css :: centered navigation |
Css :: css %-px |
Css :: Shadow On left & right side |
Css :: tile format css |
Css :: html disabled button hover style |
Css :: displat grid overlapping columns |
Css :: how to center background image in css |
Css :: css noise filter |