Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何在WordPress中设置页边距上限?_Html_Css_Wordpress_Wordpress Theming - Fatal编程技术网

Html 如何在WordPress中设置页边距上限?

Html 如何在WordPress中设置页边距上限?,html,css,wordpress,wordpress-theming,Html,Css,Wordpress,Wordpress Theming,我正在制作我的WP自定义主题的页脚。我有footer div(在其中放置组件)。我也有一个logo div(我的logo在哪里)。我需要从页脚div开始到logo div之间的12px距离 我用的是: <div class="footer"> <div class="footerlogo"> <img id="pic" src="<?php bloginfo('template_url') ?>/img/footer_logo.png">

我正在制作我的WP自定义主题的页脚。我有footer div(在其中放置组件)。我也有一个logo div(我的logo在哪里)。我需要从页脚div开始到logo div之间的12px距离

我用的是:

<div class="footer">
  <div class="footerlogo"> 
  <img id="pic" src="<?php bloginfo('template_url') ?>/img/footer_logo.png">
    </div> .......


.footerlogo{ margin-top:30px;}

/img/footer_logo.png“>
.......
.footerlogo{页边空白顶部:30px;}
它没有显示出任何差异。正确的做法是什么


您可以在页脚div上使用填充,例如:

.footer {
    padding-top: 12px;
}
这将在
.footer
.footerlogo
div元素之间添加空间


使用填充仍然不会改变。我在原始答案中添加了一个提琴,以更好地演示这一点。太好了!谢谢!