Home  >  Article  >  Web Front-end  >  About CSS3 transition-property issue_html/css_WEB-ITnose

About CSS3 transition-property issue_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:01:411139browse

css3 animation effect
.transition{
-webkit-transition: all .5s ease;
-moz-transition: all .5s ease;
-o-transition: all .5s ease ;
transition: all .5s ease;
}
Here I just want to apply the transform attribute as follows:
-webkit-transform: translateX(20px);
How should I write it? The following writing method does not take effect!
-webkit-transition: transform .5s ease;


Reply to discussion (solution)

-webkit-transform
should be similar How to write

div
{
transform: translate(50px,100px);
-ms-transform: translate(50px,100px); /* IE 9 */
- webkit-transform: translate(50px,100px); /* Safari and Chrome */
-o-transform: translate(50px,100px); /* Opera */
-moz-transform: translate(50px, 100px); /* Firefox */
}


You seem to need a trigger event

CSS3 IE compatible code online conversion IE's CSS3 Transforms Translator
Demo code

.trans {    width: 100px;    height: 100px;    background-color: yellow;}.trans:hover {/* W3C CSS3 standard */  transform: translateX(20px);  /* Firefox */  -moz-transform: translateX(20px);  /* webkit (Chrome, Safari, mobile browsers, etc) */   -webkit-transform: translateX(20px);  /* Opera */  -o-transform: translateX(20px);  /* IE>=9 */  -ms-transform: translateX(20px);   /* IE8+ - must be on one line, unfortunately */    -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=0, M21=0, M22=1, SizingMethod='auto expand')";      /* IE6 and 7 */    filter: progid:DXImageTransform.Microsoft.Matrix(            M11=1,            M12=0,            M21=0,            M22=1,            SizingMethod='auto expand');   /*    * To make the transform-origin be the middle of    * the object.    Note: These numbers    * are approximations.  For more accurate results,    * use Internet Explorer with this tool.    */   margin-left: 7px;    margin-top: -3px;    }

Demo updated version
Added transition

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