根据这个代码帮我写个css
时间: 2024-03-01 13:54:32 浏览: 24
当然可以!以下是一个根据您提供的 HTML 代码编写的 CSS 样式代码:
```CSS
/* 基本样式 */
body {
background-color: #f1f1f1;
font-family: Arial, sans-serif;
}
.login {
width: 400px;
margin: 0 auto;
background-color: #fff;
border-radius: 5px;
padding: 20px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}
h2.BT {
text-align: center;
font-size: 24px;
margin-bottom: 20px;
}
.zm {
text-align: center;
}
form {
display: inline-block;
}
/* 输入框样式 */
input[type="number"],
input[type="password"] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
/* 链接样式 */
a {
text-decoration: none;
color: #4CAF50;
}
a:hover {
text-decoration: underline;
}
/* 按钮样式 */
input[type="submit"],
input[type="reset"] {
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
width: 50%;
float: left;
}
input[type="submit"]:hover,
input[type="reset"]:hover {
background-color: #45a049;
}
input[type="reset"] {
background-color: #f44336;
float: right;
}
input[type="reset"]:hover {
background-color: #da190b;
}
```
这个 CSS 样式代码包含了一个登录界面的基本样式,包括标题、表单元素和提交按钮。其中包括了一个链接到注册页面的超链接,以及两个按钮:登录和重置。您可以根据自己的需求进行修改和调整,例如更改背景颜色、字体大小和边框样式等等。
请注意,这个 CSS 样式代码是根据您提供的 HTML 代码进行编写的,因此如果您的 HTML 结构发生了变化,可能需要相应地修改 CSS 样式代码。