-
Hajipur, Bihar, 844101
CSS Image Shapes allow you to define the visual shape and clipping of images beyond the default rectangle. You can create circles, ellipses, polygons, or even custom shapes to make layouts more creative and engaging.
border-radius
for Circles and Rounded Shapesimg.circle {
border-radius: 50%;
}
This makes the image perfectly circular if it’s square or rounded if rectangular.
clip-path
for Custom ShapesThe clip-path
property allows complex shapes like polygons, circles, and ellipses.
img.polygon {
clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}
This clips the image into a triangle.
shape-outside
for Text Wrappingshape-outside
controls how text wraps around a floated image.
img.float-shape {
float: left;
shape-outside: circle(50%);
width: 200px;
height: 200px;
clip-path: circle(50%);
margin-right: 20px;
}
Text wraps around the circular image shape.
You can define SVG shapes and reference them in CSS.
img {
clip-path: url(#my-clip);
}
This requires inline SVG in HTML.
Q1. Make an image perfectly circular using border-radius
.
Q2. Clip an image into a triangle using clip-path: polygon()
.
Q3. Create an elliptical image shape using clip-path: ellipse()
.
Q4. Wrap text around a circular image using shape-outside
.
Q5. Clip an image into a star shape using clip-path
.
Q6. Use clip-path
to create a hexagon image shape.
Q7. Create an image with rounded corners of 25px radius.
Q8. Float an image with shape-outside: inset()
.
Q9. Create an oval profile picture using border-radius
and clip-path
.
Q10. Use SVG clip path to create a heart-shaped image.
Q1: Which property rounds image corners?
Q2: What does clip-path: circle(50%) do?
Q3: Which property allows custom polygon shapes?
Q4: What is shape-outside used for?
Q5: Which is NOT a valid value for clip-path?
Q6: How to make an image circular if it is not square?
Q7: Which method supports the most complex shapes?
Q8: What is the effect of clip-path: inset(10%)?
Q9: Can clip-path be animated?
Q10: Which property affects how text flows around a floated image?