我又遇到问题了。我刚刚更新了我的 Arcade 页面,我希望它的导航栏与我网站的其他部分不同。当我将用作选项卡的每个 div 都设为position:relative;
div 时,它的效果很好。但是我希望无论您在街机中的哪个位置,标签都保持在顶部。
我将标签更改为position:fixed
,它停止工作。让我的所有标签相互重叠,所以你只能看到一个。我正在研究这个问题,并在关于它的文章中找到。本文讨论将所有position:relative
div 放在一个固定位置的 div 中。我试过了,它不起作用。
我正在使用 PHP 文件来保留这些选项卡。
这是我的头文件中的 HTML:
<body>
<br />
<div id="gamenav-fixed"><center><a href="/"><div class="game-home">Home</div></a><a href="/arcade/action"><div class="game-nav">Action</div></a><a href="/arcade/arcade"><div class="game-nav">Arcade</div></a><a href="/arcade/puzzle"><div class="game-nav">Puzzle</div></a><a href="/arcade/vehicle"><div class="game-nav">Vehicle</div></a><a href="/arcade/violence"><div class="game-nav">Violence</div></a><a href="/arcade/defense"><div class="game-nav">Defense</div></a><a href="/arcade/rpg"><div class="game-nav">Role Playing</div></a><br /><br /></div>
<div class="text-center"><font face="lucida console" size="12px" color="#686868">Game</font><font face="baskerville old face" size="12px" color="#888888"><b>Shank</b></font></br></br></div>
</body>
这是我用于这些选项卡的 CSS:
/* The following is for the arcade page navigation! */
/* Center navigation. */
div#gamenav-fixed:{
position:fixed;
}
.game-nav{
border:0px;
padding:9px 25px 10px 25px;
box-shadow:0px 0px 0px 0px;
transition: .5s;
-moz-transition: .5s;
-webkit-transition: .5s;
font-family:arial;
color:#909090;
text-size:12px;
text-align:center;
display:inline;
position:relative;
background-color:#e0e0e0;
}
.game-nav:hover{
border:0px solid #686868;
transition: .5;
-moz-transition: .5;
-webkit-transition: .5;
background:#c0c0c0;
color:#202020;
}
.game-nav:active{
border:0px solid #686868;
transition: .5;
-moz-transition: .5;
-webkit-transition: .5;
box-shadow:0px 0px 10px 1px #a0a0a0 inset;
background:#d0d0d0;
color:#202020;
}
.game-home{
border:0px;
padding:9px 25px 10px 25px;
box-shadow:0px 0px 0px 0px;
transition: .5s;
-moz-transition: .5s;
-webkit-transition: .5s;
font-family:arial;
color:#202020;
text-size:12px;
text-align:center;
display:inline;
background-color:#c0c0c0;
position:relative;
}
.game-home:hover{
border:0px solid #686868;
transition: .5;
-moz-transition: .5;
-webkit-transition: .5;
background:#e0e0e0;
color:#909090;
}
.game-home:active{
border:0px solid #686868;
transition: .5;
-moz-transition: .5;
-webkit-transition: .5;
box-shadow:0px 0px 10px 1px #a0a0a0 inset;
background:#d0d0d0;
color:#202020;
}
/* Ends arcade navigation! */
我的网站是gameshank.com。并提前感谢!