2014-02-17 60 views
0

我遇到了我創建並鏈接到特定頁面的下拉菜單的問題。下拉菜單鏈接問題與嵌套列表

我遇到的問題是我無法關注指向不同頁面的鏈接,因爲它試圖將瀏覽器導向不存在的目錄中的文件。例如。當我在主頁上,我下拉菜單並點擊我們的團隊時,它將直接進入我們的團隊頁面,但是一旦我在我們的團隊頁面上並下拉菜單,它會嘗試讓我「 about/resources/whateverpage.php「而不是」/resources/whateverpage.php「

我該如何設置它,因此它實際上將直接指向to/resources目錄而不是保留在/ about目錄中。我試過在鏈接之前使用「../」,但你可以猜測出現問題的地方。

同樣,由於我有鏈接指向about/ourteam.php(例如),當我在ABOUT菜單/目錄中並且我點擊ABOUT菜單中的另一個頁面時,它嘗試導致我約about/about/hours.php而不是about/hours.php

謝謝大家。

我的代碼如下:

<div id="menu"> 
      <ul><strong> 
      <li><a href="index.php" accesskey="1" title="">HOME&nbsp; |</a></li> 
      <li><a href="#" accesskey="2" title="">ABOUT&nbsp; |</a> 
        <ul> 
        <li><a href="about/ourteam.php">Our Team</a></li> 
        <li><a href="about/referralprocess.php">Referral Process </a></li> 
        <li><a href="about/financialpolicy.php">Financial Policy</a></li> 
        <li><a href="about/facility.php">Facility</a></li> 
        <li><a href="about/hours.php">Hours/Directions</a></li> 
        </ul> 
      </li>  
      <li><a href="#" accesskey="3" title="">EMERGENCY SERVICE &nbsp;|</a> 
        <ul> 
        <li><a href="emergencyservices/whatwedo.php">What We Do</a></li> 
        <li><a href="emergencyservices/howstaffed.php">How We Are Staffed</a></li> 
        <li><a href="emergencyservices/referralemerghandling.php">Emergency/Referral Procedure</a></li> 
        <li><a href="emergencyservices/typesofemerg.php">Types of Emergencies</a></li> 
        <li><a href="emergencyservices/whattoexpect.php">What to Expect On Arrival</a></li> 
        </ul> 
      </li> 
      <li><a href="specialtyservices.php" accesskey="4" title="">SPECIALTY SERVICE &nbsp;|</a> 
        <ul> 
        <li><a href="specialityservices/criticalcare.php">Critical Care</a></li> 
        <li><a href="specialityservices/internalmedicine.php">Internal Medicine</a></li> 
        <li><a href="specialityservices/surgery.php">Surgery</a></li> 
        <li><a href="specialityservices/rehab.php">Rehab</a><li> 
        </ul> 
      </li> 
      <li><a href="resources.php" accesskey="5" title="">RESOURCES &nbsp;|</a> 
        <ul> 
        <li><a href="resources/forms.php">Referral Forms</a></li> 
        <li><a href="resources/reorder.php">Brochure/Business Card Reorder</a></li> 
        <li><a href="resources/emergtopics.php">Emergency Topics</a></li> 
        <li><a href="resources/criticalcaretopics.php">Critical Care Topics</a></li> 
        <li><a href="resources/internalmedicinetopics.php">Internal Medicine Topics</a></li> 
        <li><a href="resources/surgerytopics.php">Surgery Topics</a></li> 
        <li><a href="resources/rehabtopics.php">Rehab & Fitness Topics</a></li> 
        <li><a href="resources/links.php">Links</a></li> 
        <li><a href="resources/directions.php">Directions/Map</a></li> 
        <li><a href="resources/wheretostay.php">Where to Stay</a></li> 
        <li><a href="resources/newsletter.php">Newsletter</a></li> 
        </ul> 
      </li> 
      <li><a href="communityevents.php" accesskey="6" title="">COMMUNITY EVENTS &nbsp;|</a></li> 
      <li><a href="careers.php" accesskey="7" title="">CAREERS &nbsp;|</a> 
        <ul> 
        <li><a href="careers/surgery.php">Surgery</a></li> 
        <li><a href="careers/neurosurgery.php">Neurosurgery</a></li> 
        <li><a href="careers/orthopaedic.php">Orthopaedic</a></li> 
        </ul> 
      </li> 
      <li><a href="contact.php" accesskey="8" title="">CONTACT</a></li> 

     </strong></ul> 

回答

0

你需要一個/添加到鏈接的前面。這些是相對的鏈接。

+0

我剛剛試過你的建議,現在它不會直接進入頁面。 – user1974107

+0

沒關係,它在我的電腦上不起作用,但是當它上傳到服務器時,它工作得很完美。謝謝! – user1974107