..... I removed this because it was unclear, read edit......
This is the code.
<a href="index.html#about"style="color:black;">About</a>
In short: This code is used for 2 pages of website. 1 is working, but another does not work.
EDIT:
http://karolisweb.com/totochemical/index.html这是网站的链接。这很难理解,因为它不是英语,但我会尝试解释。当您在主页面中时,每个菜单链接都有效。我在此页面中使用<a href="#divName">
。然后,如果你按第一个菜单链接(Naujienos)也链接正在工作,这次我使用<a href="index.html#divName">
一切都很好,但当你去其他页面(点击红色汉堡和随机下拉链接)这段代码不管用。我正在尝试使用相同的<a href="index.html#divName">
当ID已在其他页面中使用时,如何使其他页面的链接正常工作?
答案 0 :(得分:1)
尝试改为(如果div在同一页面中):
<a href="#about"> ... </a>
答案 1 :(得分:0)
您需要使用<a name="about">
或使用<div id="about">
,以获取您要链接到的页面部分。如果您使用id
路线,请确保您的网页上只有 一个 元素,但是,它不起作用。使用id
选项可能仅某些浏览器支持,但自从我检查了它以来已经有一段时间了。
我把几个与你的问题联系起来。