gpt4 book ai didi

jquery - 断点后菜单栏失去响应

转载 作者:行者123 更新时间:2023-11-28 03:00:44 25 4
gpt4 key购买 nike

当浏览器窗口大小小于 900 像素时,菜单栏未正确调整大小。
栏仍然太宽,一些内容不在屏幕上,并且还会出现水平滚动条。

我试图让这个菜单栏工作两天。我什至不能指出问题所在。我尝试了所有想到的方法。

我想错误是在

@media screen and (min-width:900px) 

here is a pen with all the code because I thought it's too much code to paste here

最佳答案

您可以使用 flexbox-wrap 将每个元素添加到其余元素下方,如果空间太小,这会将元素移至新行

.site-nav>ul {
display: flex;
flex-direction: row;
justify-content: center;
align-items: stretch;
flex-wrap:wrap;
}

codepen

您还可以在菜单顶部添加边距,以防止仅在小型设备上溢出

@media (max-width :800px){
.site-nav {
z-index: 999999999999999999;
margin-top: 25px;
}

关于jquery - 断点后菜单栏失去响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46220018/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com