【发布时间】:2020-03-16 19:25:42
【问题描述】:
希望大家帮忙。我目前正在学习 HTML 和 CSS 的在线课程。作为我课程的一部分,我正在练习制作网页。我遇到了标题 href 的问题。
我正在尝试从标题链接到正文中的某个位置。但是,当我在 chrome 上进行测试时,它不会显示为超链接。使用 chrome 的检查功能将其显示为链接,单击时它可以工作。但是它在检查之外不起作用。
我的 HTML 如下:
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
<link rel="stylesheet" type="text/css" href="landing.css">
</head>
<header>
<h1>
Heading
</h1>
<h2>Services <a href="#services_section"></a></h2>
<div class="tag-line">
</div>
</header>
<body>
<h3>
About
</h3>
<div class="about">
<h4 id="services_section">
<div class="services">
Services
</h4>
<h5>
<div class="contact">
Contact
</h5>
</body>
</html>
【问题讨论】:
-
如果您要链接到“服务”文本,请使用
<a href=...>Services</a>。当前代码显示文本“服务”,然后在其后显示一个零空间超链接。