html 元素兄弟元素_正文(HTML元素)

html 元素兄弟元素

描述 (Description)

The body element wraps around all of the content that will be displayed on screen (or in other media, such as print), such as headings, paragraphs, images, tables, and so on. It has some unique attributes, including alink, link, and vlink, all of which are now deprecated, as well as a number of other attributes that aren’t defined in any standard but are, regrettably, still in common use. These are:

body元素环绕将在屏幕(或其他媒体,例如印刷品)上显示的所有内容,例如标题,段落,图像,表格等。 它具有一些独特的属性,包括alinklinkvlink ,现在已弃用所有这些属性,以及许多其他标准未定义的属性,但遗憾的是,它们仍在普遍使用。 这些是:

marginheight (marginheight)

sets the space between the top and bottom of the document content and the viewport (originally defined by Netscape 4)

设置文档内容的顶部和底部与视口之间的空间(最初由Netscape 4定义)

marginwidth (marginwidth)

sets the space between the left and right of the document content and the viewport (originally defined by Netscape 4)

设置文档内容左右和视口之间的空间(最初由Netscape 4定义)

topmargin/bottommargin (topmargin/bottommargin)

Internet Explorer’s equivalent of marginheight (allows us to set top and bottom margins separately)

Internet Explorer的marginheight等效项(允许我们分别设置顶部和底部页边距)

leftmargin/rightmargin (leftmargin/rightmargin)

Internet Explorer’s equivalent of marginwidth (allows the setting of left and right margins separately)

Internet Explorer的marginwidth等效项(允许分别设置左右边距)

Note that these attributes are no longer required to achieve the visual effects they were originally intended for—the equivalent CSS for these attributes is the margin property (or margin-top, margin-right, and so on), which is supported by all browsers.

请注意,不再需要这些属性即可获得最初预期的视觉效果-这些属性的等效CSS是margin属性(或margin-topmargin-right等),所有浏览器都支持。

All XHTML web pages require a body element, with the exception of frameset-based web pages, for which the appropriate frameset doctype must be declared. With HTML syntax (even with a strict doctype), it’s possible to omit the opening <body> and closing </body> tags and it will still validate (the browser creates it in the DOM regardless), but it’s best to include it nonetheless.

除基于框架集的网页外,所有XHTML网页都需要一个body元素,必须为其声明适当的框架集doctype。 使用HTML语法(即使使用严格的doctype),也可以省略开始<body>和结束</ body>标记,并且仍然可以验证(无论浏览器是在DOM中创建它),但是仍然最好将其包括在内。

In HTML and XHTML, you should not place character data (text) or inline elements such as span, em, or strong directly into the body. Instead, these should be contained inside block-level elements such as p elements, headings h1 – h6 and so on. However, if you use a transitional HTML4 or XHTML1 doctype, it is permissible for character data and inline elements to appear directly in the body, but this is deprecated.

在HTML和XHTML中,不应将字符数据(文本)或内联元素(例如span,em或strong)直接放入正文中。 相反,它们应包含在块级元素(例如p元素,标题h1-h6等)中。 但是,如果您使用过渡HTML4或XHTML1 doctype,则允许字符数据和内联元素直接显示在正文中,但已弃用。

(Example)

The body contains all the content that’s to be made visible to the user:

body包含将对用户可见的所有内容:

<body>
  <h1>101 Ways to make a paper aeroplane</h1>
  <p>Let's start with the basics …</p>
  ⋮
</body>

将此用于… (Use This For …)

Use body to hold all the document content that you want to be visible to the reader.

使用body保存您希望对读者可见的所有文档内容。

翻译自: https://www.sitepoint.com/body-html-element/

html 元素兄弟元素

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值