Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a circular image in css

Tags:

html

css

I'm very new to this sort of thing but this is my issue. I've looked through a couple of questions and it makes sense with how to make it circular but the image which is made circular is half cut off, is there a way of fixing this. I am using HTML and CSS.

circular_image {
  float: left;
  margin-left: 125px;
  margin-top: 20px;
  width: 200px;
  height: 200px;
  border-radius: 100%;
  overflow: hidden;
  background-color: blue;
}
like image 699
Stefan Avatar asked Feb 24 '15 16:02

Stefan


People also ask

How do you make an image a circle in CSS?

The main CSS property responsible for the circular shape is the border-radius property. Setting the radius of the corners to 50% of the width/height results in a circle.

How do I make rounded corners of an image in CSS?

The border-radius CSS property is what adds the rounded corners. You can experiment with different values to get it the way you like. border-radius: 75px; If you want it to be a circle, add border-radius: 50%; .

How do you change the shape of an image in CSS?

First we select the image using the . image selector and then apply properties in it. The width and height properties on this element, displays the element on the webpage in this specified dimension. Finally, we apply the border-radius property to 50% which will change this shape into circle.


1 Answers

This work for me

clip-path: circle();
like image 141
Deuel Ellan Avatar answered Oct 05 '22 23:10

Deuel Ellan