修复CSS图像菜单

发布于 2024-09-18 08:40:52 字数 64 浏览 4 评论 0原文

我正在尝试创建一个基于 css 的图像翻转导航栏。由于某种原因,我无法将图像放在正确的位置。我希望有人能提供帮助。

I am trying to create a css based image rollover navigation bar. For some reason, I can not get the images in the right place. I was hoping someone could help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

揽清风入怀 2024-09-25 08:40:52

首先突出的事情之一是您正在尝试使用 postion:absolute,但您没有定义父容器的位置。为了使绝对定位发挥作用,父元素必须具有默认静态位置以外的位置。

您似乎还在很多地方使用了 display:block ,这些地方要么是多余的(LI 已经是块元素),要么是不需要的,因为您正在内联显示菜单项。使用 diplay:block 会在显示为块的元素后面插入换行符。

One of the first things that sticks out is that you are trying to use postion:absolute, but you don't have the position of the parent container defined. In order for absolute positioning to work, the parent element must have a position other than the default static position.

You also seem to be using display:block in a bunch of places where it is either redunant (LI are already block elements) or not needed since you are displaying the menu items inline. Using diplay:block inserts a line break after the element you are displaying as a block.

萝莉病 2024-09-25 08:40:52

您没有将导航栏悬停区域放置在正确的位置,也许可以为其添加一些边距?

You did not position the navigation bar hover areas right, maybe add some margin to them?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文