<!DOCTYPE html>

<html lang="en">
<head>
<title>Contact Information</title>
       <meta charset="utf-8"/>
</head>

<h3><a href="directions.html" target="_self">See our Directions!</a></h3>

<p>We open at <time>12:00</time> Monday to Thursday.</p>

<hr/>

<address>Email us at<br/>
[email protected]<br/>
or call us at<br/>
(719)-555-0987</address>

<a href="directions.html">Directions</a>
<a href="Home.html">Home</a>
<a href="Menu.html">Menu</a>

<button type="button">C's Creamery</button>

</html>


我一直试图弄清楚为什么无论我做什么我的href链接都无法正常工作。我试图将其连接到的页面的名称与代码中的名称相似,所以我感到非常困惑。

最佳答案

您错过了一个body标签,然后关闭了标签..浏览器的行为会很糟糕;)

<!DOCTYPE html>

<html lang="en">
<head>
<title>Contact Information</title>
       <meta charset="utf-8"/>
</head>

<body>

<h3><a href="directions.html" target="_self">See our Directions!</a></h3>

<p>We open at <time>12:00</time> Monday to Thursday.</p>

<hr/>

<address>Email us at<br/>
[email protected]<br/>
or call us at<br/>
(719)-555-0987</address>

<a href="directions.html">Directions</a>
<a href="Home.html">Home</a>
<a href="Menu.html">Menu</a>

<button type="button">C's Creamery</button>

</body>
</html>

关于javascript - 网站href链接不起作用,如何解决?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/54779532/

10-10 11:06