<!DOCTYPE html>
<html>
<head>
	<title>联系我们表单</title>
	<style>
		body{
			font-family: Arial, sans-serif;
			background-color: #f8f8f8;
			margin: 0;
			padding: 0;
		}
		h1{
			text-align: center;
			margin-top: 50px;
			color: #333;
		}
		form{
			width: 500px;
			margin: 0 auto;
			background-color: #fff;
			padding: 20px;
			border-radius: 10px;
			box-shadow: 0 0 10px rgba(0,0,0,0.2);
		}
		label{
			display: block;
			margin-bottom: 10px;
			color: #666;
		}
		input[type='text'], input[type='email'], textarea{
			padding: 10px;
			border: 1px solid #ccc;
			border-radius: 5px;
			width: 100%;
			margin-bottom: 20px;
			font-size: 16px;
		}
		textarea{
			height: 100px;
		}
		input[type='submit']{
			background-color: #333;
			color: #fff;
			padding: 10px 20px;
			border: none;
			border-radius: 5px;
			font-size: 16px;
			cursor: pointer;
			transition: background-color 0.3s ease;
		}
		input[type='submit']:hover{
			background-color: #555;
		}
	</style>
</head>
<body>
	<h1>联系我们</h1>
	<form action='' method='post'>
		<label for='name'>姓名:</label>
		<input type='text' id='name' name='name' required>
<pre><code>	&lt;label for='email'&gt;邮箱:&lt;/label&gt;
	&lt;input type='email' id='email' name='email' required&gt;

	&lt;label for='subject'&gt;主题:&lt;/label&gt;
	&lt;input type='text' id='subject' name='subject' required&gt;

	&lt;label for='message'&gt;消息:&lt;/label&gt;
	&lt;textarea id='message' name='message' required&gt;&lt;/textarea&gt;

	&lt;input type='submit' value='发送'&gt;
&lt;/form&gt;
</code></pre>
</body>
</html>
HTML 表单制作教程 - 创建一个简单且美观的联系表单

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

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