Фоновое изображение CSS отображается неправильно ⇐ CSS
-
Anonymous
Фоновое изображение CSS отображается неправильно
I'm trying to display a background image on a webpage, and it's showing the bottom two thirds of the image, followed by the top one third.
It's not a problem with the .jpg file; I tried a completely different image, identical symptoms.
I've boiled it down to a minimum test case, that just shows the image and nothing else. Browser is the latest version of Chrome on Windows 11.
If I replace cover with contain or 100% 100%, the image disappears completely.
Test body { margin: 0; padding: 0; background-image: url('https://picsum.photos/1920/1080'); background-size: cover; background-position: center; }
Источник: https://stackoverflow.com/questions/781 ... ncorrectly
I'm trying to display a background image on a webpage, and it's showing the bottom two thirds of the image, followed by the top one third.
It's not a problem with the .jpg file; I tried a completely different image, identical symptoms.
I've boiled it down to a minimum test case, that just shows the image and nothing else. Browser is the latest version of Chrome on Windows 11.
If I replace cover with contain or 100% 100%, the image disappears completely.
Test body { margin: 0; padding: 0; background-image: url('https://picsum.photos/1920/1080'); background-size: cover; background-position: center; }
Источник: https://stackoverflow.com/questions/781 ... ncorrectly
Мобильная версия