From the course: CSS: Images

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Clip-path: Circle

Clip-path: Circle

- [Instructor] A clip path can be applied to any element and I'll clip that element to whatever path you define. But in most cases you will use it on images because it makes the most sense to clip images. In this first example, we'll look at clip path circle which creates a perfect circle every time. To apply a clear path, you simply select the element and say clip-path and then define whatever method you want to use. So in our case, we're going to use the circle method. This is a method you add parentheses at the end. And what you see is, if you don't define any size, it'll automatically set the radius of the circle to whatever is the shortest length in the current image. So if you have a square at lowest be a circle but if you had a rectangle image, you would find the shortest side. So either the height or the width whatever is shorter and then set the radius to that size because it'll create a circle. Once you've created a…

Contents