使用li的背景图象 [英] using background image for li

查看:133
本文介绍了使用li的背景图象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的背景图片为< li> ,将用作按钮,但未完​​全显示;然而,当写文本时,它显示。
我不想写文本,它已经打印在背景图像上。我无法设置宽度 - 如何解决此问题?

I'm using a background image for a <li> 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 to be written it's already printed on background image. I am unable to set a width - how can I fix this?

#footernav li#footerlocation
{
    display: inline;
    padding-right: 20px;
    background-image: url(../images/ourlocation.jpg);
    background-repeat: no-repeat;
    background-position: 0 -.2em;
}


推荐答案

到内联。如果你想要背景和宽度,但你还需要一个内联类型列表,请设置float:left。

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.

这篇关于使用li的背景图象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