表单增加css样式

47 篇文章 0 订阅
14 篇文章 0 订阅

代码如下

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>表单增加CSS样式</title>
		<!--  -->
		<style type="text/css">
			body {
				margin: 20px;
			}

			form {
				/* 使用form利用表格显示布局来表示表格 */
				/* 在表单周围增加一个边框,另外在表单内容和边框之间增加一些内边距,还增加了一个背景颜色,使他与背景区分开 */
				display: table;
				padding: 10px;
				border: thin dotted #7e7e7e;
				background-color: #e1ceb8;
			}

			form textarea {
				width: 500px;
				height: 200px;
			}

			.tableRow {
				display: table-row;
			}

			div .tableRow p {
				display: table-cell;
			}

			div .tableRow p :first-first-child {
				text-align: right;
			}

			p .heading {
				font-weight: bold;
			}
		</style>
	</head>
	<body>
		<h1>The Starbuzz Bean Machine</h1>
		<h2>Fill out the form below and click "order now" to order</h2>
		<form action="http://starbuzzcoffee.com/processorder.php" method="post">
			<div class="tableRow">
				<p>
					Choose your beans:
					<select name="beans">
						<option value="House Blend">House Blend</option>
						<option value="Bolivia">Shade Grown Bolivia Supremo</option>
						<option value="Guatemala">Organic Guatemala</option>
						<option value="Kenya">Kenya</option>
					</select>

				</p>
			</div>
			<div class="tableRow">
				<p>Type:</p>
				<p>
					<input type="radio" name="beantype" id="" value="whole" checked="" />Whole bean <br>
					<input type="radio" name="beantype" id="" value="ground" />Ground
				</p>
			</div>

			<div class="tableRow">
				<p>
					Extras:
				</p>
				<p>

					<input name="extras[]" type="checkbox" value="Gift" checked>Gift wrap <br>
					<input name="extras[]" type="checkbox" value="catalog">Include catalog with order
				</p>
			</div>

			<div class="tableRow">
				<p>
					Number of bags :
				</p>
				<p>
					<input type="number" name="bags" id="" value="" min="1" max="10" />
				</p>
			</div>
			<div class="tableRow label">
				<p>
					Must arrive by date:
				</p>
				<p>
					<input type="date" name="date" id="" value="" />
				</p>
			</div>

			<div class="tableRow">
				<p>Ship to:
				</p>
				<p>
				</p>
			</div>
			<div class="tableRow">
				<div class="tableRow">
					<p>Name:</p>
					<p><input type="text" name="name" id="" value="" /> </p>
				</div>
				<div class="tableRow">
					<p>Address:</p>
					<p><input type="text" name="address" id="" value="" /> </p>
				</div>
				<div class="tableRow">
					<p>City:</p>
					<p> <input type="text" name="city" id="" value="" /> </p>
				</div>
				<div class="tableRow">
					<p>State:</p>
					<p> <input type="text" name="state" id="" value="" /> </p>
				</div>
				<div class="tableRow">
					<p>Zip: </p>
					<p><input type="text" name="zip" id="" value="" /> </p>
				</div>

				<div class="tableRow">
					<p>Phone: </p>
					<p><input type="tel" name="phone" id="" value="" /></p>
				</div>

			</div>

			<div class="tableRow">
				<p>Customer Comments:</p>
				<p>
					
					<textarea name="comments" rows="10" cols="50">

								</textarea>
				</p>
			</div>
			<div class="tableRow">
				<p></p>
				<p>
					<input type="submit" name="" id="" value="Order Now" />
				</p>
			</div>
		</form>
	</body>
</html>

 

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值