更新: 2021-06-15

游览器 href 和 base href 绝对路径和相对路径

在没有 base href 的情况下

href="/about.html" 就是从 domain 开始走起, 算是绝对路径

href="../about.html" 往上走的相对路径

href="./about.html" 往 sibling 走的相对路径

href="detail.html" 往下走的相对路径

有时候 ./ 感觉不灵是因为我们经常用 folder + index.html 所以它看上去是 /about/ 但其实是 /about/index.html, 如果想去 contact 那么就得 ../ 而不是 ./, ./ 只能去到 index.html 的 sibling file (如果是 /about <-- 没有 end with / 就 ok )

有了 base href 之后, 所有相对路径都收到影响. 绝对路径没影响.

本来相对路径是对着当前的 path, 有了 base 之后就对着 base.

https://stackoverflow.com/questions/1889076/what-are-the-recommendations-for-html-base-tag

base href 常用来做 prefix 语言

记入一些偶尔会用到的基础知识.

1. blur mousedown click

比如有一个 input 和一个 button

绑定 input blur, button mousedown, click

首先 focus input 然后点击 button

触发顺序是 button mousedown -> input blur -> button click

如果我们在 input blur 的事件中把 button element remove 掉, 那么 button click 事件就不会触发了.

2. 空格是 &nbsp;

<span>a</span>
<span>a</span>

空行自带空格,

html4,5 basic的更多相关文章

  1. hbuilder中的 http://www.w3.org/TR/html4/loose.dtd

    <!-- This is the HTML 4.01 Transitional DTD, which includes presentation attributes and elements ...

  2. hbuilder中的 http://www.w3.org/TR/html4/strict.dtd

    <!-- This is HTML 4.01 Strict DTD, which excludes the presentation attributes and elements that W ...

  3. Atitit HTTP 认证机制基本验证 (Basic Authentication) 和摘要验证 (Digest Authentication)attilax总结

    Atitit HTTP认证机制基本验证 (Basic Authentication) 和摘要验证 (Digest Authentication)attilax总结 1.1. 最广泛使用的是基本验证 ( ...

  4. Basic Tutorials of Redis(9) -First Edition RedisHelper

    After learning the basic opreation of Redis,we should take some time to summarize the usage. And I w ...

  5. Basic Tutorials of Redis(8) -Transaction

    Data play an important part in our project,how can we ensure correctness of the data and prevent the ...

  6. Basic Tutorials of Redis(7) -Publish and Subscribe

    This post is mainly about the publishment and subscription in Redis.I think you may subscribe some o ...

  7. Basic Tutorials of Redis(6) - List

    Redis's List is different from C#'s List,but similar with C#'s LinkedList.Sometimes I confuse with t ...

  8. Basic Tutorials of Redis(5) - Sorted Set

    The last post is mainly about the unsorted set,in this post I will show you the sorted set playing a ...

  9. Basic Tutorials of Redis(4) -Set

    This post will introduce you to some usages of Set in Redis.The Set is a unordered set,it means that ...

  10. Basic Tutorials of Redis(3) -Hash

    When you first saw the name of Hash,what do you think?HashSet,HashTable or other data structs of C#? ...

随机推荐

  1. leetcode简单(数组,字符串,链表):[1, 9, 13, 14, 20, 21, 26, 27, 35, 58]

    目录 1. 两数之和 9. 回文数 13. 罗马数字转整数 14. 最长公共前缀 20. 有效的括号 21. 合并两个有序链表 26. 删除有序数组中的重复项 27. 移除元素 35. 搜索插入位置 ...

  2. oeasy教您玩转vim - 91 - # vim脚本编程展望

    ​ vim脚本编程展望 回忆 上次我们彻底研究了vim高亮的原理 各种语法项syntax item 关键字keyword 匹配模式match 区域region 定义好了之后还可以设置链接成组 hi d ...

  3. Python爬虫(5-10)-编解码、ajax的get请求、ajax的post请求、URLError/HTTPError、微博的cookie登录、Handler处理器

    五.编解码(Unicode编码) (1)GET请求 所提方法都在urllib.parse.路径下 get请求的quote()方法(适用于只提交一两个参数值) url='http://www.baidu ...

  4. PHP现代化构建工具: 无需修改任何代码和扩展将你的ThinkPHP项目性能提高20倍

    我要分享一个令人激动的黑科技:PRipple 使用这个项目能够在无需修改任何代码且无需第三方扩展的前提下,将你的 Laravel 项目性能提高 20 倍.他仅仅依赖于PHP原生的 pcntl/posi ...

  5. NameCheap域名怎么样,如何注册购买域名?如何解析域名?

    Namecheap介绍 Namecheap是一家国外域名注册商和网站托管公司,成立于2000年,提供域名注册.虚拟主机.电子邮件托管.SSL证书.免费的WHOIS保护.CDN.VPS主机和独立服务器. ...

  6. 跨平台字幕制作软件ARCTIME

      官网:http://arctime.cn/

  7. 《Python数据可视化之matplotlib实践》 源码 第三篇 演练 第八章

    图  8.1 import matplotlib.pyplot as plt import numpy as np plt.axes([0.05, 0.7, 0.3, 0.3], frameon=Tr ...

  8. 特朗普开始在YouTube上打竞选广告了 —— 美国总统的竞选广告已经开始媒体投放了

    相关: 拜登开始在YouTube上打竞选广告了 -- 美国总统的竞选广告已经开始媒体投放了 PS. 又多了一个猴上台,哈哈哈. 特朗普的竞选资金筹集网站:

  9. 强化学习算法真的适合于你的应用吗 —— 强化学习研究方向(研究领域)现有的不足(短板、无法落地性) —— Why You (Probably) Shouldn’t Use Reinforcement Learning

    外文原文: Why You (Probably) Shouldn't Use Reinforcement Learning 地址: https://towardsdatascience.com/why ...

  10. 【转载】 gym atari游戏的环境设置问题:Breakout-v0, Breakout-v4, BreakoutNoFrameskip-v4和BreakoutDeterministic-v4的区别

    版权声明:本文为CSDN博主「ok_kakaka」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明.原文链接:https://blog.csdn.net/clksjx/ ...