简体   繁体   English

开头标签和结束标签之间的文字用语?

[英]The term for the text between the opening and the closing tag?

<span>foo</span> ,引用foo的正确术语是什么?

From the W3C XML Specification: 根据W3C XML规范:

Definition: The text between the start-tag and end-tag is called the element's content 定义:起始标签和结束标签之间的文本称为元素的内容

The content of the text child node of the <span> element. <span>元素的文本子节点的内容。

See quirksmode on this: 参见quirksmode

So if you do 所以如果你这样做

<P>This is a paragraph</P>

you have created two nodes: an element P and a text node with content 'This is a paragraph'. 您已经创建了两个节点:元素P和内容为“这是一个段落”的文本节点。 The text node is inside the element, so it is considered a child node of the element. 文本节点位于元素内部,因此被视为元素的子节点。

Personally I call it content or text 我个人称之为内容或文字

The content in the span is foo 范围中的内容为foo

This sounds correct IMO. 这听起来是正确的IMO。

Quoting from w3schools 从w3schools报价

An XML element is everything from (including) the element's start tag to 
(including) the element's end tag.    
An element can contain other elements, simple text or a mixture of both.
Elements can also have attributes.

<bookstore>
  <book category="CHILDREN">
    <title>Harry Potter</title>
    <author>J K. Rowling</author>
    <year>2005</year>
    <price>29.99</price>
  </book>
  <book category="WEB">
    <title>Learning XML</title>
    <author>Erik T. Ray</author>
    <year>2003</year>
    <price>39.95</price>
  </book>
</bookstore> 

In the example above, <bookstore> and <book> have element 
contents, because they contain other elements. <author> has 
text content because it contains text.

So, "text content" 因此,“文字内容”

I'd refer to it either as "content" or "text". 我将其称为“内容”或“文本”。

Given HTML as a markup language, you could also refer to it as "the described". 给定HTML作为标记语言,您也可以将其称为“描述的”。

Depends on context, to me. 对我来说,要视情况而定。

In Javascript it would be the innerHTML property. 在Javascript中,它将是innerHTML属性。

In HTML it is simply content: 在HTML中,它只是内容:

  • <span> is the start tag <span>是开始标记
  • foo is content foo内容
  • </span> is the end tag </span>是结束标记

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 preg_match-结束标记和开始标记之间的文本 - preg_match - text between closing and opening tag 如果开始和结束标签位于跨度开始和结束标签之间,则替换 li 标签 - Replacing li tag if it's opening and closing tag lies in between span opening and closing tag 捕获开始但不捕获结束标记 - Capture opening but not the closing tag ngIf用于关闭/打开标签 - ngIf for closing/opening tag 删除 html 和 JavaScript 中的结束标签和开始标签之间的空格 - Remove the spaces between the closing and opening tag in html with JavaScript Word表示打开和关闭HTML标签之间的文本 - Word meaning the text between opening and closing HTML tags 在XSLT中打开和关闭HTML标签 - Opening and closing HTML tag in XSLT 在VS Code中,如何选择“打开HTML标签”,“关闭HTML标签”以及之间的所有内容? - In VS Code, How Do I Select Opening HTML Tag, Closing HTML Tag and all the Things In Between? 当我将文本粘贴到开始标签中时,VS Code 将文本添加到结束标签 - VS Code adds text to closing tag when I paste it into opening tag 如何更改Sublime Text中的开始和结束标签突出显示,使其更加明显? - How do I change the opening and closing tag highlighting in Sublime Text so it's much more obvious?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM