用HTML+css写一个下单付款页面
时间: 2023-12-06 14:44:51 浏览: 33
好的,下面是一个简单的下单付款页面的 HTML 和 CSS 代码:
HTML 代码:
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>下单付款页面</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<h1>订单详情</h1>
<form>
<label for="name">姓名:</label>
<input type="text" id="name" name="name" required>
<label for="email">邮箱:</label>
<input type="email" id="email" name="email" required>
<label for="address">地址:</label>
<textarea id="address" name="address" required></textarea>
<label for="card">信用卡号:</label>
<input type="text" id="card" name="card" required>
<label for="date">过期日期:</label>
<input type="month" id="date" name="date" required>
<button type="submit">确认支付</button>
</form>
</div>
</body>
</html>
```
CSS 代码:
```
* {
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
background-color: #f2f2f2;
}
.container {
max-width: 600px;
margin: 0 auto;
padding: 20px;
background-color: #fff;
border-radius: 5px;
box-shadow: 0 0 10px #ccc;
}
h1 {
text-align: center;
}
form {
display: flex;
flex-direction: column;
}
label {
margin-top: 10px;
font-weight: bold;
}
input[type="text"],
input[type="email"],
input[type="month"],
textarea {
padding: 10px;
border: none;
border-radius: 5px;
margin-bottom: 20px;
box-shadow: 0 0 10px #ccc;
}
button {
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #3e8e41;
}
```
你可以将这些代码复制到你的 HTML 和 CSS 文件中,并根据需要进行修改。这个页面包含了姓名、邮箱、地址、信用卡号和过期日期等信息,并有一个确认支付的按钮。