Hi! My current pet project: Read-only 100% offline secure multi-user container in a single HTML file that requires no external software to extract secrets:
https://github.com/griffin-container/griffin
In .menu-main (the main items), the gap is using clamp, so it changes dynamically, depending on the viewport-width:
gap: clamp(0.5rem, -3.875rem + 14vw, 4rem);
You can adjust these, or make your own here, or simply enter a static value in a "mobile-only" media-query.
The gap between the CTA-items is using the same method, but with smaller values.
Desktop:
On the wrapper, the space between the logo, the main items and the CTA is spaced with justify-content: space-between, but you can add a gap-property, if you want.
Hi! My current pet project: Read-only 100% offline secure multi-user container in a single HTML file that requires no external software to extract secrets:
https://github.com/griffin-container/griffin
I’m a tech enthusiast who loves to learn and share about the latest trends and innovations in the tech world. I’m passionate about web development, cybersecurity, AI, and blockchain. I enjoy reading a
This is a very clever and elegant solution to create a responsive menu in CSS. I love how you have used the :hover and :focus-within pseudo-classes to toggle the menu visibility. I also appreciate how you have explained the code and provided a demo link. This is a very useful tip for web developers. Thank you for sharing!
Hi there, I'm a frontend engineer / developer relations - I code, I write documentation and I write tech blogs. Do you have something for me? Send me an email.
Emerging developer relation engineer
Great menu!
Is it possible to fix the effect of increasing the distance between items when you enlarge the window horizontally in mobile?
Yes! There are multiple gap's in use, though.
In
.menu-main(the main items), the gap is usingclamp, so it changes dynamically, depending on the viewport-width:gap: clamp(0.5rem, -3.875rem + 14vw, 4rem);You can adjust these, or make your own here, or simply enter a static value in a "mobile-only" media-query.
The gap between the CTA-items is using the same method, but with smaller values.
Desktop:
On the wrapper, the space between the logo, the main items and the CTA is spaced with
justify-content: space-between, but you can add agap-property, if you want.Thank you!
This is a very clever and elegant solution to create a responsive menu in CSS. I love how you have used the :hover and :focus-within pseudo-classes to toggle the menu visibility. I also appreciate how you have explained the code and provided a demo link. This is a very useful tip for web developers. Thank you for sharing!
Thank you!
Great post! Really useful!
Thanks!
This is super helpful, I’d like to try this out on my next project. Appreciate you sharing it.
Thank you!
Great content!
Thank you!