invert() CSS Function
Description
The invert()
function inverts the colors in the image. In its action, it is similar to turning a photograph into a negative.
Syntax
invert() = invert( <number-percentage>? )
Values
- number-percentageA value of 0 leaves the image original. A value of 100% or 1 completely inverts the colors of the picture. Values from 0% to 100% or from 0 to 1 invert colors partially.
Example
<img class="invert" src="images/nature.jpg" alt="Invert Example">
.invert {
filter: invert(100%);
}
Browser Support
Desktop | |||||
X | 12 | 53 | 35 | 40 | 9.1 |
Tablets / Mobile | |||||
![]() |
|||||
53 | 53 | 35 | 41 | 9.3 | 6.0 |
Last updated by CSSPortal on: 1st December 2019
CSS Functions
- attr()
- blur()
- brightness()
- calc()
- circle()
- contrast()
- drop-shadow()
- ellipse()
- grayscale()
- hsl()
- hsla()
- hue-rotate()
- inset()
- invert()
- linear-gradient()
- matrix()
- matrix3d()
- opacity()
- perspective()
- polygon()
- radial-gradient()
- repeating-linear-gradient()
- repeating-radial-gradient()
- rgb()
- rgba()
- rotate()
- rotate3d()
- rotateX()
- rotateY()
- rotateZ()
- saturate()
- scale()
- scale3d()
- scaleX()
- scaleY()
- scaleZ()
- sepia()
- skew()
- skewX()
- skewY()
- translate()
- translate3d()
- translateX()
- translateY()
- translateZ()