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