https://www.w3.org/wiki/HTML/Elements/base

HTML/Elements/base

HTML‎ | Elements
 

<base>

The <base> element allows authors to specify the document base URL for the purposes of resolving relative URLs, and the name of the default browsing context for the purposes of following hyperlinks. The element does not represent any content beyond this information.

Point

  • A base element must have either an href attribute, a target attribute, or both.
  • There must be no more than one base element per document.

HTML Attributes

  • href = valid URL potentially surrounded by spaces
    A base element, if it has an href attribute, must come before any other elements in the tree that have attributes defined as taking URLs, except the html element (its manifest attribute isn't affected by base elements). [Example A]
  • target = valid browsing context name or keyword ( _blank, _self, _parent, or _top)
    The value of the target attribute is used as the default when hyperlinks and forms in the Document cause navigation.

See also global attributes.

Examples

Example A

In this example, a <base> element is used to set the document base URL.
The link in the this example would be a link to "http://www.example.com/news/archives.html" [try it]:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>This is an example for the <base> element</title>
<base href="http://www.example.com/news/index.html">
</head>
<body>
<p>Visit the <a href="archives.html">archives</a>.</p>
</body>
</html>

HTML Reference

The HTML5 specification defines the <base> element in 4.2.3 The base element.

HTML/Elements/base的更多相关文章

  1. WPF ListBox的进阶使用(二)

    项目中经常使用需要根据搜索条件查询数据,然后用卡片来展示数据.用卡片展示数据时,界面的宽度发生变化,希望显示的卡片数量也跟随变化.WrapPanel虽然也可以实现这个功能,但是将多余的部分都留在行尾, ...

  2. GNU Emacs命令速查表

    GNU Emacs命令速查表 第一章  Emacs的基本概念 表1-1:Emacs编辑器的主模式 模式 功能 基本模式(fundamental mode) 默认模式,无特殊行为 文本模式(text m ...

  3. AtCoder Beginner Contest 104

    A - Rated for Me Time Limit: 2 sec / Memory Limit: 1024 MB Score : 100100 points Problem Statement A ...

  4. 【WPF学习】第六十七章 创建自定义面板

    前面两个章节分别介绍了两个自定义控件:自定义的ColorPicker和FlipPanel控件.接下来介绍派生自定义面板以及构建自定义绘图控件. 创建自定义面板是一种特殊但较常见的自定义控件开发子集.前 ...

  5. WPF教程十三:自定义控件进阶可视化状态与自定义Panel

    如果你敲了上一篇的代码,经过上一篇各种问题的蹂躏,我相信自定义控件基础部分其实已经了解的七七八八了.那么我们开始进阶,现在这篇讲的才是真正会用到的核心的东西.简化你的代码.给你提供更多的可能,掌握了这 ...

  6. 封装常用的js(Base.js)——【01】理解库,获取节点,连缀,

    封装常用的js(Base.js)——[01]理解库,获取节点,连缀,  youjobit07 2014-10-10 15:32:59 前言:       现如今有太多优秀的开源javascript库, ...

  7. jqeury.base

    min.js //前台调用 var $ = function (args) { return new Base(args); } //基础库 function Base(args) { //创建一个数 ...

  8. google base库中的WaitableEvent

    这个类说白了就是对windows event的封装,没有什么特别的,常规做法,等侍另一线程无非就是等侍事件置信waitsingleobject,通知事件无非就是setevent,一看就明白,不就详解, ...

  9. base库插件---拖动

    /** * Created by Administrator on 2014/6/5 0005. Base-drag 基于Base库的拖拽插件 tags为你要拖拽的元素参数, 数组形式传入 */ $( ...

随机推荐

  1. mapReduce编程之Recommender System

    1 协同过滤算法 协同过滤算法是现在推荐系统的一种常用算法.分为user-CF和item-CF. 本文的电影推荐系统使用的是item-CF,主要是由于用户数远远大于电影数,构建矩阵的代价更小:另外,电 ...

  2. jquery 赋值文本框输入框

    jQuery("#mrId option[value='" + extValue + "']").attr("selected", true ...

  3. poj1703_Find them, Catch them_并查集

    Find them, Catch them Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 42451   Accepted: ...

  4. JMeter遇到的问题一:Error writing to server(转)

    Java.io.IOException: Error writing to server异常:我测试500个并发时,系统没有问题:可当我把线程数加到800时,就出现错误了,在"查看结果树&q ...

  5. 图片大小以及dp和px关系一览表,logo尺寸

    图片大小以及dp和px关系一览表 说明:根据上表,我们应该很容易算出一张图片在不同手机上的宽和高是多少. 结论 从上表可以得出如下结论 1. 图片放在drawable中,等同于放在drawable-m ...

  6. windows下修复Linux引导 and linux下几个常用软件

    在这里,我选择的是deepinLinux,不用说,高端大气上档次! Linux下引导修复 在win7上安装好了Linux,一不小心Linux系统启动不了 (一不小心的过程,想使用root登录图像界面, ...

  7. 你不知道的this—JS异步编程中的this

    Javascript小学生都知道了javascript中的函数调用时会 隐性的接收两个附加的参数:this和arguments.参数this在javascript编程中占据中非常重要的地位,它的值取决 ...

  8. iOS NSOperation 异步加载图片 封装NSOperation 代理更新

    #import <Foundation/Foundation.h> @class MYOperation; @protocol MYOperationDelecate <NSObje ...

  9. 神经网络及其PID控制

    一.人工神经元模型 1.突触权值(连接权) 每一个突触都由其权值作为特征表征,各个神经元之间的连接强度由突触权值来表示.与神经元相连的突触上,连接的输入信号通过权值的加权进入神经元的求和单元. 2.求 ...

  10. [leetcode] 题型整理之数字加减乘除乘方开根号组合数计算取余

    需要注意overflow,特别是Integer.MIN_VALUE这个数字. 需要掌握二分法. 不用除法的除法,分而治之的乘方 2. Add Two Numbers You are given two ...