a标签的用法
属性
- href
- target 指定在哪个窗口打开超链接
- download 下载页面
- rel=noopener 作用
- 跳转到外部页面
- 跳转到内部锚点
- 跳转到邮箱或电话 a的ref取值
- 网址
- google.com
- google.com
- //google.com (自动选择http,https)
- 路径
- /a/b/c以及a/b/c (当前路径)
- index.html以及./index.html (当前路径)
- 伪协议
- javascript:代码;
<a href="javascript:;">空的伪协议</a> - mailto:邮箱
- tel:手机号
- javascript:代码;
- Id
- href=#xxx
<a href="#xxx">跳转到id为xxx的位置</a>a的targrt取值 - 内置名字
- _blank 在新的页面打开
- _top 在最顶层页面打开
- _paret 在父级页面打开
- _self 在当前页面打开
- 程序员命名
- window的name
- iframe的name
- href=#xxx
table标签的用法
相关的样式
- table-layout
- border-collapse
- border-spacing
表格边框合并
table {border-collapse:collapse;border-spacing:0;}
img标签的用法
- 作用:发出get请求,展示图片
- 属性:alt/height/width/src
- 时间:onload/onerror 监听图片是否加载成功
- 响应式:max-width:100%
- 可替换元素
form标签
- 作用:发get或post请求,然后刷新页面
- 属性:action/autocomplete/method/target
- 事件:onsubmit
input标签
- 作用:让用户输入内容
- 事件:onchange/onfocus/onblur
其他感想
- 不要双击打开超链接,hs -c-1
- 不要让图片变形(只写宽或者高)