<!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/>
cscreamery@gmail.com<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链接不起作用。我尝试将其连接到的页面的名称与代码中的名称相似,所以我感到非常困惑。
答案 0 :(得分:1)
您丢失了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/>
cscreamery@gmail.com<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>
答案 1 :(得分:0)
请像Home.html一样检查您用于href的其他HTML页面是否位于您的主要HTML页面所在的文件夹中。
我已经从上述代码创建了sample.html页面,并用我的页面替换了Home.html页面 它正在工作。
<!DOCTYPE html>
<html lang="en">
<head>
<title>Contact Information</title>
<meta charset="utf-8"/>
</head>
<h3><a href="relation.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/>
cscreamery@gmail.com<br/>
or call us at<br/>
(719)-555-0987</address>
<a href="relation.html">Directions</a>
<a href="role.html">Home</a>
<a href="model.html">Menu</a>
<button type="button">C's Creamery</button>
</html>
我使用了chrome。我已经将所有HTML页面(例如webapp / app / view / sample.html)放到了view /
答案 2 :(得分:-2)
<html>
<body>
<a href="mailto:cscreamery@gmail.com"></i>Email us at
cscreamery@gmail.com</a>
or
<a href="tel:(719)-555-0987"></i>call us at
(719)-555-0987</a>
</body>
</html>