您的位置:首页 > Web前端 > HTML

html标签 base

2014-03-18 19:22 218 查看
<base href="<%=basePath%>">

<base href="http://www.baidu.com" >

这个base 的意思是:经过该页面跳转的页面路径前面都会加上这个base 的路径。

例如:

简单例子:

<html>

<head>

<base href="http://www.baidu.com" target="_blank">

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>base标记</title>

<link rel="Shortcut Icon" href="ani.CUR">

</head>

<body>

<a href="77.htm" target="_self">77</a>

<a href="88.htm">88</a>

</body>

</html>

当点了链接后,跳出的文件是http://www.baidu.com/77.htmhttp://www.baidu.com/88.htm,它就是在这些相对路径的文件前加上基链接指向的地址。如果目标文件中的链接没有指定target属性,就用base标记中的target属性。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: