Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 有没有办法把导航条放在所有东西的前面?_Html_Codepen - Fatal编程技术网

Html 有没有办法把导航条放在所有东西的前面?

Html 有没有办法把导航条放在所有东西的前面?,html,codepen,Html,Codepen,你好,我正在制作一个有导航条的网站,但我发现当我向下滚动其中一个div时,导航条重叠了。代码如下: <ul> <li><a href="404.html"><button class=nav>Home</button></a></li> <li><a href="#"><button class=nav>Contact Us</button></a>&l

你好,我正在制作一个有导航条的网站,但我发现当我向下滚动其中一个div时,导航条重叠了。代码如下:

<ul>
<li><a href="404.html"><button class=nav>Home</button></a></li>
<li><a href="#"><button class=nav>Contact Us</button></a></li>
<li><a href="#"><button class=nav>Web Development</button></a></li>
<li><a href="#"><button class=nav>Editing</button></a></li>
对Codepen的看法


只需将这一行添加到CSS文件中即可

z-index: 999;

查看此链接了解更多信息

您可以为导航栏提供z-index:10000

您可能需要查看z-index CSS属性:使用
z-index
CSS进行定位,其最小值为1,最大值为999,
z-index:1
分钟后移,
z-index:999
top您的代码笔似乎已经可以使用了。你实现了你想要的吗?
z-index: 999;