源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>编程字典</title> <style> a[target=_blank] { background-color: yellow; } </style> </head> <body> <p>链接是target="_blank" 的 设置为黄色背景:</p> <a href="#">编程字典</a> <a href="#" target="_blank">百度</a> <a href="#" target="_top">阿里</a> <p><b>注意:</b> 要想 [<i>attribute</i>] 在 IE8 和更早的版本工作, 必须声明DOCTYPE.</p> </body> </html>
运行结果