6/12/2023 0 Comments Display flex align items![]() ![]() One way to overcome this issue is to take advantage of a new CSS keyword which we can use when we align items: safe. ![]() Test the demo to see yourself add 20 or so items to the menu: ![]() If we add enough items to make the scrollbar appear, we’ll notice that the top ones are being cut off-they disappear completely and we can’t reach them by scrolling. Flexbox makes it really easy: to align the items in the middle of the page we’ll use justify-content: center and align-items: center. To answer a classic layout question, we’re going to use flexbox to center the menu vertically and horizontally. menu-wrapper element will be hidden and receive display: flex as soon as we click the toggle button. ![]()
0 Comments
Leave a Reply. |