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

标签 css html

所以我目前是 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>

最佳答案

正如@Aaron K 在评论中提到的,样式表的链接标签必须在 head 内。请尝试以下操作:

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

关于css - W3C 验证器错误(HTML5 初学者),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46085755/

相关文章:

html - 伪类 :current

html - 将 div 并排放置,生成自己的宽度以填充父 div

html - 如何将大字体文本居中并让小字体文本底部对齐

html - 我们如何将所需的 CSS 应用于完整的 ionic 应用程序框架

html - 垂直居中内联内容

css - Angular-snap 不能与 ngSticky 一起使用

html - 在 div 中水平滚动

html - 如何在保持宽高比和相对于其他 div 的位置的同时垂直缩小 div?

javascript - 移动设备上的音频事件监听器不起作用

javascript - 使用 Smarty 模板的动态页面布局