Anoop Chauhan
Anoop Chauhan

Reputation: 13

Background video with Html5 and CSS not fixed attachment

video {
    width: 100%;
    z-index: 1;
    position: fixed;
}

I try this one it's working fine but it's fixed in the whole body...

Upvotes: 0

Views: 202

Answers (1)

flik
flik

Reputation: 3643

You should set your selector for example:

#headerid video {
    width: 100%;
    z-index: 1;
    position: fixed;
}

It will fix the video in the headerid element. It could be div but you must fix the width and height of the div.

Upvotes: 1

Related Questions