BootWiki教程网
源代码:
点击运行
<!DOCTYPE html> <html> <head> <style> img { width: 33%; height: auto; float: left; } .blur {-webkit-filter: blur(4px);filter: blur(4px);} .brightness {-webkit-filter: brightness(0.30);filter: brightness(0.30);} .contrast {-webkit-filter: contrast(180%);filter: contrast(180%);} .grayscale {-webkit-filter: grayscale(100%);filter: grayscale(100%);} .huerotate {-webkit-filter: hue-rotate(180deg);filter: hue-rotate(180deg);} .invert {-webkit-filter: invert(100%);filter: invert(100%);} .opacity {-webkit-filter: opacity(50%);filter: opacity(50%);} .saturate {-webkit-filter: saturate(7); filter: saturate(7);} .sepia {-webkit-filter: sepia(100%);filter: sepia(100%);} .shadow {-webkit-filter: drop-shadow(8px 8px 10px green);filter: drop-shadow(8px 8px 10px green);} </style> </head> <body> <p><strong>注意:</strong> Internet Explorer 不支持 filter 属性。</p> <img alt="Pineapple" height="300" src="pineapple.jpg" width="300"> <img alt="Pineapple" class="blur" height="300" src="pineapple.jpg" width="300"> <img alt="Pineapple" class="brightness" height="300" src="pineapple.jpg" width="300"> <img alt="Pineapple" class="contrast" height="300" src="pineapple.jpg" width="300"> <img alt="Pineapple" class="grayscale" height="300" src="pineapple.jpg" width="300"> <img alt="Pineapple" class="huerotate" height="300" src="pineapple.jpg" width="300"> <img alt="Pineapple" class="invert" height="300" src="pineapple.jpg" width="300"> <img alt="Pineapple" class="opacity" height="300" src="pineapple.jpg" width="300"> <img alt="Pineapple" class="saturate" height="300" src="pineapple.jpg" width="300"> <img alt="Pineapple" class="sepia" height="300" src="pineapple.jpg" width="300"> <img alt="Pineapple" class="shadow" height="300" src="pineapple.jpg" width="300"> </body> </html>
运行结果