One extra div in the mix?
If you can edit your CMS template, wrap them in one additional div and put the div there: http://jsbin.com/esoqe
div.els { float:right }
<div class="main">
<div class="els">
<a>A</a>
<a>B</a>
</div>
</div>
JQuery fixes everything
If you cannot make minor changes to the code, you can reorder them using Javascript after the page has finished loading.
$(function(){
$("div.main").wrapInner("<div class='els'></div>");
});
Absolute Positions - Yuck.
( , ) - div, relative *. .css , .
* , , , , .