Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Content model overview

From: HTML5: Structure, Syntax, and Semantics

Video: Content model overview

You may have noticed when we were looking at the new HTML5 elements, the specification listed which categories of elements the elements belonged to. These categories refer to the new content models in HTML5. Since they present a huge shift in how content is defined, it's important to understand how these content models in HTML5 work. In HTML 4, elements typically belonged to one of two content models, either block-level or inline. Block-level elements, such as paragraphs, div tags, and headers, would occupy their own line within the document flow, whereas links, emphasis tags, spans, things like that, those were inline level elements, and they're typically found within the content of block-level elements.

Content model overview

You may have noticed when we were looking at the new HTML5 elements, the specification listed which categories of elements the elements belonged to. These categories refer to the new content models in HTML5. Since they present a huge shift in how content is defined, it's important to understand how these content models in HTML5 work. In HTML 4, elements typically belonged to one of two content models, either block-level or inline. Block-level elements, such as paragraphs, div tags, and headers, would occupy their own line within the document flow, whereas links, emphasis tags, spans, things like that, those were inline level elements, and they're typically found within the content of block-level elements.

Now for the most part, it was this distinction that determined document structure. Now because of the increased emphasis on semantics and structure in HTML5, several new content models have been introduced. Now what's more, elements may actually now belong to more than one content model category. This allows you as now author to create more sophisticated document structures and to write more meaningful code. So I want to illustrate this a little bit using the actual specification, so here I am in the author view, and I am in section 3.25, the Content models.

And I just want to scroll down a little bit because there is a list of the content models. Here we go. So we have seven types of content now inside HTML5. So metadata content, flow content, sectioning content, heading, phrasing, embedded, and interactive content. Now let's take a look at these individually, and I'm going to do them slightly out of order than the list has them here because I want to emphasize a couple of these towards the end. So the first one I want to take a look at is metadata content. Now metadata content, again, it's content that sets up the presentation or the behavior of the rest of the content, and you'll primarily find these elements in the head of the document.

Sample elements could be a like the link tag, the meta tag, noscript, script, and title elements. I'm just going to hit the Back button to go back up to this list, and I'll just continue to kind of go back and forth here. Now the next one I want to talk about is embedded content. Embedded content is any content that imports other resources into your document. So some of these elements might be the object element, video, canvas, so you've probably heard a lot about video and canvas, and the embed element. So these are all part of the embedded content model.

Going back up to our list, I next want to take look at interactive content. Now interactive content is any content that is specifically intended for user interactions, such as user interfaces, forms, and controls. Some of the sample elements include the link tag, a tag, details which may or may not remain in the specification. It hasn't been implemented yet. There is a lot of debate about that. The object element and the video element, if the controls are enabled on the video, that would obviously make something that you could interact with. So notice that a trend is developing here, that most of the time instead of looking at to how the browser should display the content, it's really focusing on the type of content that you're describing.

Now, if we go back to our list, the next one I want to talk about is heading content. Now the heading content defines the header of a section. Now this can be either explicitly marked up with sectioning elements, or it can be implied by the heading content itself. Now heading content elements contain all the heading tags that you are really familiar with, h1 through h6, and something that you might not be similar with-- the hgroup element. I do want to point out something here. Look at all the elements that are listed here as belonging to the heading content. The header is not in it.

So the header element itself is not considered part of the heading content; it's merely a section of introductory content. So even though you might automatically sort of place it there, it doesn't really go there. And the next content model I want to take a look at is phrasing content. There are a lot of things going on here. Phrasing content is really the text of the document, as well as any elements that are used to mark up the text within paragraph level structures. And in many ways, the phrasing content is sort of the same as inline level elements from the HTML 4 specification.

So you can see there are a lot of elements involved here. Some of them are the link tag, a tag, emphasis tag, image, a label mark, which we'll cover a little bit later on, span tag, and the strong tag. Now there is a note here that I want to read, "Most elements that are categorized as phrasing content can only contain elements that are themselves categorized as phrasing content, not just any flow content." So there is that sort of kind of inline nature of them, that most things that are considered phrasing content can only contain other elements that are phrasing content.

Now that's not a hard-and-fast rule. There are exceptions to that, and we're going to see some of those exceptions a little bit later on. Next, I want to cover a little bit about flow content. Now, flow content, this is the big one. This contains the majority of all of your elements in HTML5. You can think of these elements as elements that would be included in the normal flow of the document. Although we're looking at the author's view of the specification, it is important here to mention something from the larger specification. How flow content is displayed is left entirely up to the user agent.

