Search code examples
htmlhyperlinkbookmarks

How do I make a bookmark using id and link work as a proper link?


<!DOCTYPE html>
<html lang="en-US">

<head>
  <title>Shanghaiers' TV &amp; Radio - Television</title>
  <meta charset="UTF-8">
  <meta name="description" content="">
  <meta name="keywords" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="style-tvradio.css">
  <link href="https://fonts.googleapis.com/css?family=Goudy+Bookletter+1911" rel="stylesheet">
  <base href="NEED MAIN WEBSITE ADDRESS HERE">
</head>

<body>	
  <h3>Shanghaiers' Television</h3>
  <section>
	<div>
	  <ul>
	    <li><a href="tv/allvideos.html">All Videos</a></li>
		<li><a href="#concert">Concerts</a></li>
		<li><a href="#nn">Native Nations</a></li>
		<li><a href="#human">Human Trafficking</a></li>
		<li><a href="#sacred">Sacred Lands</a></li>
		<li><a href="#story">Story Telling</a></li>
		<li><a href="#bigfoot">Big Foot &amp; Sasquatch</a></li>
		<li><a href="#interview">Interviews</a></li>
		<li><a href="#psa">Public Service Announcements</a></li>
		<li><a href="#shanghai">Shanghai Tunnels</a></li>
	  </ul>
	</div>
  </section>
  
	<h3 id="concert">Concerts</h3>
		  <p>en Taiko</p>
		  <p>Maiah Wynee</p>
  
    <h3 id="nn">Native Nations</h3>
		<p>Native American Music</p>
		<p>Occupation of Malheur Wildlife Refuge</p>
		<p>NAYA Canoe Family</p>
		<p>Grand Ronde Tribe Disenrollment &amp; Chinook Language</p>
   
    <h3 id="human">Human Trafficking</h3>
       <p>More info here...</p>

    <h3 id="sacred">Sacred Lands</h3>
       <p>More info here...</p>

    <h3 id="story">Story Telling</h3>
       <p>More info here...</p>
  
</body>
</html>

I have created bookmarks on a page to jump from a navigation menu to other spots on the page. This was done using id="name"; with place in the navigation menu. When testing the code these bookmarks/links don't work. They either do nothing or show an error message that the page cannot be found.

Found something that said placing an extra '#' in the anchor tag would solve the problem. This does nothing. Ex. - .

Any suggestions on how to correct the problem so the bookmarks actually work as links?


Solution

  • You just need to remove your faulty baseref tag to make it work.

    <!DOCTYPE html>
    <html lang="en-US">
    
    <head>
      <title>Shanghaiers' TV &amp; Radio - Television</title>
      <meta charset="UTF-8">
      <meta name="description" content="">
      <meta name="keywords" content="">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <link rel="stylesheet" href="style-tvradio.css">
      <link href="https://fonts.googleapis.com/css?family=Goudy+Bookletter+1911" rel="stylesheet">
    </head>
    
    <body>
      <h3>Shanghaiers' Television</h3>
      <section>
        <div>
          <ul>
            <li><a href="tv/allvideos.html">All Videos</a></li>
            <li><a href="#concert">Concerts</a></li>
            <li><a href="#nn">Native Nations</a></li>
            <li><a href="#human">Human Trafficking</a></li>
            <li><a href="#sacred">Sacred Lands</a></li>
            <li><a href="#story">Story Telling</a></li>
            <li><a href="#bigfoot">Big Foot &amp; Sasquatch</a></li>
            <li><a href="#interview">Interviews</a></li>
            <li><a href="#psa">Public Service Announcements</a></li>
            <li><a href="#shanghai">Shanghai Tunnels</a></li>
          </ul>
        </div>
      </section>
    
        <h3 id="concert">Concerts</h3>
        <p>en Taiko</p>
        <p>Maiah Wynee</p>
    
        <h3 id="nn">Native Nations</h3>
        <p>Native American Music</p>
        <p>Occupation of Malheur Wildlife Refuge</p>
        <p>NAYA Canoe Family</p>
        <p>Grand Ronde Tribe Disenrollment &amp; Chinook Language</p>
    
        <h3 id="human">Human Trafficking</h3>
        <p>More info here...</p>
    
        <h3 id="sacred">Sacred Lands</h3>
        <p>More info here...</p>
    
        <h3 id="story">Story Telling</h3>
        <p>More info here...</p>
    
    </body>
    
    </html>