【发布时间】:2010-01-18 09:55:11
【问题描述】:
我有一个内容页面,其中包含指向不同文档的链接,例如 .doc、.docx、.ppt .pptx、.txt。
我想动态应用/添加类而不是手动。就像链接内容一样。
<h3><a href="document.pdf" class="pdf-file">Document.pdf</a></h3>
.pdf-file {
background:url(../images/pdf-file.png) right center no-repeat; padding-right:18px;
}
这是我申请的手动类。
jQuery 解决方案将是首选。
如果你喜欢我的问题喜欢它。 :) 谢谢
【问题讨论】:
标签: javascript jquery html css