Css 浮动和居中的Wordpress页面内容
所以 我在尝试将一系列浮动元素置于页面中心时遇到问题。我正在处理一个页面,它在顶部使用了一些浮动元素:一个页面标题,然后是一个图像,然后是页面标题中的另一个单词,所有这些元素都是按顺序浮动的 为了实现这一点,我使用了:Css 浮动和居中的Wordpress页面内容,css,wordpress,css-float,center,margin,Css,Wordpress,Css Float,Center,Margin,所以 我在尝试将一系列浮动元素置于页面中心时遇到问题。我正在处理一个页面,它在顶部使用了一些浮动元素:一个页面标题,然后是一个图像,然后是页面标题中的另一个单词,所有这些元素都是按顺序浮动的 为了实现这一点,我使用了: <div class="bodyheaddiv"><p class="bodyheadtext">Contact Us</p><img class="bodyhead" src="http://lrgi.org/wp-conten
<div class="bodyheaddiv"><p class="bodyheadtext">Contact Us</p><img class="bodyhead" src="http://lrgi.org/wp-content/uploads/2012/10/Contact_icon_1.png" alt="" /><p class="bodyheadtext">Contáctenos</p></div>
目前的结果是:
其中页面标题和图像未在其列中居中。然而,我试图实现的是:
如果您能帮助您确定如何将这些元素放在页面的中心位置,我们将不胜感激
-玛卡这是你的答案
<div class="bodyheaddiv">
<table align="center">
<tr>
<td>
<p class="bodyheadtext">Contact Us</p></td>
<td><img class="bodyhead" src="http://lrgi.org/wp-content/uploads/2012/10/Contact_icon_1.png" alt="" /></td>
<td><p class="bodyheadtext">Contáctenos</p></td>
</tr>
</table>
</div>
联系我们
续
这应该可以为您做到:
<div>
<p><span>Contact Us</span><span>Contáctenos</span></p>
</div>
HTML非常混乱。。。bodyheaddiv是一个容器,也是一个标题。。。你应该有一个容器,然后在一个页眉,三列,一个页脚等里面。。。然后可以设置文本对齐:居中;我建议您在代码中发布一个JSFIDLE。这不是表格数据,所以不应该使用
只是提供了一个替代方案
<div>
<p><span>Contact Us</span><span>Contáctenos</span></p>
</div>
div {
height: 70px;
width: 500px;
0 auto;
background-image: url('http://lrgi.org/wp-content/uploads/2012/10/Contact_icon_1.png');
background-position: top center;
background-repeat: no-repeat;
}
div p {
text-align: center;
height: 70px;
line-height: 70px;
}
div p span {
margin: 0 60px;
}