-
Hajipur, Bihar, 844101
CSS Image Filters are visual effects applied to images (or other elements) using the filter
property. They allow you to adjust colors, blur, brightness, contrast, and more, directly in CSS without editing the image itself.
Filter Function | Description | Example |
---|---|---|
blur(px) |
Applies blur effect | filter: blur(5px); |
brightness(%) |
Adjusts brightness (0% = black) | filter: brightness(150%); |
contrast(%) |
Adjusts contrast (100% = default) | filter: contrast(200%); |
grayscale(%) |
Converts to grayscale (100% = full gray) | filter: grayscale(100%); |
invert(%) |
Inverts colors (100% = full inversion) | filter: invert(100%); |
opacity(%) |
Sets opacity level | filter: opacity(50%); |
saturate(%) |
Adjusts saturation | filter: saturate(200%); |
sepia(%) |
Applies sepia tone | filter: sepia(80%); |
drop-shadow(offsetX offsetY blurRadius color) |
Adds shadow | filter: drop-shadow(5px 5px 5px black); |
img {
filter: grayscale(50%) blur(2px) brightness(120%);
}
img {
transition: filter 0.5s ease;
}
img:hover {
filter: brightness(150%) saturate(120%);
}
Q1. Apply a 5px blur to all images.
Q2. Make images grayscale on hover.
Q3. Increase brightness to 120% on hover.
Q4. Add a drop shadow of 4px offset with black color.
Q5. Invert colors of an image completely.
Q6. Set image opacity to 60%.
Q7. Apply a sepia tone of 70%.
Q8. Saturate an image to 200% when hovered.
Q9. Combine grayscale and blur effects on images.
Q10. Use transition to animate filter changes smoothly.
Q1: Which CSS property applies filters to images?
Q2: What does filter: grayscale(100%) do?
Q3: Which filter function adjusts image brightness?
Q4: What is the effect of filter: invert(100%)?
Q5: Which filter adds a shadow around the image?
Q6: How to smoothly animate filter changes on hover?
Q7: Which filter function adjusts color saturation?
Q8: What does filter: opacity(50%) do?
Q9: Can multiple filter functions be combined?
Q10: Which filter gives a warm brownish effect?