The CSS3 filter property is the latest CSS property which is used for applying different types of filters on images for giving them attractive looks.
Here are some values of the CSS3 filter property for applying to images
<style>
/*example*/
.tdb-image{
filter: grayscale(80%);
}
</style>
<style>
/*example*/
filter: none | brightness() | blur() | contrast()
| drop-shadow() | sepia() | grayscale() | hue-rotate()
| invert() | opacity() | saturate()
| url();
</style>
- Note
If you want to use multiple filter you can use multiple space saparated values.
<head>
<style>
/*black & white image*/
.tdb-image{
filter: grayscale(100%);
width:100px;
}
/*blur image */
.tdb-image1{
filter: blur(5px);
width:100px;
}
</style>
</head>
<body>
<div>
<img class="tdb-image"
src="js.png" alt="sample image">
<br>
<img class="tdb-image1"
src="js.png" alt="sample image">
</div>
</body>
<style>
img{
filter: blur(5px);
}
</style>
<style>
img{
filter: contrast(50%);
}
/*default value:100% | (1)*/
</style>