【突出显示链接】突出显示不同类型的链接
◇组件名称:
突出显示不同类型的链接
◇功能描述:
不同类型的链接,将会显示不同的图片。
◇代码展示
1.为外部样式添加链接
a[href^="http:"] {
background: url(img/externalLink.gif) no-repeat right top;
padding-right: 10px;
}
a[href^="http://www.xxx.com"], a[href^="http://xxx2.com"] {
background-image: none;
padding-right: 0;
}
第一条为所有链接添加图标,第二条为内部站点取出图标。
2.特殊链接加图标
a[href^="mailto:"] {
background: url(img/email.png) no-repeat right top;
padding-right: 15px;
}
a[href^="aim:"] {
background: url(img/im.png) no-repeat right top;
padding-right: 15px;
}
3.为不同文件添加图标
a[href$=".pdf"] {
background: url(img/pdfLink.gif) no-repeat right top;
padding-right: 15px;
}
a[href$=".doc"] {
background: url(img/wordLink.gif) no-repeat right top;
padding-right: 15px;
}