【问题标题】:margin incompatibility between firefox and chromeFirefox 和 chrome 之间的边距不兼容
【发布时间】:2014-12-19 02:01:40
【问题描述】:

我正在自定义一个名为 Canvas 的 wordpress 主题,但遇到了一些奇怪的问题。

Firefox 不接受这个 CSS 属性:

页眉{margin-top:-130px;}

它在 Chrome 上完美运行。

这是我网站的链接:http://creatyz.com/yogasalon/

谁能帮帮我?我尽我所能修复它。

提前非常感谢!

【问题讨论】:

    标签: css wordpress firefox cross-browser


    【解决方案1】:

    改变

    #header {
        padding: 40px 0px 45px;
        clear: both;
        position: relative;
        background-size: auto auto;
    }
    

    到

    #header {
        padding: 40px 0px 45px;
        position: relative;
        background-size: auto auto;
    }
    

    或者如果那是供应商 css

    添加

     #header {
         clear: none !important;
     }
    

    到你的 CSS

    (请注意 !important 仅用于测试,应替换为类似的内容)

    #wrapper #header 
    

    对于选择器

    【讨论】:

    • 添加 clear: none !important; 确实有效!非常感谢。
    【解决方案2】:

    听起来好像您正试图调整页面顶部的标题?如果那是您可以使用top:/*Your value*/;而不是否定的margin-top:/*your value*/;!

    【讨论】:

      【解决方案3】:

      试试

      .col-full { position: relative; }
      header { position: absolute; right: 1em; }
      

      如果可能,尽量不要使用负边距...

      ;]

      【讨论】:

        猜你喜欢
        • 2011-08-30
        • 1970-01-01
        • 2019-06-25
        • 1970-01-01
        • 1970-01-01
        • 2017-11-16
        • 1970-01-01
        • 1970-01-01
        • 2012-10-06
        相关资源
        最近更新 更多