a标签的用法
作用
- 跳转外部页面
- 跳转内部锚点
- 跳转到邮箱或电话等
属性
- href
- 网址
- 路径
- 伪协议
- ID
href="https://google.com"
href="http://google.com"
href="//google.com";无协议网址,自动选择适用http或https
herf="/a/b/c"或herf="a/b/c"
herf="index.html"或herf="./index.html"
javascript:代码; herf="javascript: alert(1);" herf="javascript:;"(让a标签什么都不做)
mailto: 邮箱
tel: 手机号
herf="#id";跳转道指定标签
- 内置名字
- 程序员命名
_blank 在空白页面打开
_top 在顶层打开
_parent 在当前链接所在的上一层打开
_self 默认值,在当前页面打开
window的name
iframe的name
download="//google.com"
下载网页,但不是所用所有网站都支持
img标签的用法
作用
发出一个get请求,展示一张图片
属性
- alt
- height
- width
- src
图片加载失败时,显示一段提示文字
设置高度
设置宽度
设置图片地址
事件
- onload/onerror
用于监听图片是否加载成功;成功时调用onload,失败时调用onerror
table标签的用法
作用
定义html表格
属性
- thead
- tbody
- tfoot
- tr
- td
- th
定义表格的页眉
定义表格的主体
定义表格的页脚
定义表格的行
定义表格单元
定义表格的表头
相关样式
- table-layout
- boeder-collapse
- border-spacing