编辑你的代码:
<!DOCTYPE html> <html> <head> <base href="http://www.phpxuexi.net/static/images/" target="_blank"> </head> <body> <img src="stickman.gif" width="24" height="39"> - Notice that we have only specified a relative address for the image. Since we have specified a base URL in the head section, the browser will look for the image at "http://www.phpxuexi.net/static/images/stickman.gif" <br><br> <a href="http://www.phpxuexi.net">w3xuexi</a> - Notice that the link opens in a new window, even if it has no target="_blank" attribute. This is because the target attribute of the base element is set to "_blank". </body> </html>
查看结果:
phpxuexi.net
- 亲自试一试