Chrome crops img background size auto 100%

59 Views Asked by At

thanks to try to help me !

I would use background size auto 100% for imgs which i load from a database. Some are landscape layout, some are portrait. It's not a problem to crop it horizontally but i wouldn't vertically.

What i have on chrome

What i have on firefox and what i want

Is there any way to fix it?

Thanks you and have a nice day !

1

There are 1 best solutions below

1
On

Do you want the background as an image? https://css-tricks.com/perfect-full-page-background-image/

Do you want the whole image? Use this code:

html, body {
    height: 100%
}

Set your body background-size to 100% too.

Check this answer if it works! Ask me if it doesn't?