帮我写一个有图片且带有返回按钮的404页面的HTML
时间: 2024-02-28 11:58:00 浏览: 23
好的,以下是一个带有图片和返回按钮的404页面的HTML代码:
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>404 Page Not Found</title>
<style>
body {
font-family: Arial, sans-serif;
font-size: 16px;
line-height: 1.5;
color: #333;
background-color: #f5f5f5;
margin: 0;
padding: 0;
}
.container {
width: 80%;
max-width: 1200px;
margin: 0 auto;
padding: 50px 0;
text-align: center;
}
h1 {
font-size: 48px;
margin-bottom: 20px;
}
p {
font-size: 24px;
margin-bottom: 30px;
}
img {
max-width: 100%;
height: auto;
margin-bottom: 30px;
}
.btn {
display: inline-block;
padding: 10px 20px;
font-size: 20px;
background-color: #007bff;
color: #fff;
border-radius: 5px;
text-decoration: none;
transition: background-color 0.3s ease;
}
.btn:hover {
background-color: #0069d9;
}
</style>
</head>
<body>
<div class="container">
<img src="https://via.placeholder.com/500x300" alt="404 Error">
<h1>404</h1>
<p>Page not found</p>
<a href="#" class="btn">Go back</a>
</div>
</body>
</html>
```
这个页面包括一个404错误提示、一个图片、一个简短的提示信息以及一个返回按钮。您可以把这段代码保存为一个HTML文件,然后在需要的时候使用,同时记得替换掉图片的URL。