W3C验证器错误(HTML5初学者)

时间:2017-09-06 23:37:20

标签: html css html5

所以我目前是HTML的初学者。我正在写一个基本页面,但我正在尝试一个名为hint.css的CSS文件。

我一直收到此验证错误:

enter image description here

守则:



<!DOCTYPE html>
<html lang="en">
  <link rel="stylesheet" href="hint.css" />
  <head>
    <meta charset="UTF-8"/>
    <title>First HTML learning page</title>
  </head>
  <body>
    <h2> HTML5, <span class="hint--bottom" aria-label="Web Dev!">Learning Page 
V1.</span></h2>
    <p>Using a combination of <span class="hint--bottom" aria-
label="HTML5,CSS3,JS,JQUERY,AJAX,PHP"><b>languages.</b></span>i will 
acomplish a dynamic web site</p>
  </body>
</html>
&#13;
&#13;
&#13;

3 个答案:

答案 0 :(得分:1)

正如@Aaron K在评论中提到的,样式表的链接标签必须在头部。请尝试以下方法:

<head>
    <meta charset="UTF-8"/>
    <title>First HTML learning page</title>
    <link rel="stylesheet" href="hint.css" />
</head>

答案 1 :(得分:0)

您的链接位于<head></head>标记之外,将其置于head标记内并且

答案 2 :(得分:0)

您的链接不在<head></head标记之内,像这样将其放在head标记内

<!DOCTYPE html>
<html lang="en">

  <head>
    <link rel="stylesheet" href="hint.css" />
    <meta charset="UTF-8"/>
    <title>First HTML learning page</title>
  </head>
  <body>
    <h2> HTML5, <span class="hint--bottom" aria-label="Web Dev!">Learning Page 
V1.</span></h2>
    <p>Using a combination of <span class="hint--bottom" aria-
label="HTML5,CSS3,JS,JQUERY,AJAX,PHP"><b>languages.</b></span>i will 
acomplish a dynamic web site</p>
  </body>
</html>