用html+css写一个淘宝登录页面
时间: 2023-09-13 21:08:20 浏览: 373
以下是一个简单的淘宝登录页面的 HTML 和 CSS 代码示例:
HTML代码:
```html
<!DOCTYPE html>
<html>
<head>
<title>淘宝登录</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="container">
<h1>淘宝登录</h1>
<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>
<input type="submit" value="登录">
</form>
</div>
</body>
</html>
```
CSS代码:
```css
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
width: 400px;
margin: 100px auto;
background-color: #fff;
border-radius: 10px;
padding: 30px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
}
h1 {
text-align: center;
margin-bottom: 30px;
}
form {
display: flex;
flex-direction: column;
}
label {
margin-bottom: 10px;
}
input[type="text"], input[type="password"] {
padding: 10px;
border-radius: 5px;
border: 1px solid #ccc;
margin-bottom: 20px;
}
input[type="submit"] {
background-color: #ff4400;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #ff6600;
}
```
你可以把上述代码保存为 `login.html` 和 `style.css`,并在同一目录下打开 `login.html` 文件查看效果。