javascript - 我无法获得以下 HTML 文档输出! (html-css-javascript)

标签 javascript html css performance frontend

[link for the css]:https://github.com/mdn/learning-area/blob/master/html/introduction-to-html/the-html-head/style.css

[link for javascript code file]:https://github.com/mdn/learningarea/blob/master/html/introduction-to-html/the-html-head/script.js


   <!DOCTYPE html>
   <html lang="en-US">
   <head>
     <meta charset="utf-8">
     <title>Meta examples</title>

     <meta name="author" content="Chris Mills">
     <meta name="description" content="This is an example page to demonstrate usage of metadata on web pages.">
     <meta property="og:image" content="https://developer.cdn.mozilla.net/static/img/opengraph-logo.dc4e08e2f6af.png">
     <meta property="og:description" content="This is an example page to demonstrate usage of metadata on web pages.">
     <meta property="og:title" content="Metadata; The HTML &lt;head&gt;, on MDN">
     <link rel="Shortcut Icon" href="favicon.ico" type="image/x-icon">
     <link rel="stylesheet" href="style.css">
    </head>
    <body>
     <h1>Meta examples</h1>
     <p>Japanese example: ご飯が熱い。</p>
     <script src="script.js"></script>
    </body>
   </html>

当我试图运行上面的 HTML 代码时,输​​出只是显示这个

Meta examples

japanese example:???

我正在努力学习成为一名前端开发人员,所以我刚开始接触 HTML,对此我很感兴趣。请任何人帮助我。 上面的 HTML 文档没有考虑 CSS 和 Javasricpt 文件,即使它们出现在同一目录中。我也尝试过使用不同的浏览器。

最佳答案

enter image description here请在链接标记的 src 属性中提供正确的路径,它应该可以工作。

检查:

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

<head>
  <meta charset="utf-8">
  <title>Meta examples</title>

  <meta name="author" content="Chris Mills">
  <meta name="description" content="This is an example page to demonstrate usage of metadata on web pages.">
  <meta property="og:image" content="https://developer.cdn.mozilla.net/static/img/opengraph-logo.dc4e08e2f6af.png">
  <meta property="og:description" content="This is an example page to demonstrate usage of metadata on web pages.">
  <meta property="og:title" content="Metadata; The HTML &lt;head&gt;, on MDN">
  <link rel="Shortcut Icon" href="favicon.ico" type="image/x-icon">
  <link rel="stylesheet" href="https://github.com/mdn/learning-area/blob/master/html/introduction-to-html/the-html-head/style.css">
</head>

<body>
  <h1>Meta examples</h1>
  <p>Japanese example: ご飯が熱い。</p>
  <script src="https://github.com/mdn/learningarea/blob/master/html/introduction-to-html/the-html-head/script.js"></script>
</body>

</html>

关于javascript - 我无法获得以下 HTML 文档输出! (html-css-javascript),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58395580/

相关文章:

javascript - 在chrome中选择渲染图片元素图片

javascript - 为什么我的图片没有加载?

javascript - 使用 CSS 在单击元素时创建 iPhone 样式滑出

html - 如何将结果 div 放置在搜索输入下方且宽度与输入相同?

css - 以背景图片为中心的链接

javascript - Ember 2,使用 Ember.run.debounce 调用路由中的函数

html - 颜色为 :#0000 is not shown 的文本

javascript - 获取 html 标签的样式属性

css - 可滚动涡轮表中的 PrimeNG 过滤器下拉问题

html - 为什么带有 Flex 的 HTML chalice 可以在 Chrome 上运行,但不能在 Firefox 上运行?