源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>编程字典</title> <base href="http://www.CodingDict.com/images/" target="_blank"> </head> <body> <img src="html5.gif"> <p>设置了base URL之后, 浏览器将在这个地址"http://www.CodingDict.com/images/html5.gif"找图片"html5.gif" </p> <p><a href="http://www.CodingDict.com" target="_blank">编程字典</a></p> <p>链接将在新窗口打开. 因为链接的target 设置为"_blank".</p> </body> </html>
运行结果