wordpress wp_head()函数使页面顶部总空白28px
<p><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>在wordpress主题中的header.php中,有一个wp_head()函数,表面上看不出什么玄机,只能在浏览器中查看源代码才能看出它所生成的如下代码: </span></p>
<div style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
<p style="margin: 0px; padding: 0px; outline: none; float: right; line-height: 25.2px; font-size: 14px;">
<span style="line-height: 25.2px; cursor: pointer;"><u>复制代码</u></span></p>
<p>
代码如下:</p>
</div>
<p style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
<br>
<style type=”text/css” media=”print”>#wpadminbar { display:none; }</style> <br>
<style type=”text/css”> <br>
html { margin-top: 28px !important; } <br>
* html body { margin-top: 28px !important; } <br>
</style> </p>
<p>
<br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>这样使页面顶部总空白28px ,虽然我已经在全局的css文件中设置*{margin:0px; padding:0px;}了,但还是无法解决!当然删除wp_head()后就好了,但是这个函数是系统函数,最好不要删。 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>最后在一个外国论坛找到解决方法:在主题中的footer.php中的</body>前加上<?php wp_footer();?>。</span></p>
頁:
[1]