Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image over a video (html5)

Tags:

html

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 ?

<div class="videohead">
<video loop="loop" autoplay="autoplay"> 
<source src="img/video.mp4" type="video/mp4" />
<img src="img/video.png"/> 
</video>
<a href=""><img src="img/logo.png" class="logo"/></a>
</div>

.videohead
{
margin: 5px 0 0 1px;
}

.logo
{
margin-top: -155px;
}
like image 319
tonio Avatar asked Apr 27 '11 09:04

tonio


2 Answers

Link: https://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;
}
like image 138
Vidya Tyagi Avatar answered Sep 19 '22 21:09

Vidya Tyagi


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

like image 26
abhijit Avatar answered Sep 21 '22 21:09

abhijit