【问题标题】:Where is this top margin coming from on my Wordpress website我的 Wordpress 网站上的最高边距来自哪里
【发布时间】:2014-10-05 23:30:42
【问题描述】:

所以我使用的是我自定义的二十一十二主题。我需要删除标题菜单上方的上边距。看这里http://blog.littlenomads.com/

在我的子样式表中我添加了:

    .site-header {
    padding: 0px 0 !important;
    margin: 0px 0 !important;
}
/* remove site margin */
body .site{margin:0 !important;max-width: 100% !important;}

.site-content {
margin-top: 0px;
}

我在这里找到了解决方案:https://wordpress.stackexchange.com/questions/85414/twenty-twelve-theme-remove-margins

我也在主题二十十二样式表中完全注释掉了:

    /* Minimum width of 960 pixels. */
@media screen and (min-width: 960px) {
    body {
        background-color: #e6e6e6;
    }
    /*Brian Ogden 8-12-2014*/
    /*body .site {
        padding: 0 40px;
        padding: 0 2.857142857rem;
        margin-top: 48px;
        margin-top: 3.428571429rem;
        margin-bottom: 48px;
        margin-bottom: 3.428571429rem;
        box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3);
    }*/
    body.custom-background-empty {
        background-color: #fff;
    }
    body.custom-background-empty .site,
    body.custom-background-white .site {
        padding: 0;
        margin-top: 0;
        margin-bottom: 0;
        box-shadow: none;
    }
}



  * Minimum width of 600 pixels. */
@media screen and (min-width: 600px) {
    .author-avatar {
        float: left;
        margin-top: 8px;
        margin-top: 0.571428571rem;
    }
    .author-description {
        float: right;
        width: 80%;
    }

    /*.site {
        margin: 0 auto;
        max-width: 960px;
        max-width: 68.571428571rem;
        overflow: hidden;
    }*/

我也尝试过这里找到的解决方案:http://wordpress.org/support/topic/removing-page-title-and-white-space-from-twenty-twelve-theme

【问题讨论】:

  • 就是这样,为什么会在顶部显示边距而不是wp-admin标题栏?
  • 您可以在functions.php 中设置它以隐藏它,或者可能是主题上的一个选项?

标签: php html css wordpress


【解决方案1】:

我猜你已经登录到你的网站,这是 wp-admin 栏将 html/body (html { margin-top: 32px !important; } etc .. ) 向下移动的 !important 样式当你登录时被喂到头上?

【讨论】:

  • 你是对的,你知道登录时如何关闭它吗?
猜你喜欢
  • 2013-04-25
  • 2012-07-13
  • 1970-01-01
  • 2017-08-18
  • 2010-12-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-12-01
相关资源
最近更新 更多