【发布时间】:2018-11-27 07:14:23
【问题描述】:
我创建了一个菜单,其中的每个链接都具有相同的 ID #menuu 和类 .menu-item。我没有编写任何 HTML,因为它是使用实时页面构建器创建的。
我有以下 CSS:
#menuu {
text-decoration: none;
color: #0B1B70;
}
.menu-item-text {
-webkit-transition: border 200ms ease-out;
-moz-transition: border 200ms ease-out;
-o-transition: border 200ms ease-out;
transition: border 200ms ease-out;
border-bottom: 2.11 pxpx solid transparent;
border-top: 2.11 pxpx solid transparent;
padding: 0px;
height: 35px
}
#menuu:hover .menu-item-text,
#menuu:focus .menu-item-text,
#menuu:active .menu-item-text{
border-bottom: 2.11px solid #61f6ff;
border-top: 2.11px solid #61f6ff;
}
.active { border-bottom: 2.11px solid #61f6ff !important;
border-top: 2.11px solid #61f6ff !important; }
#menuu
{
min-width: 60pxpx;
max-width: 235.97px;
width: 100%;
padding-left: 5%;
padding right: 5%;
white-space: nowrap;
position: inline-block
display: flex;
justify-content: center;
align-items: center;
}
我想在最小化浏览器宽度时防止菜单项相互重叠。现在他们都走到了页面的中心,互相覆盖。你可以在这里检查它:mayabarber.co.il。 Display:inline 块由于某种原因无法正常工作。
谢谢!
【问题讨论】:
-
each link in it has the same ID #menuu??切勿使用重复的 ID!你能也分享一下HTML吗?所以你创建了一个工作示例? -
嗨 Mihai,我还没有创建 HTML,因为我使用了一个名为 Elementor 的实时网站构建器用于 wordpress。我在上面分享了一个链接。感谢您愿意提供帮助。
-
检查元素 -> 复制菜单的 HTML -> 粘贴到这里 :)
-
尝试删除
white-space: nowrap;