Overview
The wedding website template uses a mobile-friendly navigation menu that toggles on smaller screens. The menu is consistently structured across all pages with smooth animations and responsive behavior.Basic Navigation Structure
The navigation is contained within the header and uses a special list structure:The
special class is required for the menu toggle functionality to work properly. The #menu div is hidden by default and revealed when the toggle is clicked.Menu Toggle Button
The menu toggle button is created with this structure:Desktop Behavior
On desktop screens, the menu is always visible and displayed horizontally in the header.
Mobile Behavior
On mobile screens, the menu is hidden behind a toggle button (typically a hamburger icon).
Header Variants
Landing Page Header (with 'alt' class)
Landing Page Header (with 'alt' class)
Used on the home page with a transparent background that becomes solid on scroll:The
alt class creates a transparent header that overlays the banner section.Inner Page Header (no 'alt' class)
Inner Page Header (no 'alt' class)
Used on all inner pages with a solid background:Note the relative path (
../) used to link back to the home page from subdirectory pages.Customizing Menu Items
Adding a New Menu Item
To add a new page to the menu, add a new<li> element inside the #menu div:
External Links
You can link to external sites by using full URLs:Anchor Links
To link to sections within the same page, use anchor links:JavaScript Functionality
The menu toggle functionality is handled by themain.js file. The script:
- Listens for clicks on elements with the
menuToggleclass - Toggles the
activeclass on the#menuelement - Toggles the
inactiveclass on the#page-wrapperfor overlay effect - Prevents body scrolling when menu is open
You don’t need to write any JavaScript for basic menu functionality - it’s all handled by the included
main.js file. Just ensure the HTML structure matches the expected format.Path Considerations
Notice the path differences:
- Home page uses
pages/schedule.html - Inner pages use
../index.htmlfor home andschedule.htmlfor sibling pages
Styling Considerations
Active Menu State
When the menu is toggled open, these classes are applied:#menugets theactiveclass#page-wrappergets theinactiveclassbodygets overflow hidden to prevent scrolling
Responsive Breakpoints
The menu automatically switches between desktop and mobile modes based on screen width. The breakpoint is defined inbreakpoints.js and applied through CSS.
Complete Example
Here’s a complete header with navigation for an inner page:Best Practices
Keep It Consistent
Use the exact same menu structure on every page. This ensures a consistent user experience.
Clear Labels
Use descriptive, concise labels for menu items. Avoid jargon or overly creative names.
Logical Order
Arrange menu items in a logical order, typically starting with Home and ending with FAQs or Contact.
Test Paths
Always test links from both the home page and inner pages to ensure paths are correct.
Next Steps
HTML Structure
Review the overall page structure
Event Cards
Create spotlight sections for events
Customization
Learn how to style the navigation
