©2012 X...">

How to align two span elements, one to the left and the other to the right?

I have two <span> elements:

 <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> 

I want the first <span> be on the left of the page, and the second <span> be on the right, regardless of the width of the page (so I can not use fixed positioning).

What CSS can I use for this?

+6
html css
source share
1 answer


The css float variable is used to place your elements.

Possible options:

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

 <span style="float:left;">©2012 XYZ Corp. All Rights Reserved.</span> <span style="float:right;">Built with <a href="http://www.wordpress.org/">Wordpress</a> and hosted by <a href="http://www.mediatemple.net/">(mt)</a> in California.</span> 
+21
source share

Source: https://habr.com/ru/post/908571/


All Articles