<!DOCTYPE html>
<html>
<head>
	<title>美观半透明表单</title>
	<style>
		form {
			background-color: rgba(255, 255, 255, 0.8);
			border: 1px solid black;
			padding: 20px;
			border-radius: 10px;
			width: 500px;
			margin: auto;
			margin-top: 50px;
		}
<pre><code>	label {
		display: inline-block;
		width: 100px;
		margin-bottom: 10px;
	}

	input[type='text'], input[type='password'], select {
		width: 200px;
		padding: 10px;
		margin-bottom: 10px;
		border-radius: 5px;
		border: none;
	}

	input[type='submit'] {
		background-color: #4CAF50;
		color: white;
		border-radius: 5px;
		border: none;
		padding: 10px;
		cursor: pointer;
	}

	textarea {
		width: 400px;
		height: 200px;
		padding: 10px;
		margin-bottom: 10px;
		border-radius: 5px;
		border: none;
	}
&lt;/style&gt;
</code></pre>
</head>
<body>
	<form>
		<label for='name'>姓名:</label>
		<input type='text' id='name' name='name' required>
<pre><code>	&lt;label for='gender'&gt;性别:&lt;/label&gt;
	&lt;select id='gender' name='gender'&gt;
		&lt;option value='male'&gt;男&lt;/option&gt;
		&lt;option value='female'&gt;女&lt;/option&gt;
	&lt;/select&gt;

	&lt;label for='password'&gt;密码:&lt;/label&gt;
	&lt;input type='password' id='password' name='password' required&gt;

	&lt;label for='education'&gt;学历:&lt;/label&gt;
	&lt;select id='education' name='education'&gt;
		&lt;option value='college'&gt;大专&lt;/option&gt;
		&lt;option value='undergraduate'&gt;本科&lt;/option&gt;
	&lt;/select&gt;

	&lt;label for='resume'&gt;简历:&lt;/label&gt;
	&lt;textarea id='resume' name='resume' 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/muSQ 著作权归作者所有。请勿转载和采集!

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