这是我的第一个 HTML 网站,我有一个小问题。在“关于我”部分,有三个不起作用的超链接(我无法点击它们)。但是,下拉菜单中的那些工作。知道为什么吗?
这是我的代码https://jsfiddle.net/2hkhmLef/
<p>
I am a 20 year old student studying at Concordia University in Montreal. Currently, I am in my
2nd year of education pursuing a Bachelors in Software Engineering. Up to now, my experience
has been wonderful. I meet great people that share similar interests, my network is growing day-by-day
and I learn things that interest me. The ultimate goal right now is to graduate and this website will
be used to explore everything I learn as I go. For my school assignments and personal projects, you can find
them in the <a href="#port_section" class = "intro_link">portfolio</a> section. For my personal weekly activities, you can find out what I've been
up to in the <a href="#" class = "intro_link">activities</a> section. Finally, if you are ever interested in checking out my other social
networks (GitHub, LinkedIn, etc...) or to contact me, you can go to the <a href="#" class = "intro_link">contacts</a> section.
</p>
您的.menu
hasheight: 100vh
和 is 位于nav
with 内position: fixed
,因此它始终占据视口的 100%,因此当您单击时,您总是单击.menu
.
如果将 css 更改为:
https://jsfiddle.net/2hkhmLef/1/
.menu {
width: 100%;
height: 92px;
margin-bottom: 100vh;
}
它仍然向下推内容,然后它不会阻止链接。
我在你的 html 中看不到图像,所以我无能为力,但是,这是超级hacky,我不推荐它,但如果你只需要链接可点击:
.menu {
width: 100%;
height: 100vh;
pointer-events: none;
}
.menu ul {
pointer-events: all;
}
也会解决这个问题。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句