Section above the video, using toggle

Asked

Viewed 177 times

0

Guys, I want to leave a video on the home page of the site that I’m creating with HMTL AND CSS, but when I click on some option from the sidebar menu, Serction will transition over my video, in case I leave it in the background. But what’s happening is the opposite. I left the html part of the header and iframe just below, searched on and saw that it is a toggle Function in javascript that I lack. Help me?

Página inicial do meu site Video Sobrepondo a section

<body>
  <div id="IframePosicao">
    <iframe width="800" height="451" 
     src="https://www.youtube.com/embed/JMJUUHDhRcA" 
     frameborder="0" allow="autoplay; encrypted-media" allowfullscreen> 
     </iframe>
  </div>

<header id="sidebar">
    <h1>NT GAMES</h1>
    <nav>
        <ul>
            <li id="link-home"><a href="#home">Home</a></li>
            <li id="link-empresa"><a href="#empresa">Empresa</a></li>
            <li id="link-servico"><a href="#servico">Serviços</a></li>
            <li id="link-contato"><a href="#contato">Contato</a></li>
            <li id="link-restrito"><a href="#restrito">Restrito</a></li>
        </ul>
    </nav>
</header>

css:
div#IframePosicao {
  position: absolute;
  overflow:auto;
  top: 30%;
  left: 45%;
  z-index: 5;
  margin-top: -155px;
  margin-left: -200px;
}

header{
    width: 25%;
    background: #fff;
    position: absolute;
    float: left;
    left: 0;
    top: 5%;
    z-index: 5;
}

  • Dude looks like you want your site to run on a "tabs" system. Take a look here and I think you can help https://www.w3schools.com/howto/howto_js_vertical_tabs.

1 answer

0


Hello! In this case, what is missing is probably an instruction as to the order of the content layers on the page. This information is given through the z-index. Try to change the following:

div#IframePosicao {z-index: -1;}
header{z-index: 5;}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.