滚动页面时无法修复导航栏

时间:2017-03-29 20:18:03

标签: html css html5 css3 hover

我是HTML和CSS的新手,我的导航栏出现问题。滚动浏览各个部分时,我无法在页面顶部指定导航栏,当我最终解决我的问题时,我的部分中的悬停效果停止工作,这里有人知道如何解决这个问题吗?

这是我的代码:



@charset "utf-8";
/* CSS Document */
html{
	height:100%;
	overflow:hidden;
}
body{
    font-family: "Walkway Black";
    border:0;
    margin:0;
    padding:0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overflow-x:hidden;
    overflow-y:scroll;
    perspective: 1.1px;
}
nav {
    float:right;
    z-index: 2;
    position:fixed;
    top:0;
    right:90;
}

nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

nav li {
    display: inline-block;
    margin-left:60px;        /* distanciamento de cada palavra*/
    padding-top: 20px;
    position: relative;
}

nav a {
    color: #444;
    text-decoration: none;
    text-transform: uppercase;  /*texto em letra maiuscula*/
    font-size: 14px;
}

nav a:hover {
    color: #000;
}

nav a::before {
    content: '';
    display: block;
    height: 5px;
    background-color: #444;
    position: absolute;
    top: 0;
    width: 0%;
    transition: all ease-in-out 250ms;
}

nav a:hover::before {
    width: 100%;
}
#secao1{
    display: flex;
	background-image:url(../imagens/intro_cloud.png);
    background-position:center;
	background-size:cover;
    z-index:1;
}

#secao2{
    display: flex;
	background-image: url(../imagens/image4.png);
	background-size: cover;
	transform: translateZ(-1px) scale(2);
	z-index: 0;
}

#secao3{
    display:flex;
	background-image: url(../imagens/image2.jpg);
	background-size:cover;
    z-index:1;
}
.slide{
	display: flex;
    width:100vw;
    height:100vh;
    justify-content: center;
	position:relative;
	padding: 25% 10%;
	min-height: 100%;
	width: 100%;
	box-sizing: border-box;
	box-shadow: 0 -1px 10px rgba(0,0,0,.7);
	transform-style: inherit;
    overflow: auto;
}
#box {                          /*box*/
    position:absolute;
    top:20%;
    left:15%;
	width: 880px;
	height: auto;
	margin: 15px auto;
	display: flex;
	margin-bottom: 50px;
    box-shadow: rgba(0, 0, 0, 0.7);
}
#box:after {                       /*efeito box*/
	display: flex;
	content: '.';
	line-height: 0;
	visibility: hidden;
}
.estilo {
	display: flex;
	width: 880px;
	list-style: none;
}
.estilo li {
	position: relative;
	display: flex;
	float: left;
	width: 400px;
	height: 300px;
	margin:20px;
	cursor: pointer;
}
.estilo li img {
    border-radius: 15%;
	width: 80%;
	height: 80%;
	display: flex;
	z-index: 999;
	position: absolute;
	transition:.5s;
    border:-2px;
}
.conteudo {
	display: flex;
	width: 80%;
	height: 80px;
	background-color:#363739;
    border-bottom-left-radius: 50% 50%;
    border-bottom-right-radius: 50% 50%;
    opacity:.5;
	overflow: hidden;
	margin-top: 160px;
}
.estilo li:hover img {               /*efeito bloco*/
	margin-top:-80px;
    border-bottom-right-radius:0;
    border-bottom-left-radius:0;
}

<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Alt</title>
		<link href="css/style.css" rel="stylesheet" type="text/css" />
	</head>
<body> 
<nav>
    <ul>
      <li><a href="#">Home</a></li>
      <li><a href="#">Serviços</a></li>
      <li><a href="#">Equipe</a></li>
      <li><a href="#">Orçamento</a></li>
      <li><a href="#">Contato</a></li>
    </ul>
</nav>

<section id="secao1" class="slide">

</section>
<section id="secao2" class="slide">
  <div id="box">
	  <ul class="estilo">
    	  <li>
        	  <img src="../código/imagens/giphy.gif" alt="">
        	  <div class="conteudo"></div>
    	  </li>
    	  <li>
        	  <img src="../código/imagens/systems.gif" alt="">
        	  <div class="conteudo"></div>
    	  </li>
	  </ul>
  </div>
</section>
<section id="secao3" class="slide"></section>

</body>
</html>
&#13;
&#13;
&#13;

ps。:抱歉坏了eng = D希望你明白

0 个答案:

没有答案