【问题标题】:Table tr background image not work on webkit browserTable tr 背景图像在 webkit 浏览器上不起作用
【发布时间】:2012-03-01 22:52:10
【问题描述】:

tr 具有在所有浏览器中完美显示的背景图片,除了 webkit 浏览器
(谷歌浏览器和苹果 Safari)。背景图片从每个th重复。

table > tbody > tr.fieldheader {
    background:url(../images/main-sprite.png) no-repeat 0 0;
    height:37px;
    width:900px;
    background-position:left -1062px;
    border-radius:none;
}

【问题讨论】:

    标签: css webkit


    【解决方案1】:

    什么是“背景位置:左-1062px;”在那里做什么?您似乎混淆了 2 个不同的属性,这很可能会导致错误。

    另外,最好在 css 中为 URL 加上引号,因为有些浏览器没有引号会出现问题

    background:url("../images/main-sprite.png") no-repeat 0 0;
    

    【讨论】:

    • 我正在使用精灵图像,为此我正在使用背景位置 css,我更改了 css 并将普通图像放入 tr 但它仍然有同样的问题。
    • 我解决了这个问题。我从 tr 中删除背景图像并将其放入表格背景图像中,现在它工作正常。
    猜你喜欢
    • 1970-01-01
    • 2010-10-17
    • 1970-01-01
    • 2019-11-08
    • 1970-01-01
    • 2017-05-03
    • 1970-01-01
    • 1970-01-01
    • 2013-08-01
    相关资源
    最近更新 更多