<base> 标签为页面上的所有链接指定默认地址。
示例代码:
[Plain Text] 纯文本查看 复制代码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base href="http://img.d843.com/uploads/allimg/20130329/>
<base target="_blank" />
</head>
<body>
<img src="27-130329142146.jpg" />
<img src="27-130329142148.jpg" />
</body>
</html>
示例代码中,<img> 标签里指定的两张图片名称会和上面 <base> 标签指定的基地址组合成:
http://img.d843.com/uploads/allimg/20130329/27-130329142146.jpg
http://img.d843.com/uploads/allimg/20130329/27-130329142148.jpg
两个完整的地址,然后图片得以显示。 |