W3School TIY
编辑您的代码:
<!DOCTYPE html> <html> <head> <style> a[target] { background-color:yellow; } </style> </head> <body> <p>带有 target 属性的链接会得到黄色背景:</p> <a href="../index.htm">jb51.net</a> <a href="http://www.disney.com/" target="_blank">disney.com</a> <a href="http://www.wikipedia.org/" target="_top">wikipedia.org</a> <p><b>注释:</b>对于 IE8 及更早版本的浏览器中的 [<i>attribute</i>],必须声明 <!DOCTYPE>。</p> </body> </html>
查看结果: