Фоновое изображение CSS отображается неправильноCSS

Разбираемся в CSS
Ответить
Anonymous
 Фоновое изображение CSS отображается неправильно

Сообщение Anonymous »


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
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «CSS»