Ich habe eine Navbar an der Spitze befestigt. Beim Scrollen geht fast alles unter die Navbar, aber da ist dieses Stück Text, das über die Navbar geht. Kann ich zwingen, dass die Navigationsleiste ganz oben steht, oder den Text zwingen, ganz unten zu sein?Wie man alles unter der Navbar macht
Hinweis: Um das Problem zu beobachten, fügen Sie bitte beliebige Inhalte hinzu, damit Sie durch die Seite blättern können.
Hier ist der Code: https://jsfiddle.net/q8prw19c/1/
.caption {
position: absolute;
left: 0;
top: 50%;
width: 100%;
text-align: center;
color: #000;
}
.caption span.border {
color: #fff;
padding: 18px;
font-size: 3em;
letter-spacing: 10px;}
.parallax {
background-image: url("http://www.firsthdwallpapers.com/uploads/2014/03/hd-wallpapers-wide-pack-41-20.jpg");
height: 100%;
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.topnav {
\t position: fixed;
top: 0;
width: 100%;
background-color: #333;
overflow: hidden;
}
.topnav a {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
font-size: 17px;
}
<div class="topnav" id="myTopnav">
\t \t <a href="#home">Home</a>
\t \t <a href="#news">News</a>
\t \t <a href="#contact">Contact</a>
\t \t <a href="#about">About</a>
\t </div>
\t <div class="parallax">
\t \t <div class="caption">
<span class="border">test</span>
</div>
\t </div>
Um genauer zu sein add 'z-index' zu' .topnav' Element –