We launched a new IT training category! Check out the 140+ courses now.

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

Touring the HTML

From: HTML Essential Training (2012)

Video: Touring the HTML

In this movie, we will look at the HTML for the Rock Paper Scissors website. The first page of this site is the rps.html file, and you'll find this in your Chapt17 folder in the exercise files, and it's rps.html. Open this in the text editor, and you see it's a very short file. And mostly, it contains the Rock Paper Scissors game from my HTML5 Drag and Drop course here on lynda.com, so how that works is actually explained in that other course.

Touring the HTML

In this movie, we will look at the HTML for the Rock Paper Scissors website. The first page of this site is the rps.html file, and you'll find this in your Chapt17 folder in the exercise files, and it's rps.html. Open this in the text editor, and you see it's a very short file. And mostly, it contains the Rock Paper Scissors game from my HTML5 Drag and Drop course here on lynda.com, so how that works is actually explained in that other course.

That's a feature that uses a lot of JavaScript, and it's not really so much about the HTML part of HTML5 as it is about some of the other APIs from HTML5. So if you want to understand how this drag-and-drop game works, then I suggest you look at that course. That's HTML5: Drag and Drop Iin Depth, here on the lynda.com online training library. So here at the top of this rps.html file, we have our CSS, which we will talk about in the other movie here in this chapter, and we call in the JavaScript for this Rock Paper Scissors game.

Then we have our top menu, which is done with the UL element, and it's styled with CSS. And you see that's this part up at the top here of each of these pages, and as we click through each of these pages, you see that it's exactly the same menu with exactly the same code. Next, we have the header, and that's in this header element, which is a semantic element for marking up the header of a web page. And you see we have the header part right up there. Then we have the rps game, which is in a section element because it doesn't really fit in any of the other semantic elements. And then we have a footer element down here at the bottom, and that's this footer at the bottom.

And again, that's the same on all of these pages. So next up is our Rock page and that's in rock.html, open that up in the text editor. Again, we have our style sheets at the top, and we will cover that later. The menu is exactly the same. The header is exactly the same, except it has different words in it. And then we have the Theme Song, and you'll notice the Theme Song loads up an audio file. (audio playing) And this is using the audio tag, and it has three different source files, and the browser will select the media type that it supports.

And so if we look here in Chrome, select resources rock.html and open up this XHR, we see that it's selecting the MP3 version of this, and so that's the second one. And then the rest of this is just like we've seen in these files throughout the course. We have an article and it has the story, a lot of Lorem ipsum here. And we have an aside element, and that's this element over here. And that aside element has a header, and it has several different sections, and so here is the header and here's the sections.

And then we also have the footer, just as we have in each of these pages. And moving on to the Paper, again, this is all pretty much the same as the other ones, with the exception that it has this video element in it. So we will go ahead and open this up. It's in paper.html. So here at the top, we have our CSS files. We have our nav menu that's the same as we see on all these pages. And we have our header, which is this part up here. It's the same, just with different words. And then here we have the video control, and you see the video control here on the page. Notice we've set the size.

We are actually scaling it down; the natural video is about twice those dimensions. And we have three different media types, and the browser will select the first one that it's able to play from those media types. And this is Chrome, so I think it's actually selecting the MPEG version. Coming through to View > Developer > Developer Tools, and we will select it from down here. We see that that is the MPEG version, the m4v file that it's selecting. So it's actually taking the first one. If it couldn't render that first one, it would have rendered one of the others.

In fact, we can go ahead and open this is Firefox and we can see that at work and we see here is the video. (video playing) And if we come up here to Tools > Web Developer > Web Console, we see that it has skipped the MP4 file. And we come to the Page Info and we can see that it loaded the webm version, and that it is actually the second one in this list. And the rest of this is pretty much the same as the Rock. We have our Story and we have our sidebar, so here's the aside and there's our story.

