为什么评论会显示在网页

时间:2017-04-06 02:49:50

标签: html

我尝试完成的任务:设置我的代码中的评论不会显示在实际网页上。 [在此输入图像说明] [1]

我正在谈论的评论写在" GoalBike"

这个词的上面部分。

代码:                所以我认为这是一个变量     并将图像设置为该变量,然后设置 - >

<!--> remmber to comment-->

<!--> <br />  might mean to break, or to skip a line-->

<!--> depending where you close or have the closing statement for the center command is where the stuff 
will and will not be centerd. eg. like if I had closing statement at the top and closed it at the top 
then to have other stuff be centered on the webpage I would have to write the center command, 
or I could just write the center command and put all the elements that I want to be cented on the page within an then close the center command-->

  <head>
    <title>An Unexpected Journey</title>20:27 04/05/17
    <link href='https://fonts.googleapis.com/css?family=Playfair+Display:900|Raleway:300' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="style.css">
  </head>
  <body>
    <div class="container">
        <h1>GoalBike</h1>
      <a class="btn" href="#">Get Started</a>
    </div>
  </body>
</html>

2 个答案:

答案 0 :(得分:1)

HTML评论的语法如下:

<!-- Comment goes here -->

答案 1 :(得分:1)

你对h​​tml评论进行了一些小改动。在查看评论时,您输入的内容为<!--> remmber to comment-->,因此根据HTML,这不是评论,而是必须使用''

以下是HTML代码,其中注释语法中的更改有效

<!-- remmber to comment-->

<!-- <br />  might mean to break, or to skip a line-->

<!--depending where you close or have the closing statement for the center command is where the stuff 
will and will not be centerd. eg. like if I had closing statement at the top and closed it at the top 
then to have other stuff be centered on the webpage I would have to write the center command, 
or I could just write the center command and put all the elements that I want to be cented on the page within an then close the center command-->
<!DOCTYPE html>
<html>
  <head>
    <title>An Unexpected Journey</title>20:27 04/05/17
    <link href='https://fonts.googleapis.com/css?family=Playfair+Display:900|Raleway:300' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="style.css">
  </head>
  <body>
    <div class="container">
        <h1>GoalBike</h1>
      <a class="btn" href="#">Get Started</a>
    </div>
  </body>
</html>