Hotel/Accommodation Card

Display hotel, rental, or accommodation listings in an attractive and information-rich format with this specialized card.

This component is designed for travel and booking websites. It effectively balances a large hero image with vital booking information, including rating, location, key amenities, and nightly price.

Screenshot of a card for a hotel listing with a large photo and booking details.

Get Source Code Preview

About this Component

The hotel card is designed to provide users with all the main information they need to make a booking decision without feeling overwhelmed. It uses a clear visual hierarchy, grouping related information together. An interactive "wishlist" button is included for users who want to save a property for later consideration.

Features

Code Breakdown

HTML Structure

The card is built as an article. The top half is the image container, which holds both the main image and the wishlist button. The bottom half, the div with class .hotel-card-content, is a flex container for the textual details. Inside, the content is semantically structured with a header for the rating and location, a link-wrapped h3 for the hotel name, and a footer for the price and CTA button.

CSS Styling

The overall card is a flex container with flex-direction: column. Inside the content section, margin-top: auto is applied to the footer. This pushes the footer to the bottom of the available space, ensuring the price and "View Deal" button are always aligned horizontally across all cards in a grid, regardless of the amount of content above them. The wishlist button is positioned over the image using position: absolute, with its parent container set to position: relative.

Code

Here's the complete, self-contained code. It's ready to be populated with your property listings.

View Output