From c3dc08e8eb081fc8cc1b599eab2a60130e95f525 Mon Sep 17 00:00:00 2001 From: pengshiyu <1940607002@qq.com> Date: Fri, 7 Jan 2022 10:18:43 +0800 Subject: [PATCH] fix --- blog/front-edn-learn/element.md | 229 ++++++++++++++++++++++++++++++++ 1 file changed, 229 insertions(+) diff --git a/blog/front-edn-learn/element.md b/blog/front-edn-learn/element.md index b6c0d19..3757320 100644 --- a/blog/front-edn-learn/element.md +++ b/blog/front-edn-learn/element.md @@ -314,3 +314,232 @@ table 属性: [](demo/table-3.html ':include :type=code') [](demo/table-3.html ':include height=170') + +## 12、表单 + +输入框 input + +| type 属性 | 输入框类型 | +| --------- | ---------- | +| text | 文本框 | +| password | 密码框 | +| radio | 单选框 | +| checkbox | 多选框 | +| file | 文件选择 | +| submit | 提交按钮 | +| reset | 重置按钮 | +| button | 普通按钮 | + +(1)text 文本框 + +placeholder 占位符 + +```html + +``` + + + + + +(2)password 密码框 + +placeholder 占位符 + +```html + +``` + + + + + +(3)radio 单选框 + +name 属性分组,一个分组只能有一个值被选中 + +checked 默认选中 + +```html +男 +女 +``` + + +男 +女 + + +(4)checkbox 多选框 + +checked 默认选中 + +```html +北京 +上海 +``` + + +北京 +上海 + + +(5)file 文件选择 + +multiple 多选(按住 ctrl 多选) + +```html + +``` + + + + + + +(6)按钮 + +- submit 提交按钮 +- reset 重置按钮 +- button 普通按钮 + +需要配合 form 表单域使用 + +属性 value 修改按钮显示的值 + +```html + + + +``` + + + + + + + +## button 按钮标签 + +type 取值 + +- submit 提交按钮 +- reset 重置按钮 +- button 普通按钮(默认) + +```html + + + + +``` + + + + + + + + +## select 下拉菜单 + +```html + + +``` + + + + + +option 选项 + +默认选中第一项,可以指定默认选中 selected + +## textarea 多行文本域 + +属性 + +- cols 宽度 列数 +- rows 高度 行数 + +```html + +``` + + + + + +## label 标签 + +点击文字也可选中选项 + +两种使用方式等效 + +```html + + + + +``` + + + + + + + + +## 无语义标签 + +- div 块级标签,独占一行 +- span 行内标签 + +## 语义化标签 + +手机端常用 + +- header 网页头部 +- nav 网页导航 +- footer 网页底部 +- aside 网页侧边栏 +- section 网页区块 +- article 网页文章 + +以上标签和 div 等效,多了语义化 + +## 字符实体 + +在网页中显示特殊字符 + +- 空格 ` ` +- 版权符 `©` + +```html + +hello world + + +hello     world + + +© +``` + + + +hello world + +hello     world + +© + -- GitLab