Safari Image Size Auto Height CSS

Safari Image Size Auto Height CSS

Just set only the width on the image. The browser will scale the image proportionally automatically.

.userImg { width: 100%; }
.imgContainer { height: auto; width: 150px; }​

Safari css height: auto; and height: 100%; stretches image. Does not happen in firefox or chrome

In the fiddle example I see that the for 'figure img' selectors min-height property is set to 100% which makes the image stretch its height to the whole block. Remove that and it would work.

Safari (Win7) does not refresh img height with max-height property

New version

div {
height: 100px;
width: 200px;
background: red;
position: relative;
}

img {
max-width: 100%;
max-height: 100%;
position: absolute;
}

Seems to be working as expected. Fiddle

CSS not working in Safari, but in Chrome and other browsers it does

You need to remove background-attachment : fixed not supported on the safari , check it here Can I use , last parameter of background css key is an attachment



Related Topics



Leave a reply



Submit