HTML <base> href 属性
标签" href="tag-main.html"><main>
<map>
<mark>
<menu>
<meta>
<meter>
<nav>
<noframes>
<noscript>
<object>
<ol>
<optgroup>
<option>
<output>
<p>
<param>
<pre>
<html>
<picture>
<progress>
<q>
<rp>
<rt>
<ruby>
<s>
<samp>
<script>
<section>
<select>
<small>
<source>
<span>
<strike>
<strong>
<style>
<sub>
<summary>
<sup>
<table>
<tbody>
<td>
<textarea>
< template>
<tfoot>
<th>
<thead>
<time>
<title>
<tr>
<track>
<tt>
<u>
<ul>
<var>
<video>
<wbr>
HTML <base> href 属性
实例
为页面上所有相对 URL 规定基准 URL:
<head>
<base href="http://www.runoob.com/images/">
</head>
<base href="http://www.runoob.com/images/">
</head>
浏览器支持
所有主流浏览器都支持 href 属性。
定义和用法
href 属性规定页面中所有相对链接的基准 URL。
语法
<base href="URL">
属性值
| 值 | 描述 |
|---|---|
| URL | 作为基准 URL 的绝对 URL(比如 "http://www.w3cschool.cc/")。 |