Ich möchte ein Png über mein Hintergrundvideo setzen, aber das Png ist dahinter.Wie png img über den Videohintergrund einstellen?
Ich habe versucht, mit Z-Index, aber dann verschwindet das Video (wenn ich die Position von relativ zu absolut oder fest). Hier ist meine HMTL und CSS-Code:
<div id="page2">
<video autoplay loop muted id="video">
<source src="Images/KeyboardVideo.mp4">
<source src="Images/KeyboardVideo.webm">
</video>
<div id="servicelogo"><img src="images/htmlcssjs.png"></div>
</div>
/* CSS Document */
* {margin: 0; padding: 0;}
body{
font-family: arial,helvetica;
color: black;
text-align: center;
}
h1{
font-size: 6em;
padding-top: 305px;
opacity: 0.8;
}
p{
font-size: 2em;
}
#wrapper {
position: fixed;
height: 80px;
width: 100%;
background-color: black;
z-index: 500;
}
#nav {
height: 80px;
width: auto;
float: right;
list-style: none;
position: relative;
margin-right: 100px;
z-index: 500;
}
#nav li {
height: 80px;
width: 100px;
float: left;
font-family: sans-serif;
font-weight: bold;
color: white;
padding: 0px 15px 0px 15px;
text-align: center;
line-height: 80px;
font-size: 20px;
}
#video {
position: relative;
width: auto;
min-width: 100%;
height: auto;
background: transparent url(images/Nature2.jpg) no-repeat;
background-size: cover;
z-index: -1
}
#servicelogo img{
position: relative;
height: 40%;
width: 40%;
margin-top: 8%;
opacity: 0.8;
}
#page2 {
width: 100%;
max-height: 100%;
overflow: hidden;
top: 0;
right: 0;
}
a {text-decoration: none;}
/* unvisited link */
a:link {
color: white;
}
/* selected link */
a:active {
color: #7f8c8d;
}
/* visited link */
a:visited {
color: white;
}
/* mouse over link */
a:hover {
color: #7f8c8d;
}
#page1 {background-image: url(images/Nature1.jpg); z-index: -1;}
#page3 {background-image: url(images/Nature2.jpg);}
#page4 {background-color: #2ecc71;}
Verwendung Plakat Attribute Video statt. z.B. '
Dies ist eine nette Option, aber ich brauche mein Bild, um immer über das Video zu sein. Hier ist meine Webseite - www.deanzuna.com (es ist unter Bau), und wenn Sie auf den Link "Dienste" gehen, werden Sie das Video sehen. Ich habe einen Plan, ein nettes Video über dieses Video zu machen, das ständig an seinem Platz bleibt. –
Ich habe es gelöst! :) #video { Position: fixiert; oben: 50%; links: 50%; minimale Breite: 100%; min-Höhe: 100%; Breite: Auto; Höhe: Auto; Z-Index: -100; transform: translate (-50%, -50%); } #servicelogo img { \t Position: relativ; \t Höhe: 40%; \t Breite: 40%; \t Rand oben: 8%; \t Opazität: 0,8; } # page2 { Breite: 100%; maximale Höhe: 100%; Überlauf: versteckt; oben: 0; rechts: 0; } –