CSS changes PNG image color

Source: Internet
Author: User

Source Address: http://www.zhangxinxu.com/wordpress/?p=5429

Zhang Xin on the personal website of Asahi Great God, is purely to share and record

Css

Div.icon{height:20px;width:20px;overflow:hidden;}             -20px;border-right:20px solid transparent;                Background:url (img/icon.png) no-repeat;-webkit-filter:drop-shadow (#0); Filter: Drop-shadow (#0);               }

Html

class="icon">            class='icon' id= ' icon '></span>        </div>        <input type="color" id= ' Color ' />

Js

document.getElementById ('color'). onchange = function () {            var  this. Value;            document.getElementById ('icon'drop-shadow (' +c+'  20px 0)';        }

In Google, Firefox mobile phone, all can be used, the use of technology is the CSS filter in the projection, the specific view of the original

CSS changes PNG image color

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.