我的代码工作中的所有链接除了这些链接
这是我的HTML代码SOFAR的
<header>
<div class="logo">
<a href=""><img src="Images/samsung-logo.png" alt="Samsung Logo" width="150"></a>
<ul class="menubalk">
<a href=""><li>Contact</li></a>
<a href="#assortiment-scroll"><li>Assortiment</li></a>
</ul>
</div>
</header>
<div class="bg">
<video src="videos/S22-Ultra-unboxing.mp4" muted loop autoplay></video>
<div class="bg-text">Nieuwe S22 Ultra</div>
<a href=""><div class="bg-text-url">Discover</div></a>
</div>
最后一个链接,带有class =“ bg-text-url”
工作,但前3个不做。 是我看不到某些内容还是...
编辑:当我刚开始启动项目时,它确实有效。此后,我还没有将任何内容更改为header
。
为了使它更容易:
This is my html code sofar
<header>
<div class="logo">
<a href=""><img src="Images/samsung-logo.png" alt="Samsung Logo" width="150"></a>
<ul class="menubalk">
<a href=""><li>Contact</li></a>
<a href="#assortiment-scroll"><li>Assortiment</li></a>
</ul>
</div>
</header>
<div class="bg">
<video src="videos/S22-Ultra-unboxing.mp4" muted loop autoplay></video>
<div class="bg-text">Nieuwe S22 Ultra</div>
<a href=""><div class="bg-text-url">Discover</div></a>
</div>
The last link with class="bg-text-url"
work but the first 3 don't.
Am I not seeing something or ...
EDIT: when I first started the project it did work. And I haven't changed anything to the header
since.
To make it easier: https://jsfiddle.net/x7ewtvqu/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
元素
a
在此上下文中不允许作为元素的孩子ul
。同样,当您使用
div
elementa
不允许作为父母的孩子时。Element
a
not allowed as child of elementul
in this context.Also when you using a
div
elementa
not allowed as a parent child.您的锚定标记不起作用的原因是使用
display:inline;
样式和位置:absolute;
。要解决此问题,请更新您的样式,以使其准确地更新为 this jsfiddle。我还纠正了您的一些语法。The reason why your anchor tags are not working is a combination of using
display: inline;
styles andposition: absolute;
. To fix this issue, update your styles to be accurate to this JSFiddle. I have also corrected some of your syntax.在
中使用
标签在语义上是不正确的。您应该使用div
a跨度
标签。不要在
a
标签中使用li
。在li
标签中使用a
。如果要使用
div
在a
标签中只需使用:或使用:
using
div
ina
tag is semantically incorrect. You should usespan
tag.don't use
li
ina
tag. Usea
inli
tag.if you want to use
div
ina
tag just use:or use: