Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.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 如何对齐两个跨度图元,一个向左,另一个向右?_Html_Css - Fatal编程技术网

Html 如何对齐两个跨度图元,一个向左,另一个向右?

Html 如何对齐两个跨度图元,一个向左,另一个向右?,html,css,Html,Css,我有两个元素: <span style="margin-right:auto;">©2012 XYZ Corp. All Rights Reserved.</span> <span style="margin-left:auto;">Built with <a href="http://www.wordpress.org/">Wordpress</a> and hosted by <a href="http://www.media

我有两个
元素:

<span style="margin-right:auto;">©2012 XYZ Corp. All Rights Reserved.</span>
<span style="margin-left:auto;">Built with <a href="http://www.wordpress.org/">Wordpress</a> and hosted by <a href="http://www.mediatemple.net/">(mt)</a> in California.</span>
©2012 XYZ公司。保留所有权利。
由加利福尼亚州的。
我希望第一个
位于页面左侧,第二个
位于页面右侧,无论页面宽度如何(因此我无法使用固定定位)


我可以使用什么CSS来执行此操作?

CSS变量
float
用于定位元素

这些选择包括:

float:left;
float:right;
float:none;

©2012 XYZ公司。保留所有权利。

但是,使用浮点数构建的容器不会增加容器高度,因此它会增加所有的容器高度collapses@Triynko对的当您在容器(父元素)中浮动元素时,容器将折叠,因此您有两个选项。谷歌“清除修复”或只是简单地应用
overflow:hidden
到不起作用的上述容器我有一个
footer
和一个
a
在div内是一对
p
a
内是
span
<span style="float:left;">©2012 XYZ Corp. All Rights Reserved.</span>

<span style="float:right;">Built with <a