404页面实现

 页面代码:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>页面丢失了</title>
		<link rel="stylesheet" type="text/css" href="lib/css/404plane.css"/>
	</head>
	<body>
		<div class="error">
			<div class="sky">
				<h2>
					<span>4</span>
					<span>0</span>
					<span>4</span>
				</h2>
				<div class="grass"></div>
				<img src="lib/image/plane.jpg" class="plane">
			</div>
			<div class="field">
				<h2>啊哦,页面走丢了</h2>
				<a href="#">返回首页</a>
			</div>
		</div>
	</body>
</html>

 样式代码:

*
{
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family: consolas;
}
.error{
	min-height: 100vh;
	background: linear-gradient(0deg,#fff,#03a9f4);
}
.sky{
	position: relative;
	widows: 100%;
	height: 60vh;
	display: flex;
	justify-content: center;
	align-items: center;
}
.sky h2{
	font-size: 12em;
	color: #fff;
	text-shadow: 15px 15px 0 rgba(0,0,0,0.1);
}
.sky h2 span{
	margin: 0;
	padding: 0;
	display: inline-block;
	animation: animate 2s ease-in-out infinite;
}
.sky h2 span:nth-child(even){
	animation-delay: -1s;
}
@keyframes animate{
	0%,100%
	{
		transform: translateY(-50px);
	}
	50%
	{
		transform: translateY(50px);
	}
}

.field{
	padding: 100px;
	height: 40vh;
	background: #6e2308;
	box-shadow: inset 0 20px 10px #51680c;
	text-align: center;
}
.field h2{
	color: #fff;
	font-size: 2em;
	font-family: 宋体;
	margin-bottom: 20px;
}
.field a{
	background: #fff;
	color: #000;
	width: 160px;
	height: 50px;
	line-height: 50px;
	border-radius: 50px;
	display: inline-block;
	text-decoration: none;
	font-size: 20px;
}
.plane{
	position: absolute;
	bottom: 200px;
	left: 100px;
	max-width: 300px;
}

 

其中自己百度一张飞机的图片,然后自己添加进文件里面,要注意路径问题。

效果如下图:

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值