Help me make the images smaller[answered] | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Help me make the images smaller[answered]

Hello sololearners, How can I make the images smaller? As you can see,it's too big,for example the img of Ronaldo's signature. https://code.sololearn.com/WqQ3CfBP7270/?ref=app

29th Jul 2023, 10:09 AM
Faraz Haghbayan
Faraz Haghbayan - avatar
8 Respostas
+ 1
Faraz Haghbayan probably beyond your original question on making images smaller, but you can provide various img sources for a responsive image design. https://web.dev/learn/design/responsive-images/
30th Jul 2023, 2:38 AM
Bob_Li
Bob_Li - avatar
+ 2
Yes, an image editor like Photoshop, Gimp or whatever. You can also choose a suitable image format for optimal display and file size. Imagine if you're only going to display a small image. You can force a big image file to be resized in the browser by setting the width and height, but you still have a big image to download, and it would not be good for people with slow internet connection.
29th Jul 2023, 1:47 PM
Bob_Li
Bob_Li - avatar
+ 1
Faraz Haghbayan To make the image smaller, you can use the 'height' and 'width' attributes in the `img` tag. Like this.... method 1 without CSS :- Example... <img src = "https://api2.sololearn.com/v2/certificates/CC-UKIVWCDS/image/png"width="50%" height="50%"> method 2 with CSS:- add this in css section.. img{ display:flex; height:100%; width:100%; }
29th Jul 2023, 10:40 AM
Darpan kesharwanišŸ‡®šŸ‡³[InactivešŸ“š]
Darpan kesharwanišŸ‡®šŸ‡³[InactivešŸ“š] - avatar
+ 1
using an image editor to resize your image to the actual size you are using in your page is also a good idea if you are hosting the image. It would improve the load time for people with slower internet connection.
29th Jul 2023, 12:31 PM
Bob_Li
Bob_Li - avatar
0
Thank you !
29th Jul 2023, 10:42 AM
Faraz Haghbayan
Faraz Haghbayan - avatar
0
Sir,that's a great IdeašŸ’” but how can I use image editor? Do you mean width and height?
29th Jul 2023, 1:37 PM
Faraz Haghbayan
Faraz Haghbayan - avatar
0
You are absolutely right āœ…ļø I will do it when I arrive homešŸ™Œ Thanks for your tip!
29th Jul 2023, 1:57 PM
Faraz Haghbayan
Faraz Haghbayan - avatar
0
That's the PERFECT tip!šŸ˜¬ I really didn't thought about also giving sources šŸ™ŒThanks sir!
30th Jul 2023, 4:44 AM
Faraz Haghbayan
Faraz Haghbayan - avatar