这期内容当中小编将会给大家带来有关如何使用纯CSS实现3D书本效果,文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。
在蕲春等地区,都构建了全面的区域性战略布局,加强发展的系统性、市场前瞻性、产品创新能力,以专注、极致的服务理念,为客户提供网站建设、成都网站建设 网站设计制作按需规划网站,公司网站建设,企业网站建设,品牌网站建设,营销型网站建设,外贸营销网站建设,蕲春网站建设费用合理。
话不多说,先来看一下效果图
源代码如下
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <style> *{ margin: 0; padding: 0; } body{ display: flex; align-items: center; justify-content: center; width: 100%; min-height: 100vh; background: #333333; background-size: cover; } .book{ width: 400px; height: 600px; position: relative; background-color: #ffffff; transform: rotate(-37.5deg) skewX(10deg); box-shadow: -35px 35px 50px rgb(0,0, 0, 1); transition: 0.5s; /* 光标呈现为指示链接的指针(一只手) */ cursor: pointer; } .book:hover{ /* rotate 定义 2D 旋转,在参数中规定角度。 */ /* skewX()定义沿着 X 轴的 2D 倾斜转换。 translate(x,y) 定义 2D 转换。 */ transform: rotate(-37.5deg) skewX(10deg) translate(20px,-20px); /* box-shadow 向框添加一个或多个阴影 */ box-shadow: -50px 50px 100px rgba(0,0,0,1); } /* 伪元素必须配合content进行使用,至少为空 */ .book::before{ content:''; height:100%; width:30px; background: red; position: absolute; top: 0; left: 0; transform: skewY(-45deg) translate(-30px,-15px); box-shadow: inset -10px 0 20px raba(0,0,0,0,2); background: url(cofe.jpg); } .book::after{ content: ''; height: 30px; width: 100%; background: #fff; position: absolute; bottom: 0; left: 0; transform: skewX(-45deg) translate(15px,30px); background: url(cofe.jpg); } .book h3{ position: absolute; bottom: 100px; left: 10px; font-size: 5em; line-height: 1em; color: rgb(110, 21, 21); } .book h3 span{ background-image: url(cofe.jpg); background-attachment: fixed; -webkit-background-clip: text; -webkit-text-fill-color: transparent; } .book .write i{ font-weight: 700; } .book .cover{ position: absolute; top: 0; left: 0; width: 100%; height: 70%; background-image: url(cofe.jpg); background-size: cover; } </style> <body> <div> <div></div> <h3>Book <span>javascript</span></h3> <span> written by fans</span> </div> </body> </html>
ok,效果还是相对可以得哦,如果喜欢得话,请点个赞吧!!!
上述就是小编为大家分享的如何使用纯CSS实现3D书本效果了,如果刚好有类似的疑惑,不妨参照上述分析进行理解。如果想知道更多相关知识,欢迎关注创新互联行业资讯频道。
当前名称:如何使用纯CSS实现3D书本效果
本文URL:https://www.cdcxhl.com/article44/ghpche.html
成都网站建设公司_创新互联,为您提供建站公司、虚拟主机、面包屑导航、、全网营销推广、用户体验
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联