I am currently working with VueJS + NuxtJS and have implemented a background gif. Right now, the code looks like this:
body {
margin: 0 auto;
background: url("assets/video/background-darked.gif") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
@media only screen and (max-width: 860px) {
overflow-y: scroll;
}
}
However, I only want the background gif to appear on certain pages, not throughout the entire body. If I change body
to a class name (let's say main
) and use it like this:
<template>
<div class='main'>
<Header />
</div>
</template>
I encounter strange padding issues:
https://i.sstatic.net/ue2zV.png
Any suggestions on how to fix this?