Background image not showing up in span tag

前端 未结 5 625
礼貌的吻别
礼貌的吻别 2021-02-06 21:36

Im having trouble with a span tag showing a background image in the latest FF on windows 7. It seems to work and show everything fine in earlier FF, Chrome, Safari and IE but ha

5条回答
  •  难免孤独
    2021-02-06 22:41

    The background-image CSS property only puts an image as the background. The width and height of an object is always defined either by static settings via CSS/inline styling, or by the actual size of the content displayed in it. In your case, since you haven't added any content between your tags, its x/y dimensions will be 0, but there is no bug with the background. It's there, only you can't see it unless you define (somehow) a size for the element.

    Design Viz
    .design  {
    padding-left:25px;
    background:url(_includes/images/agenda-design.gif) no-repeat top left;
    display: inline-block;
    height: 17px;
    width: 50px;
    }
    

    Where 50 can be any helpful value suited for your case.

提交回复
热议问题