display: flex;
justify-content: center;
align-items: center:
}
what i want is set first child and last child of ul to left and right. other element center. how can i do that?
Try: ul li:first-child { justify-self: flex-start; } ul li:last-child { justify-self: flex-end; }
ul must have enough width too ig
The display: flex property on the parent element prevents justify-self from having an effect. Try setting the display: flex property on the parent to display: grid.
i set it to 100%
ul li:first-child { margin-right: auto; } ul li:last-child { margin-left: auto; }
thanks this work.
One way to do it by ul { display: flex; justify-content: space-between; align-items: center; } With following html <ul> <li>test</li> <li> <span>test</span> <span>test</span> </li> <li>test</li> </ul>
it has one probelem when i set it in mobile view. items between first and last child become flex-start.
items that is not first child and last child has set to be in center. so in desktop view is something like this: X—————-x-x-x-x———————-X but when i switch to mobile view: i want become like this: X——x -xxx——-X not this: X—-x xxxx——-X
this is my css. plus with your css
Wow uhh, that implies the content in centre is actually different from content on the sides; is that accurate?
what i want is i want all items excep first child and last child be in center.
I think @Harsh_br0's solution above will work better https://t.me/thedevs_design/104459
https://codepen.io/MKRhere/pen/mdvXoOJ
very very very very thanks.
is there any modern html 5 template that i can debug it and learn from it?
I used to inspect any website if it was interesting
that is good idea.
Обсуждают сегодня