Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Background image size, Android

Tags:

css

image

We have a problem with 2 projects already:

A big background image (to fill a big screen of a desktop PC) is displayed very small in the upper left corner of the smartphone display.

This is one of the used codes:

background: #7F7F7F url("../images/hg4.jpg") repeat left top scroll;

Perhaps there is a simple solution for all devices, or a detection and 2 versions are necessary?

like image 244
user1895549 Avatar asked Nov 20 '25 22:11

user1895549


1 Answers

I didn't test it but you can try background-size: cover; background-position: center center; background-attachement: fixed;

like image 51
tryzor Avatar answered Nov 22 '25 13:11

tryzor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!