A
A
Artem00712018-03-18 19:55:55
css
Artem0071, 2018-03-18 19:55:55

Why is the background 2x bigger on mobile?

Just an example
This is on a computer in safari
5aae991342f7e023302096.png
This is on a computer in safari as a device (iphone 5 / SE):
5aae994b394a9649189786.png
And here is the problem, when I open it on an iPhone (5), the background increases in size:
5aae99fa6d608652788526.png
Here is the code:

.indexBanner {
    padding: 30px;
    background: grey url("~assets/images/hello/burger.jpg") no-repeat center center fixed;
    background-size: cover;
    -webkit-background-size: cover;
    background-blend-mode: multiply;
  }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Paul Denisevich, 2018-03-18
@deniamnet

Do it like this:

.indexBanner {
    padding: 30px;
    background: grey url("~assets/images/hello/burger.jpg") no-repeat fixed;
    background-size: cover;
    -webkit-background-size: cover;
    background-blend-mode: multiply;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question