There are no rules governing whether the content displays as inline or block-level elements. Don't assume that just because it's flow content that it's going to be a block-level tag or display as a block-level element. Some of the sample elements here, once again the link tag, a tag, anchor tag--we're seeing that everywhere, right? article, aside, blockquote, canvas, details, the div tag, and emphasis tag, form tag, heading tags, hgroup, nav. I mean I can go on and on here. As you can see, really, if it can fill within the body tag, it's probably considered part of the flow content.

Now the last group of content that I want to describe, and I did save this for last on purpose, is the one that we've been referencing all throughout this chapter, and that's sectioning content. Sectioning content is content that defines the scope of the headings and the footers. It's really important to say that. This defines the scope of them. Any use of these elements creates a brand-new section within the document, and that's something that's really, really crucially important, that we're going to talk about in an entire chapter all by itself. So I am going to say it again, use of these elements creates a new section within the document. We don't have very many of these.

Notice that the only sectioning elements that are listed are the article, aside, nav, and section elements, and those are all of course things that we've been using for a while now. You may have noticed at this point that several elements appeared on the multiple content models. For example, it seemed like no matter which one we went to, there was the anchor tag. I am going to scroll down a little bit here directly from this list that we've been using, and show you this Venn diagram that is here in the specification. Basically, I'm going back to that anchor tag, it's part of the flow, phrasing, and interactive content models, depending upon how it's being used.

So as you can see from this diagram, there are several overlapping areas of content types. Now, almost all content is contained within the flow content model. The phrasing, embedded, interactive, and metadata, they're all somewhat related to each other. Sectioning and heading content are separate within the flow content, and those guys what you're going to use to define the document structure and outline. So this diagram helps to sort of explain that relationship. Keep in mind that HTML5 is concerned with the structure of the markup of content, not the presentation, whereas before, when you had rules about how block-level and inline level element should be displayed, now the display of the elements is left entirely up to the user agent and the CSS that the author is going to employ. While there are rules about which elements can be contained within one another, there is nothing to stop you from displaying images as block-level elements and list items as inline-level elements.

This is really nothing new; authors have been able to do that through CSS for years now. So for the most part, it's simply the HTML specification finally reflecting the reality of how HTML and CSS should work together.

Show transcript

This video is part of

Image for HTML5: Structure, Syntax, and Semantics
HTML5: Structure, Syntax, and Semantics

46 video lessons · 35826 viewers

James Williamson
Author

 
Expand all | Collapse all
  1. 2m 20s
    1. Welcome
      48s
    2. Using the exercise files
      1m 32s
  2. 18m 41s
    1. A brief overview of HTML5
      3m 57s
    2. What's in the HTML5 specification?
      8m 17s
    3. Why do we need new structural elements?
      6m 27s
  3. 50m 33s
    1. Defining HTML5 documents
      5m 5s
    2. HTML5 syntax
      9m 14s
    3. The header element
      5m 22s
    4. The nav element
      4m 55s
    5. The section element
      4m 51s
    6. The article element
      4m 48s
    7. The aside element
      4m 13s
    8. The footer element
      4m 17s
    9. Content model overview
      7m 48s
  4. 35m 28s
    1. Understanding the outline algorithm
      3m 17s
    2. Creating document sections
      8m 25s
    3. Using headings properly
      9m 1s
    4. Using hgroup to override sectioning
      4m 17s
    5. Properly nesting structure
      7m 17s
    6. Sectioning roots
      3m 11s
  5. 58m 30s
    1. Organizing content
      4m 41s
    2. Planning document structure
      5m 47s
    3. Choosing the right structural element
      4m 43s
    4. Checking document outlines
      5m 27s
    5. Coding initial page structure
      5m 28s
    6. Using class and ID attributes
      5m 31s
    7. Structuring headers
      13m 13s
    8. Building navigation
      7m 1s
    9. Structuring footers
      6m 39s
  6. 1h 27m
    1. Working with figure and figcaption
      7m 12s
    2. Grouping content with asides
      3m 46s
    3. Using divs in HTML5
      5m 0s
    4. Working with lists in HTML5
      7m 10s
    5. The return of bold and italic
      5m 52s
    6. Citing works semantically
      6m 32s
    7. Using the address element
      5m 24s
    8. Using the small element
      4m 24s
    9. Using the mark element
      5m 16s
    10. Working with date and time
      11m 55s
    11. Creating block-level links
      8m 53s
    12. Understanding link relationships
      9m 28s
    13. Defining link relationships
      6m 23s
  7. 17m 22s
    1. Current browser support
      7m 38s
    2. Ensuring block-level display
      4m 3s
    3. Adding support for elements in older browsers
      5m 41s
  8. 3m 46s
    1. Additional Resources
      3m 46s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed HTML5: Structure, Syntax, and Semantics.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.