A complete restaurant landing page built with Tailwind CSS: a full-bleed hero photo with opening hours, a grid of menu highlight cards with real food photos and prices, a reservation form with a guest stepper, and an address footer.
How it works
Everything lives inside the root .rst-page. The header is positioned over the hero; its links are hidden below the md breakpoint, but "Book a table" stays visible. The hero is a min-h-[640px] section whose photo is an absolutely positioned <img> with object-cover, covered by .rst-hero-shade.
The menu section is a list of .rst-dish cards in a responsive grid (one, two and then four columns). Each card shows a photo, a colored label such as "Vegetarian" or "Chef's pick", the dish name, price and a short description. Hovering or focusing inside a card scales .rst-dish-img.
The reservation block pairs an interior photo (from lg up) with the .rst-form. On DOMContentLoaded the script sets the min of the .rst-date input to today and fills in tomorrow, wires the [data-rst-step] buttons that change the number in the .rst-guests output, and handles submit: it validates the name and date, shows a loading label on .rst-submit, then after a short timeout writes a confirmation into .rst-status. To send real bookings, replace the setTimeout in script.js with a fetch() call to your booking endpoint.
Customization
data-rst-minanddata-rst-maxon.rst-guests: change the allowed party size; the stepper buttons disable themselves at the limits.- The
<option>list in#rst-time: set your own seating times; theselectedoption is the default. amber-400,amber-300andamber-50utilities: swapamberfororangeorlimeto retheme buttons, eyebrows and headings..rst-hero-shadeinstyle.css: gradient alpha values darken or brighten the hero.sm:grid-cols-2 lg:grid-cols-4on the dish list: uselg:grid-cols-3and remove one.rst-dishfor a three-column menu.transform: scale(1.06)instyle.css: adjust or remove the photo zoom on hover.min-h-[640px]on the hero section: hero height.
Use cases
- Restaurants and cafes: a full-bleed food photo hero
- Menu pages: dish cards with prices
- Reservations: a table request form
- Food trucks and bistros: a dark evening look
Accessibility
Landmarks are explicit: a labelled nav, sections connected to their headings with aria-labelledby, and an address in the footer. All photos have descriptive alt text, width and height; only the hero image loads eagerly. Every form field has a visible label, the stepper is a role="group" with labelled minus and plus buttons, and the guest count and form messages use aria-live="polite". Invalid fields get aria-invalid="true" and receive focus. Links and buttons show amber focus outlines, and the zoom effect is disabled under prefers-reduced-motion: reduce.
Usage notes
Replace the Unsplash placeholder photos with your own. Use it once per page, since the id values are unique. The footer credit links to WebDevSnippets; you can keep it or remove it.