You could use a float and apply it to the group div. .g-2 is specific for group 2 for example. Just replace the number with your group ID.
Some themes have an align option built in, commonly simply as alignleft and alignright. You could add your .g-5 to that as well, or use the same code.
It would make sense to have the CSS only be applied on Desktops and perhaps Tablets.
But not on smartphones.