What are content categories for?

Asked

Viewed 60 times

4

Recently I discovered that in HTML5 there are categories that are called Content Categories (content categories) and are they:

  • Metadata content
  • Flow content
  • Sectioning content
  • Heading content
  • Phrasing content
  • Embedded content
  • Interactive content
  • Palpable content
  • Form-Associated content
  • Script-supporting Elements

Source: MDN Web Docs

I would like to know what these categories are for? and how to use them?

  • 1

    It seems to me that they serve only as a guide to how HTML elements should be used. i.e Sectioning Content should be used to sectione (separate/divide) your HTML page into parts (header, menu, body, etc..).

  • 1

    What do you mean by "how to use them"? It is common to categorize the types of elements that a given tag can receive, such as What are the allowed elements within the <P tag>? Is that kind of use you refer to?

  • They’re not used by you, they’re used to document. Each html element will be categorized according to its properties and usage within each group of these

  • Woss, wasn’t that was about what these categories are

  • Hugocsl, so only serves to organize the elements?

  • If yes! then because the element <caption> is not in those categories?

Show 1 more comment

1 answer

0

To HTML5 documentation describes the Content Categories in this way:

Each element in HTML falls into zero or more categories that group elements with similar characteristics.

If you read this document, you will see that these categories organize, roughly speaking, the elements with which you will work on marking a page. It’s like he’s talking to you "Look, you can mark HTML however you want, but not everything is the way you expect it to be. And, to make your life easier, we organize the elements according to their functions and characteristics in relation to other elements."

For example, let’s look at the Heading Content category.

4.1.5 Heading content

Heading content includes the Elements for marking up headers. Headings, in Conjunction with the sectioning Elements, are used to describe the Structure of the Document.

Heading content includes the header element and the h1 to h6 Elements.

Elements categorised as Heading content are considered to be flow content.

Here we have the description of the elements that make up the header content. That is to say, in this category, you should use the elements that belong to it to do what you really need to do, which is to set headers or headings in the document snippets that are necessary. In other words, you should mark a title or a header block with the elements that have been assigned to it. For example, in the composition of a layout we commonly have a navbar, sidebar, main and footer. But usually many don’t score navbar in the element header.

Many developers consider using footer, but not header. And facts like this that Categories content try to clarify us. See:

4.3.4.8 The footer element

The footer element represents a footer of a Section, typically containing information such as who wrote it, links to Related Documents, and copyright notices.

Just before footer, we have

4.3.4.7 The header element

The header element represents the header of a Section, typically containing Headings and subheadings, and other Metadata about the Section.

The description of these elements still helps us to understand their role in the context of Htmlmarkup in general.

Think of these categories as sets and subsets. Some elements do not belong to any specific set. Others belong to more than one set, as in the case of Heading content "Elements categorised as Heading content are considered to be flow content".

Finally, these categories guide us to write a more correct and coherent HTML, using the elements according to the functions for which they were created to perform.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.