我有两个<span>元素:
<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>我希望第一个<span>在页面的左边,第二个<span>在右边,不管页面宽度如何(所以我不能使用固定位置)。
我可以使用什么CSS来做这件事?
发布于 2012-02-16 08:53:40
css变量float用于定位元素。
选项包括:
float:left;
float:right;
float:none;<span style="float:left;">©2012 XYZ Corp. All Rights Reserved.</span>
<span style="float:right;">Built with <a 以下是工作示例:
<span style="float:left; color: red;">©2012 XYZ Corp. All Rights Reserved.</span>
<span style="float:right; color: blue;">Built for example</span>
https://stackoverflow.com/questions/9303976
复制相似问题