-2

..... 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 this is the link of website. It's hard to understand as it is not in english language, but I will try to explain. When you are in the main page every menu link works. I am using <a href="#divName">in this page. Then, if you press first menu link (Naujienos) also links are working and this time I am using <a href="index.html#divName">Everything is just fine, but when you go on other page (click on red hamburger and random dropdown link) this code is not working. I am trying to use same <a href="index.html#divName"> How do I make these links from another pages to work when the ID is already ued in other page?

Karolis
  • 1
  • 1
  • 4

2 Answers2

1

Try instead (if the div is in the same page):

<a href="#about"> ... </a>
0

You'll need to use <a name="about"> or use <div id="about">, for the section of the page you're wanting to link to. If you go the id route, make sure there is only one element on your page with that id, otherwise, it won't work. Using the id option may only be supported by certain browsers, but it's been a while since I've checked on that. I've linked a couple of questions that are the same as yours.

How do I link to part of a page? (hash?)

Link to an element within the current page

Community
  • 1
  • 1
Tiffany
  • 609
  • 12
  • 26