将屏幕大小调整为768px时,导航会更改样式

When resizing screen to 768px the navigation change style

本文关键字:导航 样式 768px 屏幕 调整      更新时间:2023-09-26

我正在构建移动导航。当屏幕尺寸小于768px时,它将保持在黑色标题中。只要站点是宽的768,导航条就会出现在黑色标题外的一行中。我希望这个导航始终保持在黑色标题,当屏幕大于768px时不会改变风格。我该怎么做?

我和768的媒体记者们玩过,但似乎什么都不管用。。

你可以试试这个

@media only screen and (min-width: 768px) {
   //Put some css here that will make nav to stay in the black header
}