Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Cards/TravelStoryCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const TravelStoryCard = ({
>
<img
src={imgUrl}
alt={title}
alt={`Travel story image: ${title}`}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While adding more context to alt text is a good goal, prefixes like "Image of" or, in this case, "Travel story image:" are generally discouraged as per accessibility best practices. Screen readers already announce that the element is an image, so this can lead to redundant announcements (e.g., "Image, Travel story image: [title]"). Using just the title is more concise and provides a better user experience, assuming the title itself is descriptive.

Suggested change
alt={`Travel story image: ${title}`}
alt={title}

className='w-full h-full object-cover transition-transform duration-300'
onClick={onClick}
loading="lazy"
Expand Down
2 changes: 1 addition & 1 deletion src/pages/hero/Hero.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const Hero = () => {
<img
className="w-auto h-12 cursor-pointer"
src={logo}
alt="logo"
alt="TravelBook logo"
onClick={() => navigate("/")}
/>
</Link>
Expand Down