We come back up here to the top and we click on Scissors. We are very familiar with this page, if you have been following along with the course. This is the simplest of these. It doesn't have any media. It just has the menu and the header and the story and the aside. And so if we open up scissors.html, see, here's the menu, and there is the header, and there is the story, which has lot of Lorem ipsum, and there's the sidebar in the aside element, and the footer down there at the bottom, and there's the footer.

If we come to the Contact page, the Contact page is also very simple. The thing about the Contact page here is we have two articles, and so we have this Contact Us article, which is right there, and then there is the aside, and then there is the story article. And so the aside actually gets floated to the right here. In all of these, the aside is floating to the right. We floated to the left in some of the other examples throughout this course and floating it to the right here-- and we will see this in the CSS-- we are actually able to get it to span multiple articles, which is what's being demonstrated in this one. We will see more about that in the movie on the CSS.

Then finally--here's the fun one-- this is our Buy page. Let's go ahead and bring up the HTML for this. This is if you want to actually buy the game, which as we point out you don't really need to buy. And here we have our little form. So there's the JavaScript. We will get to that in a moment. And there is our top menu, and there is our header, and there is the Where to buy, and there is the aside, and then finally down here, we have the form itself. And so we have a form. The action is the HTML page, so it's not going to actually get processed.

If you wanted to actually process the order, you would need to create a shopping cart and have this form actually feed into the shopping cart, and you would put the URL of your shopping cart right here. You would also not use the get method; you'd probably use the post method. I'm using the get method so that we can see the variables on the URL. So we have a regular text element here and that's for the Engraving, and so I am going to put something here in the Engraving. And then we have here, How many input type = number. And so this is the number type element and you see that I can change the quantity. I like 7.

I think 7 is good number. They are only $50 each. And you'll notice that this number here is getting updated as I do that, and that is in this output element. We learned about the output element in our chapter on forms. And our output element is actually getting calculated up here in the JavaScript. And again, this is very simple. We are getting the quantity and the price and we are multiplying them together and putting them in the value of that output element. You will notice here that I actually have a hard-coded value and I'm getting a value.

That's because this converting innerText to an integer doesn't work on all browsers. In fact, it doesn't work on Firefox, and I'm not sure if it works on IE or not. And so if we get a not-a-number from it, we just plug in the default price, but here in Chrome, I can actually change the price down here if I want to. I can make this $149, and I can save this and reload it, and you see now it $149, and when I buy seven of them, then it's a substantial amount of money. Put that back, and we are going to put in our Engraving again, and make this 7.

You notice I have got the range on this set to 10. I'm not letting you buy more than ten of them. Here we have min 1, max 10, value 1. And then I press my big red button, and we get the Thank you page. The Thank you page is very simple. It just says, Wow! Thanks! And you'll notice up here in the URL bar--expand this like this-- we have all of our values from the form. So we can see that our form is working. So that's what the site looks like, and that's what the HTML for it looks like, and in the next movie we will look at the CSS.

Show transcript

This video is part of

Image for HTML Essential Training (2012)
HTML Essential Training (2012)

82 video lessons · 104131 viewers

