HTML-এ বিভিন্ন পরিস্থিতিতে ব্যবহার করার জন্য ছবির URL নির্দিষ্ট করতে srcset অ্যাট্রিবিউট ব্যবহার করা হয়।
উদাহরণ
নিচের কোডটি চালিয়ে srcset অ্যাট্রিবিউটের ব্যবহার দেখতে পারেন। ব্রাউজার রিসাইজ করে ভিন্ন ছবি লোড হওয়া দেখুন:
<!DOCTYPE html> <html> <head> <meta name = "viewport" content="width=device-width, initial-scale = 1.0"> </head> <body> <picture> <source media = "(min-width: 550px)" srcset = "https://www.tutorialspoint.com/assets/videotutorials/courses/3d_animation_online_training/380_course_211_image.jpg"> <source media = "(min-width: 400px)" srcset = "https://www.tutorialspoint.com/assets/videotutorials/courses/html_online_training/380_course_216_image.jpg"> <img src = "https://www.tutorialspoint.com/videotutorials/images/tutorial_library_home.jpg" alt = "Tutorials Library" style = "width:auto;"> </picture> </body> </html>