用CSS实现表单form布局
Category: CSS/XHTML
06月 8, 2009
在TABLE布局中设计Form,一般都是用2个td来布局,如果不用table,用CSS怎么做呢?看看下面的代码:
- <style type="text/css">
- label{float: left;width: 80px;}
- form{margin:0px}
- input{width: 180px;border:1px solid #808080}
- textarea{width: 250px;height: 150px;}
- #sbutton{margin-left: 80px;margin-top: 5px;width:80px;}
- br{clear: left;}
- </style>
- <form action="" method="post">
- <label for="user">姓名:</label><input type="text" id=user name="user" value="" /><br />
- <label for="email">邮件:</label><input type="text" id=email name="email" value="" /><br />
- <label for="comment">备注:</label><textarea id=comment name="comment"></textarea><br />
- <input type="submit" id="sbutton" value="确定" /><br /></form>
Sponsor



![[转]三言二拍:营销的会与技术的会](http://www.kekaku.com/wp-content/uploads/2010/09/111_1283438213Vzyj-202x158.jpg)