写一个html的404错误界面的代码,要求界面美观
时间: 2023-03-06 13:38:25 浏览: 40
<!DOCTYPE html>
<html>
<head>
<title>404 错误</title>
<style>
body {
font-family: 'Arial', serif;
font-size: 14px;
text-align: center;
color: #444;
} h1 {
font-size: 200px;
font-weight: bold;
margin-top: 50px;
margin-bottom: 10px;
color: #f00;
} p {
font-size: 20px;
line-height: 1.5;
margin-top: 20px;
}
</style>
</head>
<body>
<h1>404</h1>
<p>抱歉,您所访问的页面不存在!</p>
</body>
</html>
相关问题
使用html css 写一个404出错的界面
好的,下面是一个简单的示例代码,供您参考:
HTML代码:
```
<!DOCTYPE html>
<html>
<head>
<title>Error 404 - Page Not Found</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="container">
<h1>Oops!</h1>
<h2>Error 404 - Page Not Found</h2>
<p>The page you are looking for might have been removed or is temporarily unavailable.</p>
<a href="#">Back to Home</a>
</div>
</body>
</html>
```
CSS代码:
```
body {
background-color: #f5f5f5;
font-family: Arial, sans-serif;
}
.container {
background-color: #fff;
border: 1px solid #ddd;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0,0,0,0.2);
margin: 50px auto;
max-width: 600px;
padding: 20px;
text-align: center;
}
h1 {
color: #f44336;
font-size: 60px;
margin-bottom: 20px;
}
h2 {
color: #333;
font-size: 36px;
margin-bottom: 20px;
}
p {
color: #666;
font-size: 18px;
margin-bottom: 20px;
}
a {
background-color: #f44336;
border: none;
border-radius: 5px;
color: #fff;
display: inline-block;
font-size: 18px;
padding: 10px 20px;
text-decoration: none;
transition: background-color 0.3s ease;
}
a:hover {
background-color: #d32f2f;
}
```
在此示例中,我们使用了一个容器(class="container")来包裹页面的主要元素。容器设置了白色背景、圆角边框和阴影效果,使页面看起来更加美观。页面中包含一个错误标题(class="h1")、错误信息(class="h2")和一段说明文字(class="p"),同时还有一个返回主页的链接(class="a")。
当然,这只是一个简单的示例,您可以根据自己的需求对页面进行进一步的美化和定制。
用php写一个美观的登陆界面
好的,以下是一个简单的美观的登陆界面的 PHP 代码:
```php
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录</title>
<style>
body {
background-color: #f1f1f1;
font-family: Arial, sans-serif;
}
form {
background-color: #fff;
border: 1px solid #ccc;
padding: 20px;
max-width: 400px;
margin: 50px auto;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
label, input[type="text"], input[type="password"], button {
display: block;
width: 100%;
margin-bottom: 10px;
font-size: 16px;
}
label {
font-weight: bold;
margin-bottom: 5px;
}
input[type="text"], input[type="password"] {
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
}
button {
background-color: #4CAF50;
color: #fff;
padding: 10px;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #3e8e41;
}
</style>
</head>
<body>
<form>
<label for="username">用户名</label>
<input type="text" id="username" name="username" required>
<label for="password">密码</label>
<input type="password" id="password" name="password" required>
<button type="submit">登录</button>
</form>
</body>
</html>
```
这段代码会生成一个简单的登录表单,包括用户名和密码的输入框,以及一个登录按钮。CSS 样式使得表单看起来更加美观,并且在用户输入不完整时会提示错误信息。
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)