【问题标题】:CSS missing in Firefox but not ChromeFirefox 中缺少 CSS,但 Chrome 中没有
【发布时间】:2013-01-23 13:59:59
【问题描述】:

这块 CSS 有问题:

#social-title
{
    float: left;
    position: absolute;
    top: 270 px;
    left: 575px;
    text-decoration: underline;
}

当它在 Firefox 中呈现时,div 位于页面顶部。当我在 Chrome 中渲染它时,它应该在哪里。但是,当我用 Firebug 看这个时,“top: 270px;” Firefox 中缺少该行,但 Chrome 中没有。知道为什么吗?

【问题讨论】:

    标签: css google-chrome firefox


    【解决方案1】:

    删除空间 你正在使用top: 270 px;

    请使用

    top: 270px;
    

    【讨论】:

    • 这个是对的。在 CSS 中,单位必须紧跟在值之后(没有空格或其他符号:50%、12pt、1s)。您的 CSS 无效,Chrome 会“原谅”它,但 Firefox 不会。您可以使用CSS Validator 轻松捕获此类错误。
    • @MichaelMahony 如果这个回答你的问题,接受它 - 左边有一个勾号。
    猜你喜欢
    • 2015-09-14
    • 1970-01-01
    • 2013-11-02
    • 2014-03-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-05
    • 2011-12-09
    相关资源
    最近更新 更多