HTML5 简单Demo1

----------------------------页面效果图------------------------------

截图1:

截图2:

 

----------------------------具体代码实现-----------------------------

<!DOCTYPE html>

<html>
<head>
<meta charset="UTF-8">
<title>3D折纸</title>
<style>
html,body{margin: 0;padding: 0;height:100%}
body{
display: flex;
/**
* align-items 弹性盒子
* justify-content 弹性盒子
*/
align-items: center;
justify-content: center;
background-color: #FFF;
}

p{
color: #FFF;
font-size: 1em;
font-weight: bold;
font-family: "微软雅黑";
}
/**
* 3D效果
* 1.transform-style: preserve-3d;
* 3.: 是c2的 ::是委元素 c3提供
*/
p span{
display: inline-block;
position: relative;
transform-style: preserve-3d;
perspective: 500;
}

p span::before,p span::after{
display: none;
position: absolute;
top: 0;
left: -1px;
/**设置旋转中心点*/
transform-origin: left top;
transition: all ease-out 0.3s;
content: attr(data-text);/**data-text 的值可以付给content*/
}

p span::before{
z-index: 1;
color: rgba(0,0,0,0.2);
transform: scale(1.1,1) skew(0deg,20deg);
}

p span::after{
z-index: 2;
color: #684DA3;
text-shadow: -1px 0 1px #684DA3,1px 0 1px rgba(0,0,0,0.8);
transform: rotateY(-40deg);
}
p span:hover::before{
transform: scale(1.1,1) skew(0deg,5deg);
}

p span::after{
transform: rotateY(-10deg);
}

/**span+span 第一个span没有边距,第二个有边距*/
p span+span{
margin-left: 0.1em;
}

/**查询媒体的宽度 min-width:640px*/
@media (min-width:20em ) {
p{font-size: 2em;}
p span::before,p span::after{
display: block;
}
}

/**查询媒体的宽度 min-width:640px*/
@media (min-width:30em ) {
p{font-size: 3em;}

}

/**查询媒体的宽度 min-width:640px*/
@media (min-width:40em ) {
p{font-size: 4em;}

}

/**查询媒体的宽度 min-width:640px*/
@media (min-width:60em ) {
p{font-size: 8em;}

}

</style>
</head>
<body>
<p>

<span data-text="亲">亲</span>
<span data-text="爱">爱</span>
<span data-text="的">的</span>
<span data-text=",">,</span>
<span data-text="歇">歇</span>
<span data-text="会">会</span>
<span data-text="儿">儿</span>
<span data-text="吧">吧</span>
</p>
</body>
</html>

转载于:https://www.cnblogs.com/wllcs/p/5920369.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值