gpt4 book ai didi

css - 向左浮动导致悬停在菜单右侧

转载 作者:太空宇宙 更新时间:2023-11-03 18:45:01 25 4
gpt4 key购买 nike

我很好奇是否有任何方法可以仅使用 css 来纠正这种行为......

请注意,当您将鼠标悬停在菜单右侧的空白区域时,会导致菜单项模糊。如果将鼠标悬停在菜单左侧的空白处,菜单项不会模糊。

我确信 float: left of the #centeredmenu ul 规则导致了这种模糊。当您将鼠标悬停在右侧的空白区域时,我想停止模糊,但此规则对于使菜单居中是必要的。

我正在尝试更正此页面:http://www.soaringbirdstudios.com/help

正如您在 firebug 中看到的那样,我尝试在 centermenu div 下面添加另一个 div,其样式为 clear both 并将两个 div 包含在一个封闭的 div 中,但这没有用。我只是没有足够的经验来解决这个问题。

谢谢。

最佳答案

不确定它是否能帮助您实现所需的解决方案,但如果您想摆脱 float ,只需执行以下操作即可:

改变:

.bmenu li {
display:inline-block;
/*float: left;*/ <-- can delete or comment out
list-style: none;
padding: 0;
position: relative;
/*right: 50%;*/ <-- can delete or comment out
margin: 100px 0 0;
font-size: 50px;
vertical-align:top; <--- added for making it pretty
}

继续向下进行以下更改以完全摆脱 float :

delete <div style="clear:both;"></div>

#centeredmenu ul {
/*clear: left;*/ <-- can delete or comment out
/*float: left;*/ <-- can delete or comment out
list-style: none;
margin: 0;
padding: 0;
position: relative;
/*left: 50%;*/ <-- can delete or comment out
text-align: center;
}

#centeredmenu {
/*float: left;*/ <-- can delete or comment out
width: 100%;
overflow: hidden;
position: relative;
}

关于css - 向左浮动导致悬停在菜单右侧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16576023/

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