案例
https://jz-common-cdn.daojia.com/fe-common-page/error-page/index.html
代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
body {
margin: 0;
}
html,
body {
height: 100%;
}
.error-page-main {
position: relative;
padding-top: 50px;
text-align: center;
}
.error-page-main__tip-img {
max-width: 100%;
width: 220px;
height: 200px;
}
.error-page-main__code {
position: absolute;
top: 82px;
left: 50%;
width: 56px;
margin-left: -108px;
color: #888;
font-size: 16px;
}
.error-page-main__message {
padding: 3px 0 10px;
font-size: 16px;
color: #666;
}
.error-page-main__primary-btn {
min-width: 120px;
height: 40px;
line-height: 40px;
padding-left: 10px;
padding-right: 10px;
border: none;
border-radius: 4px;
color: #fff;
font-size: 16px;
background-color: #e6454a;
}
.error-page-main__primary-btn:active {
background-color: rgba(230, 69, 74, 0.8);
}
</style>
</head>
<body>
<div class="error-page-main">
<img
class="error-page-main__tip-img"
src="img/tip-img.png"
alt="错误提示" />
<span class="error-page-main__code js-code">500</span>
<p class="error-page-main__message js-message">抱歉,出错了</p>
<button class="error-page-main__primary-btn js-primary-btn">返回</button>
</div>
</body>
</html>