用CSS实现表单form布局

2022-04-15 0 702

出处:http://blog.donews.com/dodo/archive/2005/06/18/434979.aspx

在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>

 

免责声明:
1、本网站所有发布的源码、软件和资料均为收集各大资源网站整理而来;仅限用于学习和研究目的,您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。 不得使用于非法商业用途,不得违反国家法律。否则后果自负!

2、本站信息来自网络,版权争议与本站无关。一切关于该资源商业行为与www.niceym.com无关。
如果您喜欢该程序,请支持正版源码、软件,购买注册,得到更好的正版服务。
如有侵犯你版权的,请邮件与我们联系处理(邮箱:skknet@qq.com),本站将立即改正。

NICE源码网 CSS/HTML 用CSS实现表单form布局 https://www.niceym.com/13654.html