最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How can I get multiple random images from unsplash to appear on my site? - Stack Overflow

programmeradmin0浏览0评论

I am currently working on a react page that uses a collection of images from unsplash. I've used an <img src="/?Cryptocurrency/" alt="crypto"/> tag to display the images for each content on the page. however, it displays the same image for each piece of content. I've tried looking at the documentation on the unsplash website but I'm unable to fix the problem. Any advice on where to start would be greatly appreciated.

I am currently working on a react page that uses a collection of images from unsplash. I've used an <img src="https://source.unsplash.com/random/?Cryptocurrency/" alt="crypto"/> tag to display the images for each content on the page. however, it displays the same image for each piece of content. I've tried looking at the documentation on the unsplash website but I'm unable to fix the problem. Any advice on where to start would be greatly appreciated.

Share Improve this question edited Mar 30, 2022 at 19:59 jdunning 1,7361 gold badge22 silver badges29 bronze badges asked Mar 30, 2022 at 19:19 Dev GuyDev Guy 131 gold badge1 silver badge4 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 15
<img alt="crypto" src="https://source.unsplash.com/random/?Cryptocurrency&1">
<img alt="crypto" src="https://source.unsplash.com/random/?Cryptocurrency&2">

Add some random different parameter to every image as shown in my example and it works.

发布评论

评论列表(0)

  1. 暂无评论