ToolypetMCP
intermediate4 minutescss

Responsive Navigation Bar

Build a responsive nav bar with flexbox layout, smooth transitions, shadow, and mobile hamburger animation.

navigationresponsiveflexboxanimationmobile

इस रेसिपी का उपयोग कब करें

Every website needs a navigation bar. This recipe creates a professional nav that works on desktop and mobile with smooth animations and proper responsive behavior.

चरण

1

Layout the nav structure

प्रॉम्प्ट:Generate flexbox CSS for a nav bar: row direction, space-between, center aligned items
2

Add scroll shadow indicator

प्रॉम्प्ट:Generate a bottom edge shadow for sticky nav: 0 2px 10px rgba(0,0,0,0.08)
3

Smooth hover transitions

प्रॉम्प्ट:Generate a smooth cubic-bezier for 300ms nav link hover underline transition
4

Hamburger menu animation

प्रॉम्प्ट:Generate hamburger-to-X animation: rotate lines 45deg and -45deg with middle line fade out over 300ms

अक्सर पूछे जाने वाले प्रश्न

Sticky vs fixed navigation?

Sticky (position: sticky) is preferred. It stays in flow until scroll point, then sticks. Fixed (position: fixed) is always on top and takes space from layout, requiring padding workarounds.

Should mobile nav use a hamburger menu?

For 5+ nav items, yes. For 3-4 items, a bottom tab bar (like mobile apps) may be more usable. Test with your users — hamburger menus hide navigation and can reduce discoverability.

संबंधित रेसिपी