用CSS写一本书

用CSS写一本书

在这里插入图片描述

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<style>
			*{
				margin: 0;
				padding: 0;
			}
			body{
				display: flex;
				justify-content: center;
				align-items: center;
				min-height: 100vh;
				background: rgb(250,250,250);
				background-attachment: fixed;
				background-size: cover;
			}
			.book{
				position: relative;
				top: 0;
				width: 400px;
				height: 600px;
				background: #fff;
				transform: rotate(-37.5deg) skewX(10deg);
				box-shadow: -35px 35px 50px rgba(0,0,0,1);
				transition: 0.5s;
			}
			.book:hover{
				transform: rotate(-37.5deg) skewX(10deg) translate(20px, -20px);
				box-shadow: -50px 50px 100px rgba(0,0,0,1);
			}
			.book:before{
				content: '';
				width: 30px;
				height: 100%;
				background: url(https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1588900098&di=b41905c683262ede66a811bc539d8368&src=http://hbimg.b0.upaiyun.com/6fc64b52819c57b640f8d385c87f20ef740e728612a9e-hI3dqx_fw658);
				position: absolute;
				top: 0;
				left: 0;
				transform: skewY(-45deg) translate(-30px,-15px);
				box-shadow: inset -10px 0 20px rgba(0,0,0,0.2);
			}
			.book:after{
				content: '';
				width: 100%;
				height: 30px;
				background: #ccc;
				position: absolute;
				bottom: 0;
				left: 0;
				transform: skewX(-45deg) translate(15px,30px);
			}
			.book h2{
				position: absolute;
				bottom: 100px;
				left: 35px;
				font-size: 5em;
				line-height: 1em;
				color: #fff;
			}
			.book h2 span{
				background: url(https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1588900098&di=b41905c683262ede66a811bc539d8368&src=http://hbimg.b0.upaiyun.com/6fc64b52819c57b640f8d385c87f20ef740e728612a9e-hI3dqx_fw658);
				background-attachment: fixed;
				-webkit-background-clip: text;
				-webkit-text-fill-color: transparent;
			}
			.book .writer{
				position: absolute;
				bottom: 20px;
				right: 20px;
				color: #3262626;
				font-size: 0.6em;
				padding-top: 5px;
				font-weight: 500;
				border-top-left-radius: 1px soild #262626;
			}
			.book .writer i{
				font-weight: 700;
			}
			.book .cover{
				position: absolute;
				top: 0;
				left: 0;
				width: 100%;
				height: 70%;				
				background: url(https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1588900098&di=b41905c683262ede66a811bc539d8368&src=http://hbimg.b0.upaiyun.com/6fc64b52819c57b640f8d385c87f20ef740e728612a9e-hI3dqx_fw658);
				background-size: cover;
			}
		</style>
	</head>
	<body>
		<div class="book">
			<div class="cover"></div>
			<h2>Book</br><span>Mockup</span></h2>
			<span class="writer">Designed By <i>Muhammad Irshad</i></span>
		</div>
	</body>
</html>

代码来源与视频:https://www.youtube.com/watch?v=Za7PiYZlc4I&feature=youtu.be

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值