using background image for li

前端 未结 6 2458
执笔经年
执笔经年 2021-02-20 03:31

I\'m using a background image for a

  • that will be used as a button, but it\'s not fully shown; however, when write text then it shows. I don\'t want text
  • 相关标签:
    6条回答
    • 2021-02-20 04:08

      Take a look at the following example:

         ul#footernav li { 
              display:inline; 
              }
          ul#footernav li a{ 
              display:block; 
              width:155px;
              text-indent:-9999px;
              }
          ul#footernav li.footerlocation a{ 
              height:30px ; 
              background: url('images/image.jpg') bottom left no-repeat; 
              }
          ul#footernav li.footerlocation a:hover{ 
              height:30px ; 
              background: url(images/image.jpg) top left no-repeat; 
              }
      
      0 讨论(0)
    • 2021-02-20 04:09

      May be help in this

      .tab-content ul li{display: block;padding-left: 30px;background-image:url('images/blue-icon.png');background-repeat: no-repeat;background-position: 0 2px;margin-bottom: 10px;}
      
      0 讨论(0)
    • 2021-02-20 04:23

      We can simply add the following css rule:

      ul.check-list{  
          list-style-image: url(images/tick.jpg);
      }
      
      0 讨论(0)
    • 2021-02-20 04:24

      Your problem is in setting display to inline. If you want background and width, but you also need an inline-type list, set float: left.

      0 讨论(0)
    • 2021-02-20 04:30

      Yes i have the same problem, i just removed css style display: inline and add display: list-item; float:left; my problem solved, hope this helps.

      Thanks, Sankar B

      0 讨论(0)
    • 2021-02-20 04:31

      set the width and height for the image

      0 讨论(0)
    提交回复
    热议问题