Washing Machine
Washing Machine

Reputation: 21

Responsive GIF background for mobile

I have recently created a website that has a gif as a background image. The gif covers the entire screen on a computer, but when I use a mobile device and go onto my website, the gif is only present on the top fraction of the screen, leaving the rest of the space white. I've tried some solutions like putting in <meta name="viewport" content="width=device-width, initial-scale=1"> and background-size: cover; but that only made my text adjust, and not my gif background. Sorry if this question is stupid, but I appreciate any answers.

Upvotes: 2

Views: 1507

Answers (1)

Johannes
Johannes

Reputation: 67778

use background-size: cover for the element to which you applied the GIF as a background image.

Upvotes: 2

Related Questions