About 1,710,000 results
Open links in new tab
  1. css - How to force image resize and keep aspect ratio? - Stack Overflow

    I was specifically looking for a dynamic approach, as prior I do not know DIV size or image dimensions. In the end I solved this by preloading the image, calculating the aspect ratio, comparing it versus the …

  2. Changing image sizes proportionally using CSS - Stack Overflow

    I have been trying for a couple of days now to configure my thumbnail gallery so all the images appear the same height and width. However, when I change the CSS code to, max-height: 150px; max-width:

  3. html - Resize image proportionally with CSS? - Stack Overflow

    Apr 25, 2009 · Is there a way to resize (scale down) images proportionally using ONLY CSS? I'm doing the JavaScript way, but just trying to see if this is possible with CSS.

  4. How do I change the size of an image in css - Stack Overflow

    Apr 20, 2013 · I keep trying to change the size of my image with css by adding a width and height attribute. However, this only changes the zoom of the picture. For example, I have a 90px by 90px …

  5. Can I change the height of an image in CSS :before/:after pseudo ...

    141 Note that the :after pseudo-element is a box, which in turn contains the generated image. There is no way to style the image, but you can style the box. The following is just an idea, and the solution …

  6. How can I resize an image to a percentage of itself with CSS?

    I am trying to resize an image with a percentage of itself. For example, I just want to shrink the image by half by resizing it to 50%. But applying width: 50%; will resize the image to be 50% of the

  7. CSS Image size, how to fill, but not stretch? - Stack Overflow

    Apr 21, 2016 · This Stack Overflow discussion provides solutions for resizing images using CSS to fill a container without stretching the image.

  8. How to set an image's width and height without stretching it?

    Nov 14, 2009 · 128 2017 answer CSS object fit works in all current browsers. It allows the img element to be larger without stretching the image. You can add object-fit: cover; to your CSS.

  9. How can I resize an image dynamically with CSS as the browser width ...

    Setting max-width to 100% and height to auto did nothing for me - I indeed worked with a container. Wrap the image in a div, set the max height/width, and let the image (#div img {}) be width 100% and …

  10. Automatically resize images with browser size using CSS

    Apr 25, 2013 · Learn how to automatically resize images based on browser size using CSS techniques and media queries.