<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Not found</title> </head> <body> <h1>Not found</h1> </body> </html>
时间: 2023-11-13 08:04:03 浏览: 62
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Not found</title> </head> <body> <h1>Not found</h1> </body> </html>是一个HTML页面模板,它是一个简单的404页面,用于显示“Not found”错误信息。在这个模板中,<!DOCTYPE html>定义了文档类型,<html>标签定义了HTML文档的根元素,<head>标签定义了文档的头部部分,<meta charset="UTF-8">指定了文档的字符编码为UTF-8,<title>标签定义了文档的标题,<body>标签定义了文档的主体部分,<h1>标签定义了一个一级标题。
相关问题
用html 写一个404 Notfound 页面
当然,以下是一个简单的HTML代码示例,用于创建一个自定义的404 Not Found页面:
```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>404 Not Found</title>
<style>
body {
text-align: center;
padding: 50px;
font-family: Arial, sans-serif;
background-color: #f1f1f1;
}
h1 {
font-size: 50px;
}
p {
font-size: 20px;
}
</style>
</head>
<body>
<h1>404 Not Found</h1>
<p>The requested URL was not found on this server.</p>
</body>
</html>
```
你可以将上述代码保存为一个名为 `404.html` 的文件,并将其放置在你的网站的根目录下。当访问网站上不存在的页面时,服务器会返回这个自定义的404页面。你也可以根据需要进行样式和内容的修改。
用html写一个404报错页面
可以参考以下示例代码:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>404 Not Found</title>
<style>
body {
background-color: #f1f1f1;
font-family: sans-serif;
}
h1 {
text-align: center;
margin-top: 100px;
}
p {
text-align: center;
font-size: 18px;
margin-top: 50px;
}
a {
display: block;
text-align: center;
margin-top: 20px;
}
</style>
</head>
<body>
<h1>404 Not Found</h1>
<p>The page you requested could not be found.</p>
<a href="/">Go back to homepage</a>
</body>
</html>
```
这个页面会显示一个大标题 "404 Not Found",一段文本说明页面没有找到,以及一个链接返回到网站主页。你可以根据需要自定义样式和文本。