当前位置: 首页 > news >正文

web表单标签与练习(3.18)

一、表单域

表单域是一个包含表单元素的区域。
在HTML标签中,< form >标签用于定义表单域,以实现用户信息和传递。
< form >会把它范围内的表单元素信息提交给服务器。

表单属性

action url地址 用于指定接收并处理表单数据的服务器程序的url地址
methodget/post 用于设置表单数据的提交方式,其取值为get或post
name名称 用于指定表单的名称,以区分同一个页面中的多个表单域。

表单元素

输入框<input=text>        readonly表示只读
单选框<input=radio>        required设置为必选项
密码框<input=password>
多选框<input=checkbox>
邮箱框<input=email>
上传文件<input=file>
按钮<button></button>

name属性,表明是一组单选;checked,默认选中

下拉框:

<form action=""><select name="city" multiple><option value="上海">上海</option><option value="北京">北京</option><option value="广州" selected>广州</option></select><button>提交</button></form>

文本域:

 <form action=""><textarea name="liuyan" cols="300" rows="10" maxlength="200" placeholder="请写下你的留言"></textarea></form>

二、css

基本选择器:

标签选择器

标签名

类选择器

.类名

id选择器

#

通配符选择器

*

包含选择器:

子代选择器

.a>li 

后代选择器a li
逗号选择器同时选择多个标签,用,隔开*/

引入方式

外链:<link rel="stylesheet" href="./08-index.css">

内部:

<style>

        /* 选择器{

            属性名:属性值;

            属性名:属性值;

        } */

        div {

            width: 300px;

            height: 300px;

            background-color: green;

        }

    </style> -->

三、练习

html:

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>注册界面</title><link rel="stylesheet" href="../新建文件夹/css.css">
</head>
<body ><div class="zc"><div class="yhzc">用户注册</div><div style="width: 300px;margin: auto"><div class="small">用户名:</div><div class="kuang"><input type="text"style="width: 220px"></div><div class="small">密码:</div><div class="kuang"><input type="password" style="width: 220px"></div><div class="small">性别:</div><div class="duoxuan"><input type="radio" checked> 男 <input type="radio"> 女</div><div class="small">爱好:</div><div class="duoxuan"><input type="checkbox">写作 <input type="checkbox">听音乐 <input type="checkbox">体育</div><div class="small">省份:</div><div class="xiala"><select style="width: 100px"><option>陕西省</option><option>北京市</option></select></div><div class="small">自我介绍:</div><div class="xiala"><select multiple style="width: 250px"><option>&nbsp;</option></select></div><div style="height: 70px;line-height: 70px"><div style="width: 150px;float: left"><input type="submit" name="提交"style="width: 70px"></div><div style="width: 150px;float: left"><input type="reset" name="重置" style="width: 70px"></div></div></div></div></body>
</html>

css:

*{background-color: rgb(196, 196, 202);
}
.zc{width: 400px;height: 460px;border: 1px solid black;margin: auto;margin-top: 70px;text-align: center;
}
.yhzc{font-size: 32px;line-height: 50px;font-weight: bold;background-color: grey;
}
.kuang{width: 220px;float: left;height: 50px;line-height: 50px;
}
.small{width: 80px;height: 50px;line-height:50px;float: left;text-align: left;
}
.duoxuan{width: 220px;float: left;height: 50px;line-height: 50px;text-align: left;
}
.xiala{width: 220px;float: left;height: 50px;line-height: 50px;margin: auto;
}

http://www.lryc.cn/news/324632.html

相关文章:

  • 【协议-HTTP】
  • VUE3v-text、v-html、:style的理解
  • Dataset之UCI_autos_cars:UCI_autos_imports-85(汽车进口数据集)的简介、安装、案例应用之详细攻略
  • 结构体类型详细讲解(附带枚举,联合)
  • 编程生活day1--个位数统计、考试座位号、A-B、计算阶乘和
  • mysql体系结构及主要文件
  • PwnLab靶场PHP伪协议OSCP推荐代码审计命令劫持命令注入
  • 涉密信息系统集成资质八大类别办理条件是什么?
  • Shell脚本总结-反引号-${}-$()
  • Spring MVC入门(4)
  • RuoYi-Vue-Plus(基础知识点jackson、mybatisplus、redis)
  • 使用verillog编写KMP字符串匹配算法
  • 《每天十分钟》-红宝书第4版-对象、类与面向对象编程(五)
  • 华为ensp中rip动态路由协议原理及配置命令(详解)
  • 学习要不畏难
  • mysql迁移达梦数据库 Java踩坑合集
  • arm 解决Rk1126 画框颜色变色问题(RGB转NV12)
  • 113 链接集10--ctrl+左键单击多选
  • 详解JavaScript中this指向
  • c语言之在函数中传递指针
  • vue2 插槽(默认插槽 slot 、具名插槽 v-slot 、作用域插槽 slot-scope -- 插槽传值 )
  • (第79天)单机转 RAC:19C 单机 到 19C RAC
  • Spring Cloud微服务Actuator和Vue
  • Iterator对象功能学习
  • Linux的一些基本指令
  • 【tips】Git使用指南
  • 【字节序】
  • 数据结构(五)——树森林
  • vscode配置c/c++调试环境
  • 食品输送带的材质