Image over a video (html5)

后端 未结 5 343
感情败类
感情败类 2021-01-12 23:42

I\'m trying to display an image over a video (html5). If I put an instead of the video ... it works but when I put a the video is over the image :/ What could I do ?

相关标签:
5条回答
  • 2021-01-13 00:02

    The poster attribute specifies an image to be shown while the video is downloading, or until the user hits the play button. If this is not included, the first frame of the video will be used instead.

    0 讨论(0)
  • 2021-01-13 00:06

    Link: http://jsfiddle.net/kNMnr/1487/

    Use position in CSS3 with z-index.

      <div id="wrap_video">
        <div id="video_box">
            <div id="video_overlays">Logo</div>
            <div>
                <iframe width="560" height="315" src="https://www.youtube.com/embed/gKiaLSJW5xI" frameborder="0" allowfullscreen></iframe>
            </div>
        </div>
    </div>
    

    CSS:

    #video_box {
        position:relative;
    }
    #video_overlays {
        position:absolute;
        width:160px;
        min-height:40px;
        background-color:#dadada;
        z-index:300000;
        bottom:10px;
        left:10px;
        text-align:center;
    }
    
    0 讨论(0)
  • 2021-01-13 00:06

    you can provide the image with a certain z -index in css and set its position to absolute hope that helps...

    0 讨论(0)
  • 2021-01-13 00:18

    There is a simple video attribute that allows the use of pre-loaded images.

    The "poster" attribute defines a poster image that is in place of the video.

    0 讨论(0)
  • 2021-01-13 00:25

    Looks like the z-index is the problem here as the other user suggest, but just wanted to add. If you are tring to just display a picture before a video you could also use the poster attibute of the html5 video tag.

    http://www.youtube.com/watch?feature=player_embedded&v=heI69L8fS6Q#at=99

    0 讨论(0)
提交回复
热议问题