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. mediastreamer使用教程

    mediastreamer使用教程 1.各个函数功能简介 ms_filter_destroy 释放filter资源 ms_ticker_destroy释放ticker 说明:ticker为定时器线程, ...

  2. struts2 拦截器

    拦截器:对Action的访问.可以拦截到Action中某个方法.与过滤器不同,过滤器过滤的是请求.过滤JSP.html.但是拦截器不能拦截jsp.html的访问. Struts2 拦截器在访问某个 A ...

  3. C# mongodb 驱动操作(Z)

    Query.All("name", "a", "b");//通过多个元素来匹配数组 Query.And(Query.EQ("nam ...

  4. python初学杂记

    python常用命令: 1.python 或者 python3  打开交互式python解释器 2.python hello.py   通过命令提示符运行python脚本 交互式python解释器常用 ...

  5. js串讲整理

    js子级窗口向父级窗口传值 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http ...

  6. Sql Server 中锁的概念

    锁的概述 一. 为什么要引入锁 多个用户同时对数据库的并发操作时会带来以下数据不一致的问题: 丢失更新A,B两个用户读同一数据并进行修改,其中一个用户的修改结果破坏了另一个修改的结果,比如订票系统 脏 ...

  7. Jetty使用教程(四:28-30)—Jetty开发指南

    二十八.延续机制支持 28.1 延续简介 延续是一种机制用来实现类似于Servlet 3.0异步功能的异步Servlet,但提供了一个简单易操作的接口. 28.1.1 为什么使用异步Servlets ...

  8. Mac下环境变量配置

    Mac下的常用环境变量配置文件 1./etc/profile   (建议不修改这个文件 ) 全局(公有)配置,不管是哪个用户,登录时都会读取该文件. 2./etc/bashrc    (一般在这个文件 ...

  9. JavaOO面向对象中的注意点

    1.JavaOO宗旨思想: ★万物皆对象,对象因关注而产生★ ☆类是对象的抽取,对象是类的实例☆ 2.JavaOO的三大特征: 封装.继承.多态  (第四大特征 抽象 现还有争议) 3.属性与行为: ...

  10. 【MongoDB】5.MongoDB与java的简单结合

    1.首先 你的清楚你的MongoDB的版本是多少  就下载对应的架包 下载地址如下: http://mongodb.github.io/mongo-java-driver/ 2.新建一个项目  把架包 ...