Need help with Order for display flex
Order is used to change to position of the child elements in a flex box. i tried the same but its not quite the same. there is a main div location-jokes container which has
display:flex
and flex-direction:column
properties . Now i wanted to reverse the order of childs so i used following order to change the position, the child position is changed but the grandchildren position is affected by this, how to fix it, so only child position is moved ? i have attached the code and ss for better understanding
https://codepen.io/avinash-tallapaneni/pen/ExRomwX![](https://utfs.io/f/94065f9f-4bcc-4088-a2dd-34331f201bae-1nq2cb.png)
![](https://utfs.io/f/df6dea86-1616-4aee-8d93-ad1e13d1f90e-1nq2cb.png)
3 Replies
if you look at the outline after order is applied grandchildrens are getting affected
It's affecting the grandchildren because your CSS tells it to. You're using the
Descendant combinator
selector:
Note the space (
) between the two identifiers. What you want is the Child combinator
:
Note the >
: that says "only direct children".
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors#combinatorsoh. it worked ![jollykevin](https://cdn.discordapp.com/emojis/1056236052970491945.png)
![jollykevin](https://cdn.discordapp.com/emojis/1056236052970491945.png)