CSS Transform Style
As CSS3 developing quickly, the transform style can be written conviently.
I find that it is an interesting effect, so I write it down with my code here.
The most important CSS property is transform-style.
Here is the effect. When the mouse does not move over the front side, it
shows "front". If we move the mouse over the the front side, it will transform
into "back" side.
The front side:

The back side:

index.html
<html>
<head>
<title>transform style</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="js/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="js/jquery-func.js"></script>
</head>
<body>
<div id="container">
<div class="t">
<div class="t-front">
<p>front<p>
</div>
<div class="t-back">
<p>back</p>
</div>
</div>
<div class="t">
<div class="t-front">
<p>front<p>
</div>
<div class="t-back">
<p>back</p>
</div>
</div>
<div class="t">
<div class="t-front">
<p>front<p>
</div>
<div class="t-back">
<p>back</p>
</div>
</div>
<div class="t">
<div class="t-front">
<p>front<p>
</div>
<div class="t-back">
<p>back</p>
</div>
</div>
</div>
</body>
</html>
js/jquery-func.js
$(document).ready(function() {
$('.t').on('mouseover', function() {
$(this).addClass('flipped');
});
$('.t').on('mouseout', function() {
$(this).removeClass('flipped');
})
})
css/style.css
/* style for transform style */
body {
margin: 0px;
padding: 0px;
background: #ffffff;
}
#container {
position: absolute;
top:20%;
left:15%;
width: 900px;
height: auto;
}
.t {
position: relative;
text-align: center;
float: left;
width: 200px;
height: 200px;
border: 1px solid #39bd9f;
margin: 1px;
transform-style: preserve-3d;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-o-transform-style: preserve-3d;
transition: transform 1s;
-webkit-transition: -webkit-transform 1s;
-moz-transition: -moz-transform 1s;
-o-transition: -o-transform 1s;
}
.t-front, .t-back {
display: block;
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-o-backface-visibility: hidden;
}
.t-back {
transform: rotateY( 180deg );
-webkit-transform: rotateY( 180deg );
-moz-transform: rotateY( 180deg );
-o-transform: rotateY( 180deg );
}
.flipped {
transform: rotateY( 180deg );
-webkit-transform: rotateY( 180deg );
-moz-transform: rotateY( 180deg );
-o-transform: rotateY( 180deg );
}
reference: http://www.quackit.com/css/css3/properties/css_transform-style.cfm
link: http://www.cnblogs.com/zhuangzebo/p/6366419.html
CSS Transform Style的更多相关文章
- No.3 - CSS transition 和 CSS transform 配合制作动画
课程概述 作业提交截止时间:09-01 任务目的 深度理解掌握 transition-timing-function 以及它的意义 学会配合使用 CSS transform 和CSS transiti ...
- CSS Transform / Transition / Animation 属性的区别
back21 Jun 2011 Category: tech Tags: css 最近想UI的动画转到css3能吃进3d加速的属性上面来以加强动画的连贯性.只是对于css几个新加的属性不太熟悉,常常容 ...
- Html CSS transform matrix3d 3D转场特效
Html CSS transform matrix3d 3D转场特效 透视矩阵 2n/(r-l) 0 (r+l)/(r-l) 0 0 2n/(t-b) (t+b)/(t-b) 0 0 0 (n+f)/ ...
- CSS Counter Style试玩儿
2015年2月3日,CSS Counter Style level3成为了W3C的候选标准,是时候来一探究竟,看看强大魔力的@counter-style如何自定义list-style和counter. ...
- [Coding Style] CSS coding style
CSS coding style Note 结合实际工作中的规范和推荐大家使用的CSS书写规范.顺序这篇文章整合而成 Navigation CSS 书写顺序 CSS 常用文件命名 CSS 常用命名规范 ...
- css: transform导致文字显示模糊
css: transform导致文字显示模糊 有人认为模糊的原因是:"transform时div的宽度或者高度并不是偶数,偏移 50% 之后,像素点不是整数,和显示像素没有对上". ...
- how to overwrite css !important style
how to overwrite css !important style css !important bug how to override css !important style https: ...
- CSS Transform完全指南 #flight.Archives007
Title/ CSS Transform完全指南 #flight.Archives007 序: 第7天了! 终身学习, 坚持创作, 为生活埋下微小的信仰. 我是忘我思考,共同进步! 简介: 一篇最简约 ...
- CSS Transform完全指南(第二版) #flight.Archives007
Title/ CSS Transform完全指南(第二版) #flight.Archives007 序: 第7天了! 终身学习, 坚持创作, 为生活埋下微小的信仰. 我是忘我思考,共同进步! 简介: ...
随机推荐
- 不使用SwitchHosts修改C:\Windows\System32\drivers\etc\hosts文件
1.nginx中的nginx.conf完成修改,配置好了端口和域名www.xuecheng.com 2.找到Hosts文件,将Hosts文件复制到桌面.(Windows 10系统Hosts文件路径为: ...
- Hadoop集群配置(最全面总结 )(转)
Hadoop集群配置(最全面总结) huangguisu 通常,集群里的一台机器被指定为 NameNode,另一台不同的机器被指定为JobTracker.这些机器是masters.余下的机器即作为Da ...
- 25.mysql中的常用工具
25.mysql中的常用工具25.1 mysql客户端连接工具跳转至mysql安装目录下的bincd C:\Program Files\MySQL\MySQL Server 5.7\binmac下cd ...
- ajax登陆页面
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- Java.WeakReference-SoftReference-PhantomReference
Weak Reference, Soft Reference, Phantom Reference 1. Introduction "Weak reference objects, whic ...
- linux中的定时任务创建
1.查看root用户身份下正常运行的定时任务 crontab -l -u XXX 列出XXX用户的所有定时任务,如有没有会提示 no crontab for XXX列出所有的用户:cat /etc/p ...
- Python之路(第二十七篇) 面向对象进阶:内置方法、描述符
一.__call__ 对象后面加括号,触发执行类下面的__call__方法. 创建对象时,对象 = 类名() :而对于 __call__ 方法的执行是由对象后加括号触发的,即:对象() 或者 类()( ...
- PHP5.3的编译扩展
./configure --prefix=/usr/local/php --enable-fastcgi --enable-zip --enable-fpm --enable-gd-native-tt ...
- 企业官网原型制作分享-Starbucks
星巴克是全球著名的咖啡连锁店,星巴克的产品不单是咖啡,咖啡只是一种载体.而正是通过咖啡这种载体,星巴克把一种独特的格调传送给顾客.咖啡的消费很大程度上是一种感性的文化层次上的消费,文化的沟通需要的就是 ...
- vue 获取跳转上一页组件信息
项目中有一需求,需要根据不同的页面路径url跳转进行不同的操作,首先需要获得上一页面的url,利用 beforeRouteEnter 这个钩子中的from参数获得之前url的信息,然后给 next 传 ...