• 0 Posts
  • 3 Comments
Joined 1 year ago
cake
Cake day: June 13th, 2023

help-circle


  • I’m not entirely sure what behavior you’re trying to achieve with the hard-coded heights. Can you describe how you want the menu to behave? I do think it’s very doable in pure CSS without any magic numbers.

    If your goal is just to make sure the menu creates the right number of “columns”, you should try using display:grid instead of flex. It gives you much more control over that kind of layout, and you can set it up to automatically fill the available area with columns of constrained width. You can then also have items populate vertically instead of horizontally (grid-auto-flow:column).

    Other stuff that seems weird to me - why set the height to 10,000px? Also, if the menu links just take you to anchors lower down on the page, consider using the :target pseudo-class so that only the selected one is shown, the rest can be display:none.