前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >网页中的表单设计(网页表单制作步骤)

网页中的表单设计(网页表单制作步骤)

作者头像
全栈程序员站长
发布2022-08-02 10:45:03
2.8K0
发布2022-08-02 10:45:03
举报
文章被收录于专栏:全栈程序员必看

大家好,又见面了,我是你们的朋友全栈君。

在学习了最基本的网页元素后,接触到了表单,下面是用HTML写的很基础的表单,中间设计到了一点点CSS的内容,不算复杂。

代码语言:javascript
复制
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>表单综合实例</title>
<style type="text/css">
	input.ann{
		border: 2 solid #2B2727;
		color: antiquewhite;
		font-size: 12pt;
		height: 30px;
		background: #999999;
	}
</style>
</head>
<body>
<form name="表单实例" method="post" action="">
<table width="500" border="0" align="center" cellpadding="0" 
cellspacing="2">
<tr>
<td width="143" height="25">姓名:</td>
<td width="351">
<input name="name" type="text" id="name" size="20"></td>
</tr>
<tr>
<td height="25">年龄:</td>
<td><select name="age" id="age">
<option value="18" selected>18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
</select>
</td>
</tr>
<tr>
<td height="25">性别:</td>
<td>
<input name="radiobutton" type="radio" value="radiobotton" checked>
男
<input type="radio" name="radiobutton" value="radiobutton">
女
</td>
</tr>
<tr>
<td height="25">家庭住址:</td>
<td>
<input name="textfield" type="text" size="40"></td>
</tr>
<tr>
<td height="25">联系电话:</td>
<td>
<input name="textfield2" type="text" size="20"></td>
</tr>
<tr>
<td>常用密码</td>
	<td>
		<input type="password" size="10" name="pwd" style="border: 2px solid red;background: red;"/>
	</td>
</tr>
<tr>
<td height="25">对我们的服务是否满意:</td>
<td><input type="checkbox" name="checkbox1" value="checkbox" checked="checked">非常满意
<input type="checkbox" name="checkbox2" value="checkbox">满意
<input type="checkbox" name="checkbox3" value="checkbox">不满意
</td>
</tr>
<tr>
<td height="25">意见:</td>
<td>
<textarea name="textarea" cols="40" rows="6"></textarea>
</td>
</tr>
<tr>
<td height="25" colspan="2" align="center">
<input type="submit" name="submit1" value="提交" class="ann">
<input type="reset" name="submit2" value="重置" class="ann">
</td>
</tr>
</table>
</form>

</body>
</html>

最终结果如下:

网页中的表单设计(网页表单制作步骤)
网页中的表单设计(网页表单制作步骤)

注:样式是给提交和重置的,为了更醒目和好看点。本实例基本包括了表单的一般属性。

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/125511.html原文链接:https://javaforall.cn

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022年4月1,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档