Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reverse <ul> ordering using CSS 2.1

Tags:

html

css

I’m attempting to reverse the order of an unordered list using only CSS 2.1

The desired ordering is: Introduction – History – National Flags – Maritime signal flags

I have previously solved this using CSS rotations however this will not longer be CSS 2.1 compatible.

Thanks, Frank

like image 207
FrankHults Avatar asked Mar 18 '26 15:03

FrankHults


1 Answers

A neat trick is to set the parent ul to a flex box and then use the property flex-direction: column-reverse;

ul{
  display:flex;
  flex-direction: column-reverse;
}
like image 148
Wowsk Avatar answered Mar 20 '26 09:03

Wowsk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!