表单标签的定义和总结
创建表单时常用的标签和使用说明
标签 |
描述 |
form |
form 标签用于创建HTML 表单的起始标签 |
input |
input标签解析到浏览器有多种表现形式,可通过type属性定义类型 |
textarea |
textarea标签用语创建是多行文本输入框 |
select |
select标签用来创建下拉列表 |
option |
option标签通常用在select标签内,为select标签提供选择项 |
label |
lable标签通常用于定义相关联表单标签的说明 |
button |
button标签是一个定义按钮的标签 |
HTML中常见的布尔类型的属性
属性 |
描述 |
noshade |
用来表示有无阴影,多用在hr标签当中 |
checker |
用来表示是否默认选中,多用于单选按钮(type=”radio”),多选框(type=”checkbox”),单选按钮和多选框的name属性值必须相同,且多选框的name属性值必须为数组形式 |
selected |
用在下拉列表的option标签内,表示是否优先显示 |
autofocus |
多用在input标签内,表示是否自动获取焦点 |
readonly |
表示只读属性,可以获取焦点,数据会传输给后台,适用于可以输入文本框 |
disabled |
是禁用属性,可以使标签无法获取焦点,多用于只需提示功能,不带有其他功能的标签 |
require |
用来表示必须选择、多用于input标签中 |
<style>
.reg {
width: 320px;
border: 1px solid #333;
margin: 100px auto;
}
h3 {
height: 60px;
line-height: 60px;
text-align: center;
margin: 0 10px;
border-bottom: 2px solid #999;
}
.must, .choose {
padding-inline-start: 0;
}
li {
list-style: none;
height: 40px;
padding: 0 5px;
margin: 2px 10px;
}
.must li label {
margin: 0 10px;
line-height: 40px;
}
.must li input {
height: 25px;
line-height: 25px;
padding-left: 5px;
outline: none;
border: 1px solid #999;
}
hr{
margin: 0 10px;
}
.opt{
text-align: center;
height: 30px;
line-height: 30px;
font-size: 12px;
color: #ccc;
}
.choose li select{
height: 30px;
line-height: 30px;
text-align: center;
outline: none;
}
.choose li textarea{
resize: none;
outline: none;
height: 80px;
}
button {
width: 120px;
height: 40px;
margin-left: 120px;
}
</style>
<div class="reg">
<h3>会员注册</h3>
<form action="">
<ul class="must">
<li>
<label for="user">用 户:</label>
<input type="text" id="user" name="username" placeholder="请输入用户名称" autofocus />
</li>
<li>
<label for="psw">密 码:</label>
<input type="password" id="psw" name="password" placeholder="请输入用户密码" />
</li>
<li>
<label for="pswt">确 认:</label>
<input type="password" id="pswt" name="password" placeholder="请确认用户密码" />
</li>
</ul>
<hr>
<div class="opt">以下是可选内容~~~可以不填</div>
<hr>
<ul class="choose">
<li>
<label for="secret">性 别:</label>
<input type="radio" id="male" name="sex" value="male" checked><label for="male">男</label>
<input type="radio" id="female" name="sex" value="female"><label for="female">女</label>
<input type="radio" id="secret" name="sex" value="secret"><label for="secret">保密</label>
</li>
<li>
<label for="">学 历:</label>
<select name="edu" id="">
<option value="0" selected disabled> -- 请选择 -- </option>
<option value="1">高中</option>
<option value="2">大专</option>
<option value="3">学生</option>
<option value="4">硕士</option>
<option value="5">博士</option>
<option value="6">其他</option>
</select>
</li>
<li>
<label for="">爱 好:</label>
<input type="checkbox" id="male" name="hobby[]" value="film" ><label for="film">电影</label>
<input type="checkbox" id="music" name="hobby[]" value="music"><label for="music">音乐</label>
<input type="checkbox" id="motion" name="hobby[]" value="motion" checked><label for="motion">运动</label>
<input type="checkbox" id="game" name="hobby[]" value="game" checked><label for="game">游戏</label>
</li>
<li style="height: 100px;">
<label for="" style="float: left;">简 介:</label>
<textarea name="" id="" cols="30" rows="10"></textarea>
</li>
<button type="submit">提交</button>
</ul>
</form>
</div>
运用ul>li>a标签和内联框架标签iframe制作的简单后台页面
<style>
.main {
width: 1200px;
height: 1000px;
margin: 0 auto;
border: 2px solid #333;
}
a{
text-decoration: none;
}
.main ul,
.main li {
padding-inline-start: 0;
}
.user {
width: 1200px;
height: 100px;
border-bottom: 2px solid #333;
background: url(https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.win4000.com%2Fwallpaper%2F2020-08-10%2F5f310c1c3109f.jpg&refer=http%3A%2F%2Fpic1.win4000.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1659687209&t=fc856f892533c350f7fea3d85290472e) 0 0;
}
.title {
float: left;
width: 500px;
height: 100px;
line-height: 100px;
font-size: 35px;
color: #fff;
padding-left: 30px;
}
.login {
float: right;
width: 120px;
height: 100px;
line-height: 100px;
}
.lumn {
float: left;
width: 200px;
height: 900px;
overflow: overlay;
}
.lumn li {
width: 180px;
margin: 10px;
height: 40px;
text-align: center;
line-height: 40px;
border: 1px solid #333;
list-style: none;
background: #1276b1;
}
.lumn li a {
color: #fff;
font-size: 18px;
text-decoration: none;
}
.cont {
float: right;
width: 1000px;
height: 900px;
background: green;
}
iframe{
width: 1000px;
height: 900px;
}
iframe img{
width: 1000px;
height: 900px;
}
</style>
<div class="main">
<div class="user">
<div class="title">
风景聚焦后台管理
</div>
<div class="login">
<a href="#" style="margin-right: 20px; color: red;">admin</a> <a href="#">退出</a>
</div>
</div>
<div class="lumn">
<ul>
<li><a href="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg9.51tietu.net%2Fpic%2F2019-091407%2Fw1ljfh0pkl0w1ljfh0pkl0.jpg&refer=http%3A%2F%2Fimg9.51tietu.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1659687209&t=9bd3faa5819c4589e2ecd916e1c10b54" target="camera">1 号监控</a></li>
<li><a href="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg9.51tietu.net%2Fpic%2F2019-091113%2Favzuenqrczuavzuenqrczu.jpg&refer=http%3A%2F%2Fimg9.51tietu.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1659687209&t=f117961845340c03ce4d644fa33346de" target="camera">2 号监控</a></li>
<li><a href="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.win4000.com%2Fwallpaper%2F2020-10-12%2F5f83b7c13d0b9.jpg&refer=http%3A%2F%2Fpic1.win4000.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1659687209&t=ba0ac97a3f0089ad3ab693bcd2731dc4" target="camera">3 号监控</a></li>
<li><a href="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg9.51tietu.net%2Fpic%2F2019-091407%2F1urclbp0bq51urclbp0bq5.jpg&refer=http%3A%2F%2Fimg9.51tietu.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1659687209&t=34664d5cb8f9d171072976c8a4179c41" target="camera">4 号监控</a></li>
<li><a href="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg13.51tietu.net%2Fpic%2F20200118%2Fnt4cdvjgs4nnt4cdvjgs4n.jpg&refer=http%3A%2F%2Fimg13.51tietu.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1659687209&t=be30ae3d23d24f27c1d9ad4844adfb5b" target="camera">5 号监控</a></li>
<li><a href="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic.jj20.com%2Fup%2Fallimg%2F911%2F0G216122520%2F160G2122521-15.jpg&refer=http%3A%2F%2Fpic.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1659687209&t=3fcffd4125d90dea7ded0dde960a07a4" target="camera">6 号监控</a></li>
<li><a href="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.win4000.com%2Fwallpaper%2F2018-04-12%2F5aced110692f4.jpg%3Fdown&refer=http%3A%2F%2Fpic1.win4000.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1659687209&t=139e6180fe22e49c52b30fa6594612d7" target="camera">7 号监控</a></li>
<li><a href="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg9.51tietu.net%2Fpic%2F2019-091400%2Fozwpb5agcfwozwpb5agcfw.jpg&refer=http%3A%2F%2Fimg9.51tietu.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1659687209&t=64f7d73eeba8248b8adee51584ea6cf8" target="camera">8 号监控</a></li>
<li><a href="https://pic.rmb.bdstatic.com/ca93cb63d4851e64c1dae1e90388ac25.jpeg" target="camera">9 号监控</a></li>
<li><a href="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic3.zhimg.com%2Fv2-ff08dfe37b12dfa19719d96a68419f6d_1440w.jpg%3Fsource%3D172ae18b&refer=http%3A%2F%2Fpic3.zhimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1659687209&t=3278639ca1d28e50545ef48231b74db7" target="camera">10 号监控</a></li>
<li><a href="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.win4000.com%2Fwallpaper%2F5%2F53acdca30d49a.jpg&refer=http%3A%2F%2Fpic1.win4000.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1659687995&t=fccb1a39abe5af11ef45e33f79f78c17" target="camera">11 号监控</a></li>
<li><a href="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.win4000.com%2Fwallpaper%2F5%2F53acdcaa11291.jpg&refer=http%3A%2F%2Fpic1.win4000.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1659687995&t=d497414055c9c2ae53f3504c9af2cec5" target="camera">12 号监控</a></li>
<li><a href="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg9.51tietu.net%2Fpic%2F2019-091111%2Finhzpuovotiinhzpuovoti.jpg&refer=http%3A%2F%2Fimg9.51tietu.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1659687209&t=d958cb673f8d6af1aa6506a6162bd846" target="camera">13 号监控</a></li>
<li><a href="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.win4000.com%2Fwallpaper%2F5%2F53acdca6a0bcc.jpg&refer=http%3A%2F%2Fpic1.win4000.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1659687995&t=40d0c47a197af8596d5f3e60874d14c7" target="camera">14 号监控</a></li>
<li><a href="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg9.51tietu.net%2Fpic%2F2019-091004%2Fuwzujvqjoy3uwzujvqjoy3.jpg&refer=http%3A%2F%2Fimg9.51tietu.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1659687209&t=e82bef00be7046b814f95b1259cfdb23" target="camera">15 号监控</a></li>
<li><a href="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.win4000.com%2Fwallpaper%2F5%2F53acdcb191dc2.jpg&refer=http%3A%2F%2Fpic1.win4000.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1659687995&t=3f707d6d13c65bec99059bfe9f4ebcfb" target="camera">16 号监控</a></li>
<li><a href="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2F1115%2F0ZR1095111%2F210ZP95111-11-1200.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1659687209&t=9f3adac8e31094571532bff7ac7af22d" target="camera">17 号监控</a></li>
<li><a href="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg9.51tietu.net%2Fpic%2F2019-091211%2Fl2d5i5rhrltl2d5i5rhrlt.jpg&refer=http%3A%2F%2Fimg9.51tietu.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1659687209&t=47bd7c29fa076a5ea675f57ddeecd40e" target="camera">18 号监控</a></li>
<li><a href="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg9.51tietu.net%2Fpic%2F2019-091322%2F343cums5fl0343cums5fl0.jpg&refer=http%3A%2F%2Fimg9.51tietu.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1659687209&t=839d251ac0f50a18a392948827aa2f95" target="camera">19 号监控</a></li>
<li><a href="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg9.51tietu.net%2Fpic%2F2019-091116%2Fhn0njbasvoohn0njbasvoo.jpg&refer=http%3A%2F%2Fimg9.51tietu.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1659687209&t=4568bfe7322445636165cf1f8e6272b3" target="camera">20 号监控</a></li>
</ul>
</div>
<div class="cont">
<iframe srcdoc="<a href='javascript:;'>请点击左侧菜单,看世界风景!!</a>" frameborder="1" name="camera"></iframe></div>
</div>