2:13 AM
0
In this article, We will teach you to write CSS Class that will use for convert natural color to black color and white color

Step 1: Write code HTML 
?
1
2
3
4
5
6
7
8
9
10
11
<html>
    <head>
        <title>CSS3 Filter</title>
        <style type="text/css" rel="stylesheet">
            //css code here
        </style>
    </head>
    <body>
        <img src="http://learning.itkonkhmer.com/ImageName.jpg" class="grayscale" />
    </body>
</html>


Step 2: Write code HTML To convert picture to write color and black color we will use Filter 3 number are Standard CSS Filter for Webkit Browsers, Svg Filter for Firefox and Microsoft Filter Property for IE 6+ 
?
1
2
3
4
5
6
7
8
9
10
11
img.grayscale {
  
  /* for Webkit browsere, Chrome 19+, Safari 6+ ... */
  -webkit-filter: grayscale(1);
  
  /* this is for Firefox 3.5+, Firefox mobile */
  filter: url("data:image/svg+xml;utf8,<svg http:="" svg="" www.w3.org="" xmlns="\"><filter gs="" id="\"><feColorMatrix 0.3333="" 0="" 1="" matrix="" type="\" values="\"></feColorMatrix></filter></svg>#gs");
  
  /* for IE6+ */
  filter: gray;
}
Next
This is the most recent post.
Older Post

0 comments:

Post a Comment