I am facing a big problem in css flex direction coding.
I need first .column .left class in blue background and first .column .right class in red background. But second .column .left class in red background and second .column .right class in blue background.
Please check my codes.
<style>
.wrap {display:flex;}
.column {display:flex;flex-direction:row-reverse !important}
</style>
<div class="wrap">
<div class="column">
<div class="left">Blue Background</div>
<div class="right">Red Background</div>
</div>
<div class="column">
<div class="left">Red Background</div>
<div class="right">Blue Background</div>
</div>
</div>
2
Answers
After the edit in question and more context being provided, here is the updated code:
/* here is the code for the background updates*/
Update the flex-direction as per your required for the
.column-first-of-type
and.column-last-of-type
You can play around with
nth-child
even
/odd