cssgrid icon indicating copy to clipboard operation
cssgrid copied to clipboard

Changing the order of column layouts

Open KennethDanielsen opened this issue 12 years ago • 2 comments

Hi there, I was wondering if it's possible to change the order of columns somehow.

Say i have a .fourcol A and and a .eightcol B next to each other. On desktops I would like the order to be: A first (left) and B next (right).

On mobile though, I would like B to appear first and A next (so B on top, and A on the bottom). How do I accomplish this? I've tried compensating for the .last margin, by setting "margin-right: 0;" on B, and "margin-right: 3,8%;" on A. I've also tried floating B left and A right, changing vertical-align and other methods.

None of them seem to work - need help!

  • Kenneth

KennethDanielsen avatar Mar 03 '13 16:03 KennethDanielsen

Changing the order of the columns on mobile would require a re-working of the HTML/PHP structure - not CSS work.

You'd need to re-arrange the div containing the sidebar to above the content area. Then make the sidebar and content float accordingly for desktop.

brianpurkiss avatar Mar 04 '13 07:03 brianpurkiss

Place div.B as first, with float: right, set margins manually to it's ID; div.A place as second with float: left.

Few minutes and it will be working perfectly in pure css (as long as you rearrange 1 div).

ghost avatar Apr 05 '13 13:04 ghost