html - 移动友好的导航栏
问题描述
我需要帮助使我的导航栏移动友好。
我尝试了一些教程,但没有一个有效。
我试过使用@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;
}
}```
解决方案
您是否尝试过 Boostrap。它会给你一个Headstart。访问https://getbootstrap.com/docs/4.0/components/navbar/
推荐阅读
- angular - 延迟加载模块中空路径上的角度多个命名路由器
- ant-media-server - 蚂蚁传媒社区版中的视频拉伸
- oracle-sqldeveloper - 更改ORACLE SQL 的字体,但显示字仍然很小
- java - Spring Data 延迟初始化角色集合失败,无法初始化代理 - 没有会话
- excel - 通过分隔符从单元格中获取多个子字符串
- api - 查看 Microsoft 动态 crm 报告并使用 API 下载 - 邮递员
- bash - sed: -e 表达式 #1, char 93: 未终止的 `s' 命令
- qemu - 基于 EVE-NG QEMU 的节点未启动
- microsoft-graph-api - Microsoft Graph - 应用未经授权创建 Sharepoint 列表订阅
- azure-blob-storage - 自动生成的块 blob