<!DOCTYPE html>
<html>
<head>
	<title>响应式 HTML 表单</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<style>
		body {
			font-family: Arial, sans-serif;
			padding: 20px;
		}
		form {
			width: 100%;
			max-width: 500px;
			margin: 0 auto;
			background-color: #f2f2f2;
			padding: 20px;
			border-radius: 10px;
		}
		label {
			display: block;
			margin-bottom: 10px;
		}
		input[type='text'], input[type='email'], select, textarea {
			width: 100%;
			padding: 10px;
			margin-bottom: 20px;
			border: none;
			border-radius: 5px;
			background-color: #fff;
			box-shadow: 0 0 5px rgba(0,0,0,0.1);
			font-size: 16px;
			color: #333;
		}
		input[type='submit'] {
			background-color: #007bff;
			color: #fff;
			padding: 10px 20px;
			border: none;
			border-radius: 5px;
			font-size: 18px;
			cursor: pointer;
			transition: background-color 0.3s ease;
		}
		input[type='submit']:hover {
			background-color: #0056b3;
		}
	</style>
</head>
<body>
	<form>
		<label for="name">姓名:</label>
		<input type="text" id="name" name="name" placeholder="请输入姓名" required>
		<label for="email">邮箱:</label>
		<input type="email" id="email" name="email" placeholder="请输入邮箱" required>
		<label for="gender">性别:</label>
		<select id="gender" name="gender">
			<option value="male">男</option>
			<option value="female">女</option>
			<option value="other">其他</option>
		</select>
		<label for="message">留言:</label>
		<textarea id="message" name="message" placeholder="请输入留言"></textarea>
		<input type="submit" value="提交">
	</form>
</body>
</html>
响应式 HTML 表单:移动端友好设计

原文地址: https://www.cveoy.top/t/topic/mqqi 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录