我正在构建移动导航。当屏幕尺寸小于 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
}
关于javascript - 将屏幕大小调整为 768px 时,导航更改样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33665673/