0

I have a struggle displaying the background image the desired way. On a desktop version, even if I go to the smallest resolution I can - the image is contract inside, but when I try it on a mobile phone - it doesn't work.

padding: 0;
margin: 0;
width: 100%;
height: 100%;
background: url("../img/background_photo.png") center fixed;
background-repeat:no-repeat;
background-position: center center;
-webkit-background-size:cover;
-moz-background-size:cover;
-o-background-size:cover;
background-size: cover;

This is the code for the background image.No matter what is the width or the height - it contracts in, so it looks nice, but on a mobile - it doesn't work.

I thought the problem must be, because I didn't included the code in the media queries, but when I added it - it didn't worked again.

  • Possible duplicate of [background: fixed no repeat not working on mobile](https://stackoverflow.com/questions/26372127/background-fixed-no-repeat-not-working-on-mobile) – AndrewL64 Jun 29 '18 at 21:05
  • you can't resize mobile devices can u?? – oldboy Jun 29 '18 at 22:22
  • @AndrewL Yesterday I tested it on android phone, and it worked.I found interesting that a few things work on android, but on iPhone - don’t.I’ll try your suggestion and tell you if it works – Kaloyanxoxo Jul 01 '18 at 03:59

0 Answers0