New Feature: Playlist Center! Pick a topic and let our playlists guide the way.

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

Coding initial page structure

From: HTML5: Structure, Syntax, and Semantics

Video: Coding initial page structure

Once you've organized and structured your page content and identified the sectional elements you'll need, it's time to start coding the initial page structure. Like any workflow process, this step really comes down to personal preference. Some people start coding the page from the top down, and they code all of it at once, including all of the content; and others like to establish the overall document structure first, and this is especially true if they're creating templates or starter pages for other pages that are going to share the same structure. In this example, we're going to be coding just the basic structural elements of our page.

Coding initial page structure

Once you've organized and structured your page content and identified the sectional elements you'll need, it's time to start coding the initial page structure. Like any workflow process, this step really comes down to personal preference. Some people start coding the page from the top down, and they code all of it at once, including all of the content; and others like to establish the overall document structure first, and this is especially true if they're creating templates or starter pages for other pages that are going to share the same structure. In this example, we're going to be coding just the basic structural elements of our page.

More than anything else, this is to ensure that the page is structured properly for the content that we're going to be adding later. I always like to show people kind of where we're going, where we're going to end up. This is the finished page, so I'm viewing this finished page within the browser. You can find this, by the way, in the 04_04 folder, under trails. So we have our header content up top. As I scroll down a little bit--you've already seen the mockup, so this is kind of the finished HTML version of the mockup that we were looking at earlier. You can see on the left-hand side we have our section of trail reviews. Inside that, we have an individual article, the Northridge Loop, which goes down for a little while. It has some comments at the very bottom of it.

Then on the right-hand side, this right column, we have an article for rider reviews. Inside that, we have a couple of articles: We have the Los Robles Trail. We have some Trail Facts that we're going to deal with a little bit later. We have the Copper Canyon Loop, which is an independent article. Then we have some ad content which we're structuring in an aside element, and then finally, we have the footer element here at the bottom of the page. So really, if we're identifying these sort of main structural areas, we have the header; we have this section which has its individual content. It has a header for the section and then an article inside of it.

Over here, we have an article, rider reviews, which includes an article inside of that, two articles actually. We're going to leave off the Trail Facts for right now; we'll come back to that later. After our article, we have an aside which has all of our ad content in, and finally, we have a footer. So those are really the structural elements that we're going to concern ourselves with right off the bat. Switch back over to whatever authoring program that you're going to use. Again, I'm using Dreamweaver. And I have the trails file open from the 04_05, so 04_05, you want to open up trails from that.

Really basic page so far. Just the doctype declaration, html tag, a couple of things up in the head, but not much, and then just the body tag. So I'm going to go inside the body tag and start coding my page. So the first thing I want is a header element, so I'm just going to go in and I'm going to add a header element, and then I'll go ahead and close that header element. So again, I'm not worried about putting any content in here. I'm not worried about the internal structure of these sections. I just want to go ahead and define those default basic structural elements.

However, inside the header, we do want to go ahead and structure our nav. So inside the header, I'm going to go ahead and create a nav element, and we'll close that out. So in this case, our main page navigation is going to be included inside the document header. It doesn't always have to be that way. That's not a hard-and-fast rule. It just works for this particular structure. Okay, so remember, the first thing that people are going to encounter after the header is our initial section of the review. So I'm just going to do a section element.

Then inside that section, remember, we had its own header. So I'm going to go ahead and do a header inside the section, and also, we had a single article. Now, the single article was the one trail review, so I'm going to go ahead and code that as well. So inside of our section, we have the nested content of a header and then an individual article. After that section, we have another article, which is going to be the independent rider reviews, and that contained two individual reviews. So in addition to that, I want to go ahead and nest two article tags directly inside of that.

Now how you structure these right now is totally up to you. You can stack the tags, or you can do with nested content like I'm doing here. That's just so that it fits on my screen a little bit better, to be quite honest with you. After our rider review article, we have our ad content, and the ad content is going to be in an aside. So I'm going to go ahead and create an aside and then close the aside. Then remember, at the very bottom of our page, we have our footer content. So I'm going to go ahead and add a footer while I'm at it. Now, I'm going to go ahead and save the page.

Remember, in the footer we only have our copyright and some of our contact content. In this case, I don't want that to show up in the document element. Sometimes you do; in this case, I don't. So I want to make sure that that footer section doesn't show up there. So I'm going to go ahead and preview this in my browser. There's nothing on the page yet, so what I'm really interested in is just running one of these extensions. So it doesn't really matter whether you're doing this in Opera or whether you're using the HTML5 Outliner site. Or in this case, I'm going to use the Bookmarklet we created in Firefox. I can see that here I have the Untitled BODY tag. Good! There is my Untitled section--that's my header.

There's a nav section and title to that. Then I have my untitled section. I have an untitled article. The untitled article, two of those inside that, and then the aside, so the footer isn't showing up. Perfect! That is exactly what I want. So there's a lot to build out, but our initial page structure is complete, and now it's ready for content. Now, as you can see from the outline, a structure is there. But until we begin to add content and headings to identify it, the sections are just going to be listed as untitled. Before we move on to adding content, however, we do need to add a little bit more clarity to the structure, and give ourselves a few styling hooks.

So we're going to do that in our next movie by adding a few IDs and classes to our structural elements.

Show transcript

This video is part of

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

46 video lessons · 35076 viewers

James Williamson
Author

 
Expand all | Collapse all
  1. 2m 20s
    1. Welcome
      48s
    2. Using the exercise files
      1m 32s
  2. 19m 7s
    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 53s
  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

Are you sure you want to delete this note?

No

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.