head和body元素在html标记内的HTML文档中添加其他级别的组织。任何包含有关您网页信息的标记都会显示在head标记中。然后,任何带有页面内容(为用户显示的内容)的标记都会进入body标签。元数据元素(例如link , meta , title和style )通常位于head元素内。这是页面布局的示例: <!DOCTYPE html>
<HTML>
<HEAD>
<! - 元数据元素 - >
</ HEAD>
<BODY>
<! - 页面内容 - >
</ BODY>
</ HTML>
head和body 。 head元素应该只包含title , body元素应该只包含h1和p 。 head元素。
testString: 'assert($("head").length == 1, "There should be only one head element on the page.");'
- text: 页面上应该只有一个body元素。
testString: 'assert($("body").length == 1, "There should be only one body element on the page.");'
- text: head元素应该是html元素的子元素。
testString: 'assert($("html").children("head").length == 1, "The head element should be a child of the html element.");'
- text: body元素应该是html元素的子元素。
testString: 'assert($("html").children("body").length == 1, "The body element should be a child of the html element.");'
- text: head元素应该包围title元素。
testString: 'assert(code.match(/\s*?head element should wrap around the title element.");'
- text: body元素应该环绕h1和p元素。
testString: 'assert($("body").children("h1").length == 1 && $("body").children("p").length == 1, "The body element should wrap around both the h1 and p elements.");'
```
Cat ipsum dolor sit amet, jump launch to pounce upon little yarn mouse, bare fangs at toy run hide in litter box until treats are fed. Go into a room to decide you didn't want to be in there anyway. I like big cats and i can not lie kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff. Meow i could pee on this if i had the energy for slap owner's face at 5am until human fills food dish yet scamper. Knock dish off table head butt cant eat out of my own dish scratch the furniture. Make meme, make cute face. Sleep in the bathroom sink chase laser but pee in the shoe. Paw at your fat belly licks your face and eat grass, throw it back up kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.
```