<html> <head><title>404 Not Found</title></head> <body> <center><h1>404 Not Found</h1></center> <hr><center>stgw</center> </body> </html>
时间: 2024-08-24 09:00:36 浏览: 33
这是一段HTML代码,表示服务器找不到请求的页面,返回了一个404错误状态。"404 Not Found"是一个HTTP状态码,意思是“未找到”,通常用户会看到一个包含这个标题和简单信息的响应页面,如中心对齐的"404 Not Found"和"stgw"(可能是短语“Sorry, the page you requested was not found”或者其他类似含义的文字)。当浏览器尝试访问不存在或已被删除的网页地址时,就会显示这样的错误页面。
相关问题
美化这个用户界面<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Personal Information</title> </head> <body> <h1>Personal Information</h1> <?php // 连接到MySQL数据库 $conn = new mysqli('localhost', 'root', '123456', 'students'); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } // 从数据库中检索用户信息 $sql = "SELECT name, part, sex FROM info"; $result = $conn->query($sql); // 在用户界面上显示用户信息 if ($result->num_rows > 0) { echo "<table><tr><th>Name</th><th>Part</th><th>Sex</th></tr>"; while ($row = $result->fetch_assoc()) { echo "<tr><td>".$row["name"]."</td><td>".$row["part"]."</td><td>".$row["sex"]."</td></tr>"; } echo "</table>"; } else { echo "No users found."; } // 关闭数据库连接 $conn->close(); ?> </body> </html>
这个用户界面可以美化一下,让它更加美观和易读。以下是一些建议:
1. 在 <head> 标签中添加一个样式表,用来设置页面的样式和布局。
2. 将 <h1> 标签的样式从默认的样式改为更具吸引力和可读性的样式,比如加粗和居中显示。
3. 用 <div> 标签将表格包裹起来,并为表格添加类名,用来设置表格的样式。
4. 为表格添加表头和单元格的样式,让表格更加易读和美观。
以下是修改后的代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Personal Information</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f2f2f2;
}
h1 {
text-align: center;
font-weight: bold;
margin-top: 50px;
}
.table-container {
max-width: 800px;
margin: 50px auto;
background-color: #fff;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
table {
width: 100%;
border-collapse: collapse;
text-align: left;
}
th {
background-color: #f2f2f2;
font-weight: bold;
padding: 10px;
border-bottom: 1px solid #ddd;
}
td {
padding: 10px;
border-bottom: 1px solid #ddd;
}
</style>
</head>
<body>
<h1>Personal Information</h1>
<div class="table-container">
<?php
// 连接到MySQL数据库
$conn = new mysqli('localhost', 'root', '123456', 'students');
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// 从数据库中检索用户信息
$sql = "SELECT name, part, sex FROM info";
$result = $conn->query($sql);
// 在用户界面上显示用户信息
if ($result->num_rows > 0) {
echo "<table><tr><th>Name</th><th>Part</th><th>Sex</th></tr>";
while ($row = $result->fetch_assoc()) {
echo "<tr><td>".$row["name"]."</td><td>".$row["part"]."</td><td>".$row["sex"]."</td></tr>";
}
echo "</table>";
}
else {
echo "No users found.";
}
// 关闭数据库连接
$conn->close();
?>
</div>
</body>
</html>
用html 写一个404 Notfound 页面
当然,我可以帮你创建一个简单的 404 Not Found 页面。以下是一个基本的 HTML 代码示例:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>404 Not Found</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
margin: 0;
padding: 50px;
}
h1 {
font-size: 36px;
margin-bottom: 30px;
}
p {
font-size: 18px;
margin-bottom: 30px;
}
</style>
</head>
<body>
<h1>404 Not Found</h1>
<p>Sorry, the page you are looking for cannot be found.</p>
</body>
</html>
```
你可以将以上代码保存为一个 `.html` 文件,然后在浏览器中打开该文件,即可看到一个简单的 404 Not Found 页面。你可以根据需要自定义样式和页面内容。希望对你有所帮助!如果你有其他问题,请随时提问。