更新: 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. let 和 const 是 JavaScript 中用于声明变量的关键字

    let 和 const 是 JavaScript 中用于声明变量的关键字. let 关键字用于声明可变(可重新赋值)的变量.通过使用 let 关键字声明的变量可以在其作用域内被重新赋值.例如: let ...

  2. “智能体风”吹进体育圈 粉丝手搓上百个智能体为中国健儿应援 太有AI了!粉丝手搓上百个智能体为中国健儿打CALL

    智能体的风吹进了体育竞技圈.近日,在百度文心智能体平台,出现了上百个充满"AI"的运动明星粉丝应援智能体,比如支持中国女子乒乓球运动员孙颖莎的"孙颖莎的小迷妹" ...

  3. hadoop hive hbase flume sqoop基本操作

    top 里的id为cpu空闲度 如果wa为99.8就是负担太重.得停掉一些任务 cat /proc/cpuinfo 查看cpu信息 cat /proc/meminfo 查看内存信息 hadoop基础操 ...

  4. python统计班级学生

    python统计班级学生 如下场景: 假设我有一个学生类和一个班级类,想要实现的功能为:    执行班级人数增加的操作.获得班级的总人数:    学生类继承自班级类,每实例化一个学生,班级人数都能增加 ...

  5. 7月22号python 每日一题

    7月22号python 每日一题 LCR 121. 寻找目标值 - 二维数组 难度:中等 m*n 的二维数组 plants 记录了园林景观的植物排布情况,具有以下特性: 每行中,每棵植物的右侧相邻植物 ...

  6. 12、SpringMVC之拦截器

    12.1.环境搭建 创建名为spring_mvc_interceptor的新module,过程参考9.1节和9.5节 12.1.1.页面请求示例 <a th:href="@{/test ...

  7. 【Web】实现页面自动刷新的功能

    技术发现自: https://www.bilibili.com/video/BV14v411b7JS?p=8 摘要自CSDN帖子: https://blog.csdn.net/senbar/artic ...

  8. blender建模渲染Tips

    blender渲染 灯光的三种方式 1,常规灯光:shift+A选择灯光. 2,世界环境光:右侧地球图标调整. 3,物体自发光:把渲染物体变成一个发光体来进行调节灯光. 渲染视窗的调节 ctrl+b裁 ...

  9. 人形机器人(humanoid)的摔倒实验/撞击实验

    motivation: 人形机器人的实体比较昂贵,但是实验过程中机器人的摔倒和撞击时十分常见的事情,这就会导致机器人的元器件被损坏,造成较大的经济损失,为此我们在设计机器人的机械结构和电子元器件布局时 ...

  10. WarpDrive 教程 第一部分修改版

    本文参考: https://www.cnblogs.com/devilmaycry812839668/p/15327509.html warpDrive是一个python库,目的是使用GPU并行运行多 ...