how do you make a image large | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 3

how do you make a image large

17th Nov 2020, 6:48 PM
ethan
ethan - avatar
1 Answer
+ 1
If you want to stretch an image in a web page, you can use CSS properties. The following are great if you want a background-image to cover or be tightly contained within a div or other block-type element: background-size: cover; or background-size: contain; Both of those will maintain aspect ratio of the source image. For img elements, you could use CSS properties like width and height. I recommend only controlling 1 of the 2 dimensions to let the browser maintain aspect ratio of the image.
17th Nov 2020, 10:06 PM
Josh Greig
Josh Greig - avatar