我是HTML5的新手任何人都可以帮我这个吗?

时间:2017-07-20 14:09:48

标签: html css

这里有什么问题?我必须为codeacademy练习提供id。

</head>
<body>

   <div class="header">
      <h1
    id="head-text"> 
      </h1>
    <div  > <!--Add an id to this div -->
     <h1> Travel Like Never Before</h1>
     <h2>Whether you're looking for adventure or luxury, let us help you 
     plan your perfect getaway.</h2>
    </div>

2 个答案:

答案 0 :(得分:1)

请遵循此代码

<div id="div_custom" > <!--  -->
     <h1> Travel Like Never Before</h1>
     <h2>Whether you're looking for adventure or luxury, let us help you 
     plan your perfect getaway.</h2>
    </div>

确保该ID在页面中是唯一的。

答案 1 :(得分:0)

您可以按如下所示添加它。

<div id="container"> <!--Add an id to this div -->
    <h1> Travel Like Never Before</h1>
    <h2>Whether you're looking for adventure or luxury, let us help you 
     plan your perfect getaway.</h2>
</div>