How do you ensure the sizes of the images in a website are of the same without interfering with the pixels. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do you ensure the sizes of the images in a website are of the same without interfering with the pixels.

31st Dec 2022, 1:09 AM
Daniels
6 Answers
+ 2
I think you mean how do you resize a picture such that it will be convenient without being too much stretched horizontally or vertically one way to do that is to multiply the dimensions of the picture with a number, for example if the size of the picture was 300x400, if you resize it to 600x800 it would still be as nice looking as the original size you can also do that using css, use background-image property to insert the picture then resize it using background-size property using either pixels or percentages and change its position with background-position
31st Dec 2022, 4:18 AM
Ahmad Sulaiman
+ 2
I want to add something to my previous reply, background-image is set to repeat by default, use background-repeat: no-repeat
31st Dec 2022, 4:23 AM
Ahmad Sulaiman
+ 1
Ahmad Sulaiman made a very good contribution👍🏾
1st Jan 2023, 11:29 AM
Hacman
Hacman - avatar
0
What do you mean? Can you rephrase it please?
31st Dec 2022, 1:15 AM
Lamron
Lamron - avatar
0
Have you ever inserted an image when you are coding and try to make changes of the width and height? There is a way they stretch and look funny.
31st Dec 2022, 1:27 AM
Daniels
0
There are ways. You can use either relative or non-relative units, and much more. But the best way in my opinion is to use pixels.
31st Dec 2022, 1:31 AM
Lamron
Lamron - avatar