Bill Weinman
Author

 
Expand all | Collapse all
  1. 5m 24s
    1. Welcome
      56s
    2. Using the exercise files
      1m 37s
    3. What you need to know about this course
      2m 51s
  2. 22m 0s
    1. What is HTML?
      4m 12s
    2. Examining the structure of an HTML document
      7m 50s
    3. Understanding tags and containers
      6m 4s
    4. Exploring content models in HTML5
      2m 23s
    5. Looking at obsolete elements
      1m 31s
  3. 27m 19s
    1. Understanding whitespace and comments
      3m 53s
    2. Displaying text with paragraphs
      3m 37s
    3. Applying style
      8m 5s
    4. Using block and inline tags
      6m 34s
    5. Displaying characters with references
      5m 10s
  4. 16m 36s
    1. Exploring the front matter of HTML
      2m 9s
    2. Applying CSS to your document
      3m 59s
    3. Adding scripting elements
      4m 54s
    4. Using the meta tag
      3m 34s
    5. Optimizing your page for search engines
      2m 0s
  5. 24m 59s
    1. Controlling line breaks and spaces
      2m 46s
    2. Exploring phrase elements
      1m 44s
    3. Using font markup elements
      1m 5s
    4. Highlighting text with mark
      1m 29s
    5. Adding headings
      1m 38s
    6. Using quotations and quote marks
      3m 2s
    7. Exploring preformatted text
      1m 45s
    8. Formatting lists
      2m 28s
    9. Forcing text direction
      3m 49s
    10. Suggesting word-break opportunities
      2m 29s
    11. Annotating East Asian languages
      2m 44s
  6. 29m 15s
    1. Introducing CSS
      55s
    2. Understanding CSS placement
      6m 55s
    3. Exploring CSS syntax
      10m 34s
    4. Understanding CSS units of measure
      3m 3s
    5. Some CSS examples
      7m 48s
  7. 22m 5s
    1. Using images
      4m 13s
    2. Flowing text around an image
      4m 55s
    3. Breaking lines around an image
      3m 3s
    4. Aligning images
      5m 25s
    5. Mapping links in an image
      4m 29s
  8. 22m 28s
    1. Understanding URLs
      2m 41s
    2. Working with hyperlinks
      3m 28s
    3. Using relative URLs
      4m 20s
    4. Specifying a base URL
      2m 19s
    5. Linking within a page
      4m 12s
    6. Using image links
      5m 28s
  9. 17m 2s
    1. Exploring list types
      3m 52s
    2. List elements in depth
      7m 44s
    3. Using text menus with unordered lists
      5m 26s
  10. 15m 30s
    1. Introduction to HTML semantics
      4m 9s
    2. Exploring an example
      4m 56s
    3. Marking up figures and illustrations
      2m 33s
    4. Creating collapsible details
      3m 52s
  11. 11m 18s
    1. Embedding audio
      5m 19s
    2. Embedding video
      5m 59s
  12. 11m 53s
    1. Creating ad-hoc Document Object Model (DOM) data with the data-* attribute
      4m 53s
    2. Displaying relative values with meter
      2m 57s
    3. Creating dynamic progress indicators
      4m 3s
  13. 4m 49s
    1. Overview of HTML5 microdata
      1m 8s
    2. Exploring an example with microdata
      3m 41s
  14. 7m 3s
    1. Understanding outlines
      52s
    2. A demonstration of outlining
      6m 11s
  15. 13m 1s
    1. Table basics
      7m 29s
    2. Exploring the semantic parts of a table
      2m 32s
    3. Grouping columns
      3m 0s
  16. 9m 55s
    1. Frames overview
      54s
    2. Using traditional frames
      4m 26s
    3. Exploring inline frames using iframe
      2m 7s
    4. Simulating frames with CSS
      2m 28s
  17. 53m 7s
    1. Introducing forms
      10m 24s
    2. Using text elements
      10m 12s
    3. Using checkboxes and radio buttons
      2m 37s
    4. Creating selection lists and dropdown lists
      5m 14s
    5. Submit and button elements
      8m 48s
    6. Using an image as a submit button
      2m 15s
    7. Keeping context with the hidden element
      3m 0s
    8. Setting tab order
      2m 7s
    9. Preloading an autocomplete list using the datalist feature
      5m 26s
    10. Displaying results with output
      3m 4s
  18. 19m 47s
    1. Touring a complete site
      2m 14s
    2. Touring the HTML
      8m 44s
    3. Touring the CSS
      8m 49s
  19. 29s
    1. Goodbye
      29s

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.

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 HTML Essential Training (2012).

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


OK

Course retiring soon

HTML Essential Training (2012) will be retired from the lynda.com library on January 2, 2015. Training videos and exercise files will no longer be available, but the course will still appear in your course history and certificates of completion. For updated training, check out the all new HTML Essential Training in the lynda.com Online Training Library.


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 preferences from 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.