Even though the specification is still being written, HTML5 can be implemented for your website today. In this workshop presented by Christopher Schmitt focused on real world solutions, attendees will learn about the new HTML elements and their semantics, HTML5 form elements, incorporate audio and video without Flash, new JavaScript API like geolocation, and more.
2. Things are good Between US, XHTML, right? I MEAN. WE GET ALONG WELL. AND WE BOTH LIKE STUFF. 3
3. “ imagine you made a browser that only rendered sites authored in valid HTML or XHTML. How much of the web would your users be able to see? 1%? 0.1%? Less? ” Mark PILGRIM http://dev.opera.com/articles/view/mama-markup-validation-report/
4.
5. “ The attempt to get the world to switch to XML, including quotes around attribute values and slashes in empty tags and namespaces all at once didn’t work. ” Sir Tim Berners-Lee
19. HTML 4.01 Transitional DTD: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" " http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd "> XHTML 1.0 Transitional DTD: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
47. <h1> <a href=" http://example.com "> HTML5, for Fun & Profit </a> </h1> <a href=" http://example.com "> <img src="logo.png" alt="HTML5 for Fun and Profit" /> </a>
48. <a href=" http://example.com "> <h1>HTML5, for Fun & Profit</h1> <img src="logo.png" alt="HTML5 for Fun and Profit" /> </a>
50. <figure> <img src="chart.png" alt="Chart of increasing awesomeness" /> <figcaption> The increasing amount of awesome that this blog demonstrates. </figcaption> </figure>
54. <details> <summary> Upcoming Topics </summary> <p>For the new year, we have a great line up of articles!</p> <ul> <li>Understanding the Outline Algorithm</li> <li>When to Use <code>hgroup</code></li> <li>Machine Semantics with Microdata</li> </ul> </details> Only works in Chrome; all others - https://gist.github.com/370590
59. <p>The results are in for your favorite fruit, and we have a tie for first place!</p> <ol> <li value="1" >Bananas</li> <li value="1" >Oranges</li> <li value="2" >Apples</li> </ol>
67. “ Designed for humans first and machines second, microformats are a set of simple, open data formats built upon existing and widely adopted standards. ”
68. “ HTML design patterns for common chunks of content that web builders need to markup anyway.” “ Oh, and Google understands them, too.”
110. HTML5 Video Text “ It would be helpful for interoperability if all browsers could support the same codecs. However, there are no known codecs that satisfy all the current players: we need a codec that is known to not require per-unit or per-distributor licensing, that is compatible with the open source development model, that is of sufficient quality as to be usable, and that is not an additional submarine patent risk for large companies. This is an ongoing issue and this section will be updated once more information is available. ” - http://www.whatwg.org/specs/web-apps/current-work/#video-and-audio-codecs-for-video-elements
111.
112. VIDEO CODEC SUPPORT FF3.6+ S Ch5+ Op10.6+ IE9+ Ogg Y Y Y H.264 Y Y* Y WebM (W4.02+) (Ch6+) Y
131. 1 00:00:00,000 --> 00:00:6,000 Allow me to introduce myself My name is Tay It's T-A-Y, T-A-Y to the Z 2 00:00:06,000 --> 00:00:9,000 This is the web and it's gonna murder your TV It was Chocolate Rain 3 00:00:09,500 --> 00:00:11,500 Wrote a song about that history Chocolate Rain 4 00:00:12,000 --> 00:00:15,000 Now I'm paid a hefty hefty fee Chocolate Rain TRANSCRIPT-EN.SRT
150. Step #1 Muck-N-Dave's Texas BBQ 1603 South Congress Austin, TX 78704 USA 512-590-3387 Old School BBQ and Grill 2326 E Cesar Chavez St Austin, TX, 78702 USA 512-974-6830 The Shed BBQ Rolling Joint 1816 E 6th Street. Austin, TX, 78702 USA 504-432-4718 Franklin Barbecue 3421 N. I-35 Austin, TX, 78722 USA 512-653-1187 Old School BBQ and Grill 2907 E MLK Jr Blvd. Austin, TX, 78702 USA 512-974-6830 Snow's BBQ 516 Main Street Lexington, TX 78947 USA 979-773-4640
195. <script type="text/javascript"><!-- window.addEventListener('load', function () { // Get the canvas element. var elem = document.getElementById('myCanvas'); if (!elem || !elem.getContext) { return; } // Get the canvas 2d context. var context = elem.getContext('2d'); if (!context) { return; } // Now you are done! Let's draw a blue rectangle. context.fillStyle = '#00f'; context.fillRect(0, 0, 150, 100); }, false); // --></script>
196.
197. // Get the canvas element. var elem = document.getElementById('myCanvas'); if (!elem || !elem.getContext) { return; } // Get the canvas 2d context. var context = elem.getContext('2d'); if (!context) { return; } context.fillStyle = '#00f'; context.strokeStyle = '#f00'; context.lineWidth = 4; // Draw a right triangle. context.beginPath(); context.moveTo(10, 10); context.lineTo(100, 10); context.lineTo(10, 100); context.lineTo(10, 10); context.fill(); context.stroke(); context.closePath(); }, false);
198.
199. // Get the canvas element. var elem = document.getElementById('myCanvas'); if (!elem || !elem.getContext) { return; } // Get the canvas 2d context. var context = elem.getContext('2d'); if (!context) { return; } context.fillStyle = '#00f'; context.strokeStyle = '#f00'; context.lineWidth = 4; // Draw a right triangle. context.beginPath(); context.moveTo(10, 10); context.lineTo(100, 10); context.lineTo(10, 100); context.lineTo(10, 10); context.fill(); context.stroke(); context.closePath(); }, false);
203. Progressive Enhancement & Canvas Text “ Progressive enhancement is a strategy for web design that emphasizes accessibility, semantic H TML markup, and exte rnal style sheet and scripting technologies.” http://en.wikipedia.org/wiki/P rogressive_enhancement
how many people here validate your pages? And How many of you REALLY do?
So, yes. IE is an issue with HTML5.
Even with Flash and Silverlight, HTML and XHTML has its limitations. We need new elements to mark up content in a true semantic manner. CONTEST... PULL SOMEONE FROM THE AUDIENCE.
Microformats tries to solve or overcome some of these limitations, but co-opting HTML elements and attributes is a strategy that can only be squeezed to far even with the best of intentions.
BBC removed the hCalendar from it ’s site due to for-machine only code reading out and keeping other industries that need ABBR tag like travel.
We have Web sites that offer software like applications, we have Web sites that sport audio and video like it ’s candy machine. Like chocolate rain.
As I saw it, the goal of XHTML was XML and that there wouldn ’t need to be a need for an upgrade to HTML4. However, there comes a point when what’s planned doesn’t turned out to be true. Like the architect’s blueprint--it can never foresee the needs of the occupants 40-50 years from now. Therefore the owners adapt the house to suit their needs.
As Frank Lloyd Wright once said... you take care of the stuff that will make your life easier, everything else will work itself out.
Pretty simple DOCTYPE; I have to copy and paste XHTML Doctypes cause I don ’t remember them. And a character set, pretty common.
The W3C validator has a beta!
In previous versions of HTML, the character set needed to be declared with additionalattributes and values. But, as with the DOCTYPE, HTML5 only needs the minimum information requiredby browsers. Again, this helps with backward compatibility and makes it easier forauthors to implement.
The character encoding tells browsers and validators what set of characters to use when rendering web pages. If you do not declare the character set in your HTML, browsers first try to determine the character set from your server ’s HTTP response headers (specifically,the “Content-Type” header).
Browsers, screen readers, and other user agents use the lang attribute to determine the language in which the content should be interpreted. The example above specifies English via the en value. Declaring a document ’s primary language isn’t a requirement for HTML5 (or any of the previous versions, for that matter). It is, however, a good practice for both usability and accessibility.
HTML5 requires only the minimum amount of information needed for user agents. Inprevious versions of HTML, both CSS link s and script s required the type attribute toindicate the language. If you forgot to include type , though, most browsers assumedthe correct value. HTML5 makes type officially optional, but still validates older documents that do include the attribute. This makes sense, as there is really only one standard scripting language and only one styling language for the Web in use today.
Wake me up when this is true for deep fried Twinkies.
HTML5 slightly redefines em for text with “emphatic stress,” which I translate as any text that, when spoken, I would verbally emphasize.
use i to indicate text that is in an alternate voice or mood, or somehow offset from the normal prose; for example, a taxonomic designation, a technical term, a thought, an idiomatic phrase, or some other text whose typical typographic presentation is italicized:
In previous versions of HTML, strong was used to indicate strong emphasis. In HTML5, strong indicates importance and is typically used for alerts and warnings.
b is used to stylistically offset text from the normalprose without conveying any extra importance.For example, b could be used for keywords, product names, or other content whosetext would typically be unique compared to surrounding text, such as a paragraph lead
HTML5 redefined the previously presentational small as semantically appropriate forcontent typically considered “small print,” such as legalese, disclaimers, terms, conditions,and copyrights.
The reasoning is that all acronyms areshortened forms of words or phrases, which is the very definition of an abbreviation.
Previous versions of HTML restricted a to inline content. So, if you had different elementsthat all needed to be linked to the same resource, you had to individually specifythe a for each:
Now, with HTML5, a elements can contain block-level elements. You can also still usea as in the past, for containing inline content. The only thing you can ’t nest inside ana is another a .
figcaption is optional and can reside anywhere within figure, whether before orafter the figure content.
figcaption is optional and can reside anywhere within figure, whether before orafter the figure content.
start has been around for a while, but was deprecated as presentational. HTML5 nowrecognizes the semantic value of controlled numbering and welcomes it back. This “reordering” via start works the same across all browsers, IE6 included.
All current browsers support the value attribute for li .
This attribute is well supported by today ’s browsers, including IE6. In fact, contente ditable first appeared in IE 5.5 and has since been incorporated by other browsers. It was originally intended to support in-browser editing such as a What You See Is What You Get (WYSIWYG) editor. However, on its own, it only allows users to edit content. It does not have any functionality to save those edits, nor does it generate editing controls commonly seen in WYSIWYG editors. For that type of editing, you need to incorporate JavaScript and utilize the local storage Application Programming Interface
draggable, like contenteditable, has good browser support and was originally introducedfor IE (by default, certain elements are already draggable: a and img). However,the simple addition of draggable to your elements does not create the drag-and-dropfunctionality on its own. draggable simply allows you to specify the elements thatcan be dragged. To achieve the desired drag-and-drop functionality, you need JavaScript to:1. Tell the browser where the draggable element can be dropped (the drop “zone”).2. Tell the browser what to do with the element once it has been dropped.
I want to touch base with the microformats issue and the BBC. If you recall, it centered on the ABBR element being a bit overused.
Click forward to hear audio
HTML4 based hCalendar microformat from spec
Replace with TIME element and use the DATETIME attribute
A common setup for a page layout. Use of DIVs and pretty typical values for ID attributes.
With HTML5, there ’s an acceptance of these types of Web document structures. HTML5 has elements for HEADER, for ARTICLE, for SECTIOn, for ASIDE, for FOOTER.
Using Opera as our testing browser, we can see a basic layout with CSS added for color works when applied to our new HTML5 elements.
However, in IE6 (and IE7, not pictured) the browser doesn ’t recognize these values. With IE taking up a huge market share of the browser market, it’s important that we at least an attempt to style the page.
WIth these events, the browser recognizes the elements and the CSS properties can be applied. Tried the Dean Edwards IE7 script and it doesn ’t work.
Very straightforward method for including video. Notice width and height attribute, poster attribute, and alternative text. PULL UP VIDEO DEMO!!
Also, the code is pretty much the HTML5 video element without height and width attributes
Basic Flash HTML to include a flash movie; straight from YouTube
Very straightforward method for including video. Notice width and height attribute, poster attribute, and alternative text. PULL UP VIDEO DEMO!!
Originally spec said for browsers venders to use the Ogg Theora video and Orr Vorbis audio and the Ogg Container format, but vendors like Apple rejected on the grounds of submarine patents. FYI, This text is all in red when you get to the page.
I felt that the video support is a lot like SVG. There is a lot more potential for support for video since everyone can see the value of HTML5 videos--but it needs to make a case for a clean break from the infrastructure that companies have in Flash.
I felt that the video support is a lot like SVG. There is a lot more potential for support for video since everyone can see the value of HTML5 videos--but it needs to make a case for a clean break from the infrastructure that companies have in Flash.
No “real” HTML <video> element, and I think there are more benefits to flash at this time-- thus it’s a beta.
visualize.jQuery.CSS defines the basic design underpinings of the table. Stuff like unit numbers, border colors and sizing, etc.
visualize.jQuery.CSS defines the basic design underpinings of the table. Stuff like unit numbers, border colors and sizing, etc.
Story about your first need for Geolocation.
Step one is get a list of addresses you need.
Add JavaScript files. First, is Google CDN of jQuery. Maybe it ’s your site’s own version you host. Then you get the file from
Canvas is a new element in HTML5 allowing for an easier, powerful way to draw graphics using JavaScript. Is it like SVG?
The search input type displays a text input field that may visually differ from that of aregular text field, based on the stylistic conventions of the platform.For example, Safari on Mac OS displays the search field with rounded (instead ofsquare) corners, as shown in Figure 3-1. Both Safari and Chrome display an icon withinthe field to delete the current value, as shown in Figure 3-2.Some user agents will display a plain text input field for the search input type, so supportcannot be determined by visual appearance alone.
As you may have guessed, the number input type restricts the value to a valid number— a floating-point number, to be specific.
As you may have guessed, the number input type restricts the value to a valid number— a floating-point number, to be specific.
The range input type is like number in that it restricts the value to a valid floating-pointnumber, but it has the added caveat that the exact value is not important. Exact values are important on product order forms and the like, for values like quantity,so number should be used in those cases. The range input type is useful in cases of relativeor subjective input, such as assigning a rating to an event or product. To emphasizethis point, the specification requires that the control be rendered as a slider or similarcontrol, as shown in Figure 3-15.Webkit-based browsers and Opera render a horizontal slider control for the range inputtype. If a user agent does not recognize this input type, it displays a text input fieldinstead.
The color input type restricts the value to a valid RGB value in hexadecimal format,including the number sign or octothorpe, # , displayed before the six digits.The HTML5 specification prescribes a color-well control for this input type, but so faronly Opera has implemented this control. Webkit-based browsers that supportcolor , like Chrome and Safari, render a text input field but successfully validate entriesand prohibit form submission if the value is not valid, as shown in Figure 3-16 andFigure 3-17.If a user agent does not support the color input type, it will display a text input fieldinstead.
The datalist element is used to define a list of suggested values for other input controls—it is not a form input or control itself.The suggested values are specified using option elements, just as they would be for aselect element, but nothing renders on the screen until the datalist is associated withan input element. Binding a datalist to an input field is done by specifying an id onthe datalist and using this as the value of the list attribute on the input element.The result is a control that both accepts user input and presents a list of options for theuser to choose from. This is not unlike the type-ahead or autocomplete functionalityimplemented in many browsers and on most search websites, as shown in Figure3-18 and Figure 3-19.For browsers that have not yet implemented datalist , the above solution results in thedisplay of the text input field, but not the list of suggestions. In a few cases, olderbrowsers may display the option labels.
The color input type restricts the value to a valid RGB value in hexadecimal format,including the number sign or octothorpe, # , displayed before the six digits.The HTML5 specification prescribes a color-well control for this input type, but so faronly Opera has implemented this control. Webkit-based browsers that supportcolor , like Chrome and Safari, render a text input field but successfully validate entriesand prohibit form submission if the value is not valid, as shown in Figure 3-16 andFigure 3-17.If a user agent does not support the color input type, it will display a text input fieldinstead.
The required attribute may be specified on zero or more form elements in a form.When the user submits the form, any required field that has been left blank will causethe browser to stop the submission and an error message will be displayed. The visualdisplay of the error varies from browser to browser, as shown in Figure 3-21 to Figure3-25.If a user agent does not recognize the required attribute, it will be ignored. You canstill craft JavaScript to perform this validation using this attribute, however. See Recipe3.14, for details.
In addition to disabling autocomplete at the individual input field level, you can alsodisable it at the form level. If you disable autocomplete at the form level, you can reenableit for an individual form field by setting autocomplete=&quot;on&quot; .While many security experts suggest applying autocomplete=&quot;off&quot; to form fields thatcontain sensitive data, you should keep in mind that this is not a particularly effectivesecurity measure. Some browsers do not yet support autocomplete , and since so manytools exist to circumvent autocomplete=&quot;off&quot; —tools that still auto-inject a user's storedpassword—it's often security theater or simply a false security measure.Those browsers that do not support autocomplete simply ignore the attribute altogether.
For years, web professionals have been writing validation scripts to check user dataprior to form submissions—and most of us would likely say that we have hated it.With HTML5, we have a method for checking form input that doesn ’t rely on Java-Script: regular expressions .
Canvas is a new element in HTML5 allowing for an easier, powerful way to draw graphics using JavaScript. Is it like SVG?
You want to check to make sure the browser supports HTML5 canvas. Then set the context--this is set for 2d, but browsers can make their own. Like Opera is testing out 3d. Then you can use
canvas is supported in Opera, Firefox, and Safari--esp. in the iPhone. This is done by Dunstan Orchard. A Web-app he ’s building for the iphone for tracking his workout routine.
visualize.jQuery.CSS defines the basic design underpinings of the table. Stuff like unit numbers, border colors and sizing, etc.
Next line brings in the jQuery framework from Google
What ’s this for?
IE doesn ’t support Canvas. However, IE 5+ supports MS’s own Vector Markup Language. I KNOW, RIGHT? MS HAS ITS OWN VECTOR MARKUP LANGUAGE? It’s like they don’t even know SVG is even interesting in it.
This is the plugin that makes the table conversion work.
This is the plugin that makes the table conversion work.
This is the plugin that makes the table conversion work.
Canvas is supported in Opera, Firefox, and Safari--esp. in the iPhone. This is done by Dunstan Orchard. A Web-app he ’s building for the iphone for tracking his workout routine.