制作一个简单的表单页面 - HTML & CSS 示例
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>制作一个简单的表单页面 - HTML & CSS 示例</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #F5F5F5;
margin: 0;
padding: 0;
}
<pre><code> h1 {
text-align: center;
margin-top: 50px;
}
form {
margin: 50px auto;
width: 400px;
background-color: #FFFFFF;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
input[type='text'], input[type='email'], textarea {
width: 100%;
padding: 10px;
margin-bottom: 20px;
border: none;
border-radius: 5px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}
input[type='submit'] {
background-color: #4CAF50;
color: #FFFFFF;
border: none;
border-radius: 5px;
padding: 10px 20px;
cursor: pointer;
font-size: 16px;
}
input[type='submit']:hover {
background-color: #3E8E41;
}
</style>
</code></pre>
</head>
<body>
<h1>制作一个简单的表单页面</h1>
<form>
<label for='name'>姓名:</label>
<input type='text' id='name' name='name' placeholder='请输入您的姓名' required>
<pre><code> <label for='email'>邮箱:</label>
<input type='email' id='email' name='email' placeholder='请输入您的邮箱' required>
<label for='message'>留言:</label>
<textarea id='message' name='message' placeholder='请输入您要留言的内容' rows='5' required></textarea>
<input type='submit' value='提交'>
</form>
</code></pre>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/muXG 著作权归作者所有。请勿转载和采集!