2017-01-26 168 views
0

這是我第一次製作網站,我似乎無法讓我的書籤鏈接「即將發生的事件」在我的其他頁面中工作。它只適用於主頁。這裏是我的主頁代碼:將html書籤從一個頁面鏈接到另一個頁面

<nav> 
    <b> 
    <a href="index.html">Home</a> 
    <a href="rides.html">Rides</a> 
    <a href="info.html">Info</a> 
    <a href="order.html">Order</a> 
    <a href="#UpcomingEvents">Upcoming Events</a> 
    <a href="#RelatedNews">Related News</a> 
    </b> 
</nav> 
<hr> 

<h2>About Us</h2> 
<p>Fun is always in season at Busch Gardens ® Williamsburg in Virginia. From thrilling coasters and kid-friendly attractions to world-class dining and shows, there’s something for the whole family.<br> 
Busch Gardens is one of the my favorite amusment parks because of their setup. It's wonderful to be in the 'Germany' part of the park in one moment and then the "Roman" part the next! </p> 
<hr> 

<h3 id="UpcomingEvents">Upcoming Events</h3> 
<p>Das Festhaus: March 31<br> 
Britmania: June 30<br> 
Summer Nights: July 1 - August 31<br> 
Howl-O-Scream: September 23 - October 29</p> 
<hr> 

<h4 id="RelatedNews">Related Park News</h4> 
<!-- include your links here --> 
<p><a href="https://seaworldparks.com/en/buschgardens-williamsburg/food-and-wine">Food and Wine Festival</a></p> 
<p><a href="https://seaworldparks.com/en/buschgardens-williamsburg/kidsiderate?from=HomeCollection">Kidsiderate</a></p> 

<p><a href="https://seaworldparks.com/en/buschgardens-williamsburg/christmastown?from=BGWhome">Christmas Town</a></p> 

這是我的訂單頁面的代碼:根據您所提供的信息

<a href="index.html">Home</a> 
    <a href="rides.html">Rides</a> 
    <a href="info.html">Info</a> 
    <a href="order.html">Order</a> 
    <a href="html_UpcomingEvents.html#UpcomingEvents">Upcoming Events</a> 
    <a href="html_Related News.html#Related News">Related News</a> 

<hr> 
<h2>Order Information</h2> 
<p>Our online ordering page is down currently. Please check back later in a few weeks.</p> 
</body> 

+0

哪個html文件位於'#UpcomingEvents' ID? –

+0

您需要確保文件'html_UpcomingEvents.html'確實存在,並位於您的'我的訂單頁面'的同一個文件夾中。還要確保在'html_UpcomingEvents.html'中存在id =「UpcomingEvents」。 – noob

+0

如果您認爲它在您的主頁中可以正常工作,那麼請將不工作的html鏈接更改爲:index.html#UpcomingEvents –

回答

0

,非工作html上的鏈接應改爲:

<a href="index.html#UpcomingEvents">Upcoming Events</a> 
相關問題