CSS_跳动的心

详细教程CSS3 

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>	
		<style type="text/css">
		body{
			background-color: #ffa5a5;
		}
			.cen{
				width: 200px;
				height:200px;
				background-color: #d5093c;
				
				
				/*阴影效果:   水平方向的偏移,垂直方向的偏移,模糊度,颜色*/
				box-shadow: 10px -10px 70px #D5093C;
				animation: 1s aj infinite;
			}
			
			/*倒圆角指令*/
			.lef{
				border-radius: 100px;
				position: absolute;
				top: 200px;
				left: 180px;
			}
			.rig{
				border-radius: 100px;
				position: absolute;
				top: 200px;
				left: 320px;
			}
			
			/*旋转角度*/
			.c{
				transform: rotate(45deg);
				position: absolute;
				top: 270px;
				left: 250px;
				
			}
			
			/*div:hover{*/
				/*放大原有图形*/
				/*transform: scale(1.3);*/
				
				/*2d旋转 如果只有一个数据,那么x和y相同角度,给俩个数据就是先x 后y*/
				/*transform: skew(45deg);*/
				
				/*移动 显示水平位移,然后是垂直位移  (负数就是向上)*/
				/*transform: translate(0px,-5px);*/
			/*}*/
			
			/*动画标签*/
			@-webkit-keyframes aj{
				0%{transform: scale(1) rotate(45deg);}
				50%{transform: scale(1.2) rotate(45deg);}
				100%{transform: scale(1.) rotate(45deg);}
			}
			
		</style>
	</head>
	<body>
		<div class="cen lef"></div>
		<div class="cen c"></div>
		<div class="cen rig"></div>
	</body>
</html>

用到CSS3的标签 :

/*阴影效果:   水平方向的偏移,垂直方向的偏移,模糊度,颜色*/
 

box-shadow: 10px -10px 70px #D5093C;

 

 /*倒圆角指令*/

border-radius: 100px;

 

/*旋转角度 deg就是角度的意思*/

transform: rotate(45deg);

 

/*放大原有图形*/

transform: scale(1.3);

 

/*动画标签*/

@-webkit-keyframes aj{
				0%{transform: scale(1) rotate(45deg);}
				50%{transform: scale(1.2) rotate(45deg);}
				100%{transform: scale(1.) rotate(45deg);}
			}

 

/*调用动画的方法*/

animation: 1s aj infinite;

 

针对不同的浏览器CSS3有不同的方法:

@keyframes myfirst
{
from {background: red;}
to {background: yellow;}
}

@-moz-keyframes myfirst /* Firefox */
{
from {background: red;}
to {background: yellow;}
}

@-webkit-keyframes myfirst /* Safari 和 Chrome */
{
from {background: red;}
to {background: yellow;}
}

@-o-keyframes myfirst /* Opera */
{
from {background: red;}
to {background: yellow;}
}

 

 

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值