zoukankan      html  css  js  c++  java
  • 黄聪:wordpress wp_head()函数 浏览器顶部 空白28px 解决办法(转)

    不知道大家是否遇到这样的情况,由于wp_head()生成的多余代码如下:

    <style type="text/css" media="print">#wpadminbar { display:none; }</style>
    <style type="text/css">
    html { margin-top: 28px !important; }
    * html body { margin-top: 28px !important; }
    </style>

    去掉方法和分析

    自己写主题的过程中发现在chrome 下wordpress头部总是有空白

    我已经*{margin:0;}了,不应该出这个问题啊。

    然后删除wp_head()后就好了,但是你懂的,这个函数最好是不删的。

    打开源代码,可以看到wp_head()在里面添加了

    <style type="text/css" media="screen">

         html {margin-top:28px !important}

         *html body{margin-top:28px ! important}

    </style>

    表面上原因是这个原因,但是。。解决办法并不是这个。

    真正的幕后黑手是没在</body>前加wp_footer().....

    在</body>前加上<?php wp_footer();?>,一切搞定!

  • 相关阅读:
    函数探幽--引用变量
    函数探幽—内联函数
    我遇到的头文件
    继承的特点
    汇编语言中压栈与入栈
    cin.good(),cin.fail(),cin.clear()
    结构体的处理(以c++primer plus 第六章习题4为例)
    uva508
    uva253 CubePainting
    uva1590
  • 原文地址:https://www.cnblogs.com/huangcong/p/2445023.html
Copyright © 2011-2022 走看看