Grayfilter makes image gray. With CSS, any images are turned into gray simply. It's easy to apply, and cool. Many websites have already apply this filter.
Here is the trick:
img.grayscale {
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */
filter: gray; /* IE6-9 */
-webkit-filter: grayscale(100%); /* Chrome 19+, Safari 6+, Safari 6+ iOS */
}
Source: http://www.karlhorky.com/2012/06/cross-browser-image-grayscale-with-css.html
It's a cross-browsing code, except IE10 and IE11. Every problem is occurred with IEs. Fortunately, they support the SVGs, so it's possible to make them work. The github project named 'gray' has been distributed with full cross-browsing.
Another Solution
Notice the another plugin named 'Black and White'.
'Creation > Design' 카테고리의 다른 글
[jQuery] 누르면 크기가 늘어나는 검색창 (9) | 2014.05.04 |
---|---|
[CSS3] box-shadow 속성 (11) | 2014.05.04 |
Offcanvas가 있는 반응형 스킨의 구조 설계 (14) | 2014.03.30 |
Bootstrap Customize - Boost your bootstrap (7) | 2014.03.16 |
Make bootstrap dropdown menu (4) | 2014.03.09 |
부트스트랩의 col-push와 col-pull 속성 (1) | 2014.03.05 |
[CSS+Javascript] 간단한 Back to top 버튼 넣기 (6) | 2014.02.26 |
[CSS] 구글 애드센스 노란색 뒷배경 제거하기 (1) | 2014.02.26 |
[CSS] CSS로만 만든 배경 / 그레디언트 들어간 배경 쓰기 (5) | 2014.02.24 |
[폰트] 구글 Fonts이용, 영문 웹폰트 적용시키기 (9) | 2014.02.22 |