ghostgril
V2EX  ›  Vue.js

自己写的导航栏悬浮菜单为何总在主页面下方

  •  
  •   ghostgril · Feb 7, 2018 · 2985 views
    This topic created in 3102 days ago, the information mentioned may be changed or developed.

    顶部是 position:fixed 的导航栏,下方是使用 rounter-view 的主页面

    我在导航栏写了一个 div,里面包含了名称和鼠标移入会显示的菜单,菜单设置成了 absolute,top:100%的样式。 但是呢悬浮菜单显示的时候永远在==router-view==主页面的下方,z-index 设置无效。请问有没有遇到过这种问题的盆友呢

    4 replies    2018-02-07 17:22:19 +08:00
    paloalto
        1
    paloalto  
       Feb 7, 2018 via iPhone
    把 top 改成 0。
    top:100%;的意思是距离顶部 100%,肯定就是到底部去了。
    learnshare
        2
    learnshare  
       Feb 7, 2018
    最好能发个 demo 出来,这么讲不好猜
    ghostgril
        3
    ghostgril  
    OP
       Feb 7, 2018
    谢谢大家了,问题解决了,代码不好发出来毕竟是公司的 code,问题出在 rounte-view 里面
    paloalto
        4
    paloalto  
       Feb 7, 2018
    哦 你说的「下方」指的是「后面」,我还以为是垂直方向的「下方」。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   896 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 20:46 · PVG 04:46 · LAX 13:46 · JFK 16:46
    ♥ Do have faith in what you're doing.