Guides
Usage with HTML

Usage with HTML

Simple integration for static sites.

The easiest way to use Placehold is by embedding the API URL directly into your HTML `src` attributes.

Image Tag

<!-- Standard image -->
<img src="https://placehold.harshsandhu.com/api/img" alt="Placeholder" />

<!-- Custom dimensions and colors -->
<img src="https://placehold.harshsandhu.com/api/img?w=300&h=300&bg=333&fg=ccc" alt="Dark Mode Placeholder" />

Responsive Images (srcset)

<img 
  src="https://placehold.harshsandhu.com/api/img?w=400"
  srcset="https://placehold.harshsandhu.com/api/img?w=400 400w,
          https://placehold.harshsandhu.com/api/img?w=800 800w"
  sizes="(max-width: 600px) 400px, 800px"
  alt="Responsive Placeholder" 
/>