From the course: CSS: Images
Unlock this course with a free trial
Join today to access over 22,600 courses taught by industry experts.
Masking an image with another image
From the course: CSS: Images
Masking an image with another image
- [Instructor] Now that you know how to add a clip path to an SVG, scale it, to be responsive and then use it as the clip path in CSS, allow me to let you in on a little secret. If you have an existing SVG and you don't want to mess around with it, you just want to use it to clip an image, you don't have to use clip path. You can use another property called mask-image which literally takes an image and uses it as a mask on top of your image. Now, the mask-image property only works with SVGs or generated images like linear gradients or radial gradients. It doesn't work with a regular photo but if you have an SVG, it works fine. So let's take a look at what that would look like. In the exercise files I have the original SVG. So this is what I just export it out of illustrator. It has two paths in it. It has nothing else. There's no click path. There's no additional elements. So this is the SVG. And if I display the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Rounded corners with border-radius3m 23s
-
(Locked)
Cropping images to a perfect circle2m 37s
-
(Locked)
Custom shapes using clip-path44s
-
(Locked)
Clip-path: Circle3m 2s
-
(Locked)
Clip-path: Ellipse1m 36s
-
(Locked)
Clip-path: Polygon4m 33s
-
(Locked)
Clip-path: Inset2m 6s
-
(Locked)
Clip-path: Path2m 50s
-
(Locked)
Custom shapes using SVG4m 51s
-
(Locked)
Masking an image with another image2m 38s
-
(Locked)
Image text1m 48s
-
(Locked)
Browser compatibility3m 30s
-
-
-
-