无法在<li>内显示图标图片

时间:2015-08-28 07:53:11

标签: html css

问题:
我无法显示位于<li>

内的图标

我错过了什么?

谢谢!

&#13;
&#13;
LI.filtered A {
  position: relative;
  padding: 1px 20px 1px 4px;
  background: #F0F0FF url("https://cdn0.iconfinder.com/data/icons/gcons-2/24/laptop1-16.png") no-repeat scroll right -52px;
  font-weight: 400;
  color: #FFF;
}
#result-filters UL {
  display: inline;
  list-style: outside none none;
  margin: 0px;
  padding: 0px;
            font-size: 12px;
            font-family: arial,helvetica,sans-serif;    
}
#body-right UL,
#body-right OL {
  margin: 10px 0px 0px;
}
.leftmenu LI.filtered,
#result-filters LI.filtered {
  padding-left: 0px;
  background: transparent none repeat scroll 0% 0%;
}
#result-filters UL LI {
  margin: 0px 8px 0px 0px;
  float: left;
}
&#13;
<div id="result-filters">

  <ul>
    <li class="filtered">
      <a href="">
				Test1               
			</a>
    </li>
    <li class="filtered">
      <a href="">
				Test2            
			</a>
    </li>
    <li class="filtered">
      <a href="">
				Test2                
			</a> 
    </li>
    <li class="filtered">
      <a href="">
				Test2               
			</a> 
    </li>
    <li class="filtered">
      <a href="">
				Test2               
			</a>
    </li>
  </ul>

</div>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:2)

这是因为背景位置-52px

将其设为0

OR

删除它

li.filtered a {
  position: relative;
  padding: 1px 20px 1px 4px;
  background: #08C url("https://cdn0.iconfinder.com/data/icons/gcons-2/24/laptop1-16.png") no-repeat scroll right;
  font-weight: 400;
  color: #FFF;
}
#result-filters ul{
  display: inline;
  list-style: outside none none;
  margin: 0px;
  padding: 0px;
            font-size: 12px;
            font-family: arial,helvetica,sans-serif;    
}
#body-right ul,
#body-right ol{
  margin: 10px 0px 0px;
}
.leftmenu li.filtered,
#result-filters LI.filtered {
  padding-left: 0px;
  background: transparent none repeat scroll 0% 0%;
}
#result-filters ul li{
  margin: 0px 8px 0px 0px;
  float: left;
}
<div id="result-filters">

  <ul>
    <li class="filtered">
      <a href="">
                Test1               
            </a>
    </li>
    <li class="filtered">
      <a href="">
                Test2            
            </a>
    </li>
    <li class="filtered">
      <a href="">
                Test2                
            </a> 
    </li>
    <li class="filtered">
      <a href="">
                Test2               
            </a> 
    </li>
    <li class="filtered">
      <a href="">
                Test2               
            </a>
    </li>
  </ul>

</div>