2007年1月14日 星期日

用CSS為link加上icon

Showing Hyperlink Cues with CSS (Ask the CSS Guy)
http://www.askthecssguy.com/2006/12/showing_hyperlink_cues_with_cs_1.html

Attach icons to anything with CSS
http://www.hunlock.com/blogs/Attach_icons_to_anything_with_CSS

以下是CSS語法:
a[href $=\'.pdf\'] {
padding-right: 18px;
background: transparent url(icon_pdf.gif) no-repeat center right;
}
a[href ^=\"mailto:\"] {
padding-right: 20px;
background: transparent url(icon_mail.gif) no-repeat center right;
}
a[class =\"popup\"] {
padding-right: 18px;
background: transparent url(icon_popup.gif) no-repeat center right;
}
a[class ~=\"popup\"] {
padding-right: 18px;
background: transparent url(icon_popup.gif) no-repeat center right;
}

沒有留言: