Use the CSS3 filter to invert the color of a picture

Source: Internet
Author: User

CSS provides filters is also a big highlight, I have been fascinated by the effects of some filters are useful, but some of the filter effect may be just for fun, CSS Common filters have these:,, grayscale blur sepia , all common filters. But how do you use and convert pictures? Today we are mainly talking about how to use the CSS3 filter to invert the color of a picture.

CSS Code

invertThe filter is to set the inverse color effect of the element, his value is set to: 0-100%,100% is full inverse color, 0 is to display the normal color.

. normal {Filter:invert (0%);}. Inverted {Filter:invert (100%);}

You can invert the color of a single element, or you can invert document.documentelement the entire page content to get a reversal effect. will be the original CSS value, so there is no way to get the real inverse value of the given property.

Color inversion is a useful auxiliary tool, but it is usually provided by the user's operating system or a separate tool. I can see the back of the night being helped to relieve eyestrain when looking at the screen. Can you think of a useful color reversal? Please share!

This article is to ask the author of the network to ask the network published, and asked the Web editor, reproduced please indicate the source and this article link. This site is reproduced in addition to the article, are the original site or translation, welcome any form of reprint, but please be sure to indicate the source, respect for the work of others.
Reprint Please specify: The article reprinted from: Ask the net» Use the CSS3 filter to invert the color of the picture.
This article title: Use the CSS3 filter to invert the color of a picture
This address: https://www.uedsc.com/invert-colors-css.html

Use the CSS3 filter to invert the color of a picture

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.