登录界面代码精细
由于缺少具体需求,以下是一个简单的登录界面代码,可根据需要进行调整和优化:
HTML代码:
<!DOCTYPE html>
<html>
<head>
<title>Login Page</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="login-container">
<h1>Login</h1>
<form>
<label for="username">Username:</label>
<input type="text" id="username" name="username" required>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required>
<input type="submit" value="Login">
</form>
</div>
</body>
</html>
CSS代码:
body {
background-color: #f5f5f5;
font-family: Arial, sans-serif;
}
.login-container {
background-color: #ffffff;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0,0,0,0.3);
margin: 100px auto;
padding: 30px;
text-align: center;
width: 400px;
}
h1 {
color: #333333;
font-size: 24px;
margin-bottom: 20px;
}
form {
display: inline-block;
text-align: left;
}
label {
display: block;
font-size: 16px;
margin-bottom: 10px;
}
input[type="text"],
input[type="password"] {
background-color: #f5f5f5;
border: none;
border-radius: 5px;
box-shadow: 0 0 5px rgba(0,0,0,0.1);
display: block;
font-size: 16px;
margin-bottom: 20px;
padding: 10px;
width: 100%;
}
input[type="submit"] {
background-color: #4caf50;
border: none;
border-radius: 5px;
box-shadow: 0 0 5px rgba(0,0,0,0.1);
color: #ffffff;
cursor: pointer;
font-size: 16px;
padding: 10px 20px;
transition: background-color 0.2s ease-in-out;
}
input[type="submit"]:hover {
background-color: #3e8e41;
}
说明:
- 页面使用HTML5代码,并引用外部CSS样式表。
- 页面使用了一个具有较高层次结构的
div
容器,容器样式使用了圆角和阴影效果,居中显示在页面上。 - 页面包含一个简单的登录表单,包含用户名和密码两个输入框和一个提交按钮。
- 输入框样式使用了圆角和阴影效果,并设置了一个灰色背景色。
- 提交按钮样式使用了绿色背景色和白色文字,同时设置了一个过渡效果,当鼠标悬停在按钮上时,背景色会变为深绿色。
- 页面使用了响应式设计,适应不同屏幕大小
原文地址: https://cveoy.top/t/topic/hfxc 著作权归作者所有。请勿转载和采集!