Using the keyword values contain or cover. there are plenty of things that makes the size adjustable… but i will try to introduce the simpllest thing. To resize an image proportionally, set either the height or width to "100%", but not both. Apply the width and height attributes for your tag to define the width and height of the image. Scale the image, while preserving its intrinsic aspect ratio (if any), to the largest size such that both its width and its height can fit inside the background positioning area. We use cookies to improve user experience, and analyze website traffic. Resize with CSS. Images are standard fare on most websites. This thread is locked. Setting background-size to fit screen. The Fallback Way . Reply Quote 0 1 Reply Last reply Output: Note: Using object-fit: cover; will cut off the sides of the image, preserving the aspect ratio, and also filling in space. HTML-CSS. none: The image is not resized at all, and the original image size fills the given area. This method isn't perfect, and it might cause some uncovered space, but by using the background-position property, you should be able to eliminate the problem and still accommodate older browsers. What we don’t get (easily, anyway) is a way to scale whole element (and it’s children) proportionally—retaining its exact layout as it changes size. scale-down: The smaller of either contain or none. The CSS object-fit property is used to specify how an or