My problem is this: I feel this margin solution is a somewhat inelegant and convoluted one. It requires calculating the difference between the two divs which, although easy, would become a nuisance if I were to do a lot of projects that have this “floating right aligned div” feature in them.
So what I was wondering is, is there an alternative way to do this?
Position: absolute plus bottom: 0 doesn’t work because absolute positioning seems to override “float right”
Put your three divs inside another div that is the same height as the smaller divs and three times the width of the sum of the smaller divs. Then position the outer div to be at the bottom right corner of its parent. Float the smaller divs to the right and use a left margin to separate them. here is the code.
Position absolute removes the element from the flow so it can no longer be floated and therefore float is redundant and has no effect. You could simply have said bottom:0; right:0 to achieve what you want for a single element.
If you want two or three divs at the bottom then you could absolutely place all of them there or more easily do what Allan P suggests and just place the wrapper at the bottom and the float right (although you will need to add more width that Allan did for the container so that it is wide enough for the three elements plus margins.)
You should be aware that with either method you are still removing the elements from the flow so you will no longer have text that will wrap around those objects as such (unless they are in the absolute container with the floated divs and then will only respect that context).