Changer position du background d'une video HTML5

Fermé
Jotech Messages postés 712 Date d'inscription dimanche 1 avril 2007 Statut Membre Dernière intervention 4 janvier 2023 - 30 avril 2015 à 12:48
allan59820 Messages postés 76 Date d'inscription vendredi 26 avril 2013 Statut Membre Dernière intervention 17 octobre 2020 - 30 avril 2015 à 12:50
Bonjour à tous

En plein ecran je voudrais mettre ma video en position vertical centrer.
J'arrive à mettre la video en haut ou en bas en changeant bottom: 0; ou top: 0; dans la class .fillWidth mais je n'arrive pas à la placer au milieu.
L'illustration est ici : http://shorthug.com/892b19c

CSS :

.header-unit {
position: relative;
height: 600px;
}

video {
display: inline-block;
}

#video-container {
z-index: -1;
position: absolute;
right: 0;
left: 0;
top: 0;
bottom: 0;
overflow: hidden;
}

video.fillWidth {
bottom: 0;
position: absolute;
width: 100%;
}

@media (max-width: 1099px){
video.fillWidth{
height:100%;
width:auto
}
}

HTML
<div class="header-unit">
<div id="video-container">
<video autoplay loop class="fillWidth">
<source src="movie.mp4" type="video/mp4"/>
</video>
</div><!-- end video-container -->
</div><!-- end .header-unit -->


A voir également:

1 réponse

allan59820 Messages postés 76 Date d'inscription vendredi 26 avril 2013 Statut Membre Dernière intervention 17 octobre 2020 5
30 avril 2015 à 12:50
bonjour,

essayes de mettre margin : 0 auto; dans video container.
0