HTML学习笔记

1.body中默认的margin是多少像素?

margin:8px;

2.iframe
  • frameborder='0'消除框线
3.npm i -g http-server-c -1 http-server
4.a标签
  • download 属性规定被下载的超链接目标。
    1 <a href="./index.html" download>下载index</a>
    2 content-type = application/octet-stream
  • href属性
<a href="qq.com">xxx</a>       <!--qq.com作为某个文件处理 -->
<a href="http://qq.com">xxx</a>         <!--打开这个网址,qq.com为域名-->
<a href="//qq.com">xxx</a>      <!--无协议链接,点击xxx浏览器会以当前页面所支持的协议打开-->
<a href="#top">xxx</a>      <!--返回页面顶部-->
<a href="#">xxx</a>         <!--页面锚点变为#,跳转页面顶部-->
<a href="#xxx">xxx</a>      <!--跳到该页面的锚点#-->
<a href="?name-xxx">xxx</a>         <!--name-xxx作为查询参数加到网址后面-->
<a href="JavaScript:alert(2)">xxx</a>       <!--点击执行js的alert函数,弹出弹框-->
<a href="">xxx</a>      <!--刷新页面-->
<a href="javascript:;"></a>         <!--什么都不做-->
<a href="/..">xxx</a>       <!--浏览器发起GET/HTTP/1.1的请求-->
5.button和submit的区别
  • 在表单中button如果没写type会自动升级为submit按钮,写type就按type类型,没有submit按钮
   <input type="submit" value="submit">  <!-- 提交-->
   <button type="submit">submit</button><!-- 提交-->
   <button>提交</button>               <!-- 提交-->
   <button type="button">button</button><!-- 按钮-->
6.<label for="xxx">用户名</label><input type=“text” id="xxx">等价于<label>用户名<input type=“text”></label>
7.form
<form action="users" method="GET">
    <label>用户名<input name="username" type="text" placeholder="username" value="sandra"></label>
    <label>密码<input name="password" type="password"></label>
    喜欢的水果                       <!-- 复选框-->
    <label>橘子<input name="checkbox" type="checkbox"></label>
    <label>香蕉<input name="checkbox" type="checkbox"></label>
    爱我                                 <!-- 单选框,同一个name可以单选-->
    <label>yes<input name="radio" type="radio"></label>
    <label>no<input name="radio" type="radio"></label>
</form>
8 table

border-collapse:collapse; border间没有空隙

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容