I can't set the width and height of an image using unsplash
P粉520204081
P粉520204081 2023-09-15 19:40:40
0
1
472

This is the html code... enter image description here

I tried changing the width multiple times...restarted VS-code multiple times and I still can't change the width. Every time the page is refreshed it gives a random size

P粉520204081
P粉520204081

reply all(1)
P粉445714413

The link you used for the image source says it all.

<img src="https://source.unsplash.com/random/300x300" alt=""/>
  • Containing "random" in the URL means that the image will be served randomly
  • 300x300 refers to the image width and height

If you want images with different widths and heights, change these values ​​in the URL. For example: If you wanted an image with a width of 900 pixels and a height of 600 pixels, the url would be:

<img src="https://source.unsplash.com/random/900x600" alt=""/>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!