From my point of view, content has come to be defined as two separate things in HTML:
1) All of the information between the open and closed body tags that is visible on a webpage.
2) That which is visible on a webpage that is placed between any open and closed tags.
This may seem knit-picky, but it's important when teaching the concept of HTML content -- I believe in establishing and holding consistent definitions when teaching computer programming terminology.
Is number one correct? -- in which case the
<title> would not have content. Or is number two correct? -- in which case
<title> would have content.
Best How To :
"Content" in the context of HTML is not subjective. We are lucky enough to have a spec which defines everything, so there's no "point of view" to be had. The spec clearly defines every element's content model, which is defined as "A normative description of what content must be included as children and descendants of the element."
Each element defined in this specification has a content model: a description of the element's expected contents. An HTML element must have contents that match the requirements described in the element's content model. The contents of an element are its children in the DOM, except for
template elements, where the children are those in the template contents (a separate
DocumentFragment assigned to the element when the element is created).
The spec dictates that the
<title> element's content model is
Text that is not inter-element whitespace.
Nothing more, and nothing less.