用CSS實現(xiàn)表單form布局
出處: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>
相關文章
html加css樣式實現(xiàn)js美食項目首頁示例代碼
本篇文章主要來教大家實現(xiàn)一個美食項目的首頁,文中附含部分功能實現(xiàn)的示例代碼,有需要的朋友可以借鑒參考下,希望能夠有所幫助2021-09-09