html - css定位下拉子菜单

标签 html css drop-down-menu submenu

在我的网站上有 css 子菜单。问题是最后两个子菜单从屏幕上消失了。

enter image description here

我怎样才能保持这个子菜单的位置?

有一些小的 css 调整,代码很长,所以我不会在这里发布完整的代码。这是有问题的现场链接 www.brandstik.in

最佳答案

您需要将最后 2 或 3 个菜单链接作为目标来管理它们的子菜单位置:

CSS:

.main-category-nav > li:nth-last-child(1) ul.super-child, 
.main-category-nav > li:nth-last-child(2) ul.super-child, 
.main-category-nav > li:nth-last-child(3) ul.super-child {
    right: 0;
}

这将更改最后 3 个子链接的子菜单位置。

关于html - css定位下拉子菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38990648/

相关文章:

html - Safari 上单词之间出现奇怪的图标

javascript - 修改/更新 HTML 中的元素样式

javascript - 验证出生日期注册日历

php - PHP 中的动态菜单

javascript - <script type=text/javaScript> vs <script type=module>

php - 在元标记中使用换行符

html - 浏览器正在将页面缩放到 125%

CSS 通过 % - 偏移调整大小

出现 CSS 下拉列表,但是当您单击时,它会消失

javascript - 如何设置弹出窗口的字体大小?