• CSS3系列之3D制作 再研究


    水平翻转效果:

    <!DOCTYPE html>
    <html>
    
    	<head>
    		<meta charset="UTF-8">
    		<title></title>
    		<style type="text/css">
    			.stage {
    				 140px;
    				height: 200px;
    				perspective: 800px;
    			}
    			
    			.container {
    				position: relative;
    				 140px;
    				height: 200px;
    				transform-style: preserve-3d;
    				transition: 1s;
    			}
    			
    			.front {
    				position: absolute;
    				 140px;
    				height: 200px;
            		background-image: url(img/3tb_160824110159262h572240.jpg);
    				background-size: cover;
    				backface-visibility: hidden;
    			}
    			
    			.back {
    				position: absolute;
    				 140px;
    				height: 200px;
    				background-image: url(img/3tb_160824110159xh65572240.jpg);
    				background-size: cover;
    				transform: rotateY(180deg);
    				backface-visibility: hidden;
    			}
    			
    			.stage:hover .container {
    				transform: rotateY(180deg);
    			}
    		</style>
    	</head>
    
    	<body>
    		<div class='stage'>
    			<div class='container'>
    				<div class='front'></div>
    				<div class='back'></div>
    			</div>
    		</div>
    	 
    	 
    	</body>
    </html>
    

     3D 旋转:

    <!doctype html>
    <html lang="en">
    
    	<head>
    		<meta charset="UTF-8" />
    		<title>Document</title>
    		<style type="text/css">
    			* {
    				margin: 0;
    				padding: 0;
    			}
    			
    			.wrap {
    				padding: 50px;
    			}
    			
    			.stage {
    				 100px;
    				height: 100px;
    				-webkit-perspective: 2000px;
    				perspective: 2000px;
    				list-style: none;
    			}
    			
    			.container {
    				position: relative;
    				 100px;
    				height: 100px;
    				-webkit-transform-style: preserve-3d;
    				transform-style: preserve-3d;
    				-webkit-transition: 1s;
    				transition: 1s;
    			}
    			
    			.front {
    				position: absolute;
    				 100px;
    				height: 100px;
    				-webkit-transform: translateZ(50px);
    				transform: translateZ(50px);
    				-webkit-backface-visibility: hidden;
    				backface-visibility: hidden;
    			}
    			
    			.front img {
    				 100%;
    				height: 100%;
    			}
    			
    			.back {
    				position: absolute;
    				display: block;
    				 100px;
    				height: 100px;
    				text-align: center;
    				line-height: 100px;
    				-webkit-transform: rotateY(90deg) translateZ(50px);
    				transform: rotateY(90deg) translateZ(50px);
    				-webkit-backface-visibility: hidden;
    				backface-visibility: hidden;
    			}
    			
    			li:nth-child(1) .back {
    				background-color: skyblue;
    			}
    			
    			li:nth-child(2) .back {
    				background-color: pink;
    			}
    			
    			li:nth-child(3) .back {
    				background-color: lightyellow;
    			}
    			
    			.container:hover {
    				-webkit-transform: rotateY(-90deg);
    				transform: rotateY(-90deg);
    			}
    		</style>
    	</head>
    
    	<body>
    		<ul class="wrap">
    			<li class="stage">
    				<div class='container'>
    					<div class="front"><img src="http://d3.freep.cn/3tb_160824132644ihf4572240.jpg" /></div>
    					<p class="back">帅气的胡歌</p>
    				</div>
    			</li>
    			<li class="stage">
    				<div class='container'>
    					<div class="front"><img src="http://d2.freep.cn/3tb_160824132644w0r4572240.jpg" /></div>
    					<p class="back">美腻的赵丽颖</p>
    				</div>
    			</li>
    			<li class="stage">
    				<div class='container'>
    					<div class="front"><img src="http://d3.freep.cn/3tb_160824235542tkj9572240.jpg" /></div>
    					<p class="back">清纯的刘亦菲</p>
    				</div>
    			</li>
    		</ul>
    	</body>
    
    </html>
    

      

  • 相关阅读:
    4 Python+Selenium的元素定位方法(link/partial link)
    3 Python+Selenium的元素定位方法(id、class name、name、tag name)
    2 Selenium3.0+Python3.6环境搭建
    1 Selenium打开浏览器
    目录处理文件&链接命令
    DOS批处理命令-@命令
    DOS批处理命令-echo
    吐槽一二三
    编码神器之sublime(插件安装)
    两天来学习C的感受
  • 原文地址:https://www.cnblogs.com/libin-1/p/5813050.html
Copyright © 2020-2023  润新知