更新: 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. canvas绘制飞线效果

    在我们做的可视化大屏项目中,经常会遇到飞线的效果. 在我们的大屏编辑器中,可以通过拖拽+配置参数的方式很快就能够实现.下面是我们使用大屏编辑器实现的一个项目效果: 中间地图就有飞线的效果. 抛开编辑器 ...

  2. PHP中引用的详解(引用计数、写时拷贝)

    转载:https://blog.csdn.net/ljguo212/article/details/8972865 1. PHP中引用的特性 PHP中引用意味着用不同的名字访问同一个变量内容,引用不是 ...

  3. oeasy教您玩转vim - 51 - # 读写文件

    读写文件 回忆上节课内容 命令行的光标控制 方向键️️️️️可以控制左右移动 shift+️️️️️按照word左右移动光标 ctrl+b 到开头begin ctrl+e 到结尾end ctrl+w ...

  4. JavaWeb编写登录注册案例并把数据插入MySQL数据库中

    小白学习了这么久的java,第一次上手编写一个完整的登录以及注册案例,麻雀虽小五脏俱全!!!! 案例: 登录和注册 第一:所需创建的包以及相关类 1,domain包(也就是平时所说的Javabean) ...

  5. ABC362

    A link 判断即可... 点击查看代码 #include<bits/stdc++.h> using namespace std; int r,g,b; string c; signed ...

  6. 基于动态数据源的SAAS系统(SpringBoot+MybaitsPlus+Durid)

    一.什么是SAAS系统 SAAS全称 Software as a Service,软件即服务.本人接触SAAS也在近两年:在我的理解,SAAS不是特指某种系统,它是提供某类产品的系统服务平台,让第三方 ...

  7. dcoker file

    dockerfile是来构建镜像文件 [root@docker docker-test-volume]# pwd /home/docker-test-volume vi ./dockerfile 通过 ...

  8. vue pinia sessionstorage 数据存储不上的原因

    vue pinia sessionstorage 的坑 默认的配置是开始 localStorage 如果用 sessionstorage 则发现数据存储不上 ,是因为缺少了序列化和反序列化 impor ...

  9. 【MQTT】Mosquitto 入门案例

    参考博主StoneGeek的文章 https://www.cnblogs.com/sxkgeek/p/9140180.html 之前接触的是在应用程序之间的消息中间件技术 RabbitMQ, Kafk ...

  10. 【Server - 运维】更改腾讯云数据库参数设置

    购买的MySQL实例是一个屏蔽了后台设置的服务器: 默认大小写设置是使用严格区分的: 要设置忽略大小写,就要在my.cnf中更改配置参数 https://cloud.tencent.com/devel ...