HTML Images ও Multimedia

লেসন ১১ / ৪৪

Image (ছবি)

<img src="photo.jpg" alt="বর্ণনা">

<!-- সব attribute -->
<img src="photo.jpg"
     alt="সূর্যাস্তের দৃশ্য"
     width="600"
     height="400"
     loading="lazy"
     title="hover tooltip">
💡 alt সবসময় দিন — স্ক্রিন রিডার, SEO ও ছবি লোড না হলে দেখাবে।

Responsive Image

<img src="small.jpg"
     srcset="medium.jpg 800w, large.jpg 1600w"
     sizes="(max-width: 600px) 100vw, 50vw"
     alt="...">

<!-- picture tag (art direction) -->
<picture>
    <source srcset="mobile.jpg" media="(max-width: 600px)">
    <source srcset="desktop.jpg" media="(min-width: 601px)">
    <img src="fallback.jpg" alt="...">
</picture>

Video

<video width="640" controls autoplay muted loop>
    <source src="video.mp4" type="video/mp4">
    <source src="video.webm" type="video/webm">
    আপনার ব্রাউজার ভিডিও সাপোর্ট করে না।
</video>

Audio

<audio controls>
    <source src="song.mp3" type="audio/mpeg">
    <source src="song.ogg" type="audio/ogg">
</audio>

iframe (বাইরের পেজ embed)

<!-- YouTube -->
<iframe width="560" height="315"
    src="https://www.youtube.com/embed/VIDEO_ID"
    frameborder="0"
    allow="autoplay; encrypted-media"
    allowfullscreen></iframe>

<!-- Google Maps -->
<iframe src="https://www.google.com/maps/embed?..."></iframe>

figure ও figcaption

<figure>
    <img src="chart.png" alt="বিক্রয়ের চার্ট">
    <figcaption>চিত্র ১: ২০২৪ সালের বিক্রয় পরিসংখ্যান</figcaption>
</figure>