首页 > 解决方案 > 移动友好的导航栏

问题描述

我需要帮助使我的导航栏移动友好。

我尝试了一些教程,但没有一个有效。

是网站的链接(用于 HTML)和CSS 代码的链接

我试过使用@media 标签,但它似乎不适用于@media 标签内的任何内容。

这是 CSS 代码的媒体查询:

```@media screen and (min-width: 800px) {

.nav-toggle-label {
display: none;
}

header {
z-index: 999;
width: 100%;
right: 0%;
top: 0%;
position: fixed;
}

.logo {
margin: 0;
color: silver;
list-style: none;
padding-top: 15;
}

.nav {
text-transform: uppercase;
font-size: 1.2rem;
background: var(--background);
}

.nav::after {
content: "";
display: table;
clear: both;
}

.nav-main {
float: right;
list-style: none;
}

.nav-main-item {
display: inline-block;
width: 10rem;
position: relative;
}

.nav-main a {
text-align: center;
padding: 1rem;
color: white;
text-decoration: none;
display: block;
}

.nav-main-item a:hover {
background-color: silver;
}

.nav-main-item:hover > .navi-main-item {
display: inline-block;
margin: 0;
}

.navi-main-item {
display: none;
position: absolute;
width: 100%;
top: 100%;
z-index: -1;
background: var(--background);
box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.8);
}

.Discord {
padding-left: 72%;
margin-bottom: 80px;
}

.gif-Destiny {

width: 200px;
float: right;
color: white;
text-shadow: 2px 2px black;
}
   
.Zachary {
color: white;
text-decoration: none;
text-shadow: 2px 2px black;
}
 
.introduction {
color: white;
text-shadow: 2px 2px black;
}

.footer {
background-color: #1F2E4B;
color: white;
text-align: center;
font-size: 20px;
float: center;
margin-top: 12.5%;
}

.CbZD{
color: #00FFFF;
font-size: 30px;
}
}```

标签: htmlcssnavigationnavigationbar

解决方案


您是否尝试过 Boostrap。它会给你一个Headstart。访问https://getbootstrap.com/docs/4.0/components/navbar/


推荐阅读