如何将背景添加到锚标记?

时间:2014-03-27 12:35:14

标签: html css background

我需要创建一个锚标记,其中显示“RSS”,并且该文本旁边应该有一个图标(左侧),作为CSS中的背景添加。图标为png,32x32px。

HTML:

<a href="" class="rss-icon">RSS</a>

CSS:

   .rss-icon{ 
    padding-left: 40px; 
    line-height: 32px; 
    background: url(rss.png) left;  
    }

但这不适合我。我做错了吗?

1 个答案:

答案 0 :(得分:0)

.rss-icon{ 
    padding-left: 40px; 
    line-height: 32px; 
    background-color:#cccccc;  
    }

正常工作..可能是pic的URL不同。