p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning HTML, XHTML, CSS, and JavaScript (http://p2p.wrox.com/forumdisplay.php?f=541)
-   -   Problem Linking back to same page (http://p2p.wrox.com/showthread.php?t=92540)

ananta1990 March 28th, 2014 08:25 AM

Problem Linking back to same page
Hello folks!!!

Its very irritating but I had once easily linked back to links on same page. but somehow this isn't working now.Any help in debugging the following code?

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  <title>Example Cafe-community cafe in Newquay,Cornwal,UK</title></head>
<h1>Example Cafe</h1>
<a href=“index.html”>HOME</a>
<a href=“recipes.html”>RECIPES</a>
<a href=“contact.html”>CONTACT</a>
<h2><a id=“top”>Example Cafe Menu</a></h2>
<h2><a id=“starters”>Starters</a></h2>
<h2><a id=“main courses”>Main Courses</a></h2>
<h2><a id=“desserts”>Desserts</a></h2>
<a href=“#starters”>Starters</a>|
<a href=“#maincourses”>Main Courses</a>|
<a href=“#desserts”>Desserts</a>
<h2><a id=“starters”>Starters</a></h2>
<li>Chestnut and mushroom Goujons</li>
<li>Paneer Chatpati</li>
<li>Mushroom Fry</li>
<li>Chicken Lollipop</li>
<p><small><a href=“#top”>Back to top</a></small></p>

<h2><a id=“starters”>Starters</a></h2>
<li>Spinach and ricotta roulade</li>
<li>Beef tornado with mustard</li>
<li>Veg Hakka</li>
<li>Chicken Fried Rice</li>
<p><small><a href=“#top”>Back to top</a></small></p>

<h2><a id=“desserts”>Desserts</a></h2>
<li>Fruit Delight</li>
<li>Vanilla creamsticks</li>
<p><small><a href=“#top”>Back to top</a></small></p>


bitnap March 29th, 2014 12:26 PM

Try deleting the h2 elements at the top of the page. The id attributes will conflict with those later down the page.

And in the body of the page you seem to have the starters repeated.

Hope that helps!

ananta1990 March 29th, 2014 02:19 PM

I got the issue rectified. Used the

attribute instead of

attribute. HOwever , still uable to figure out why the id attribute didn't function. [:o]

All times are GMT -4. The time now is 01:44 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.