Home  >  Article  >  Web Front-end  >  支持多浏览器的镜像反转css效果_html/css_WEB-ITnose

支持多浏览器的镜像反转css效果_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:42:081395browse

今天接到一个需求,通过一张图片得到其镜像对称的图片。本来说是后台处理的,但这样除了技术上难实现之外,还带来了资源消耗的问题,相当于每张图都要存储一个副本了。

只记得以前用过css的滤镜可以实现这个,但只在IE下有效。后来找到一个兼容多浏览器的样式,大爱。

 css样式定义:

.flip-horizontal {     -moz-transform: scaleX(-1);     -webkit-transform: scaleX(-1);      -o-transform: scaleX(-1);     transform: scaleX(-1);     filter: fliph; /*IE*/ }.flip-vertical {     -moz-transform: scaleY(-1);     -webkit-transform: scaleY(-1);     -o-transform: scaleY(-1);     transform: scaleY(-1);     filter: flipv; /*IE*/ }

HTML引用示例:

<img  src="http://img.baidu.com/img/logo-zhidao.gif" class="flip-horizontal" / alt="支持多浏览器的镜像反转css效果_html/css_WEB-ITnose" ><img  src="http://img.baidu.com/img/logo-zhidao.gif" class="flip-vertical" / alt="支持多浏览器的镜像反转css效果_html/css_WEB-ITnose" >

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn