- , , and the rest of the gang — but there are a few new faces there too Everything we cover in this example can be used in current browsers — including Internet Explorer, just as long as you paste this code into the section of your document: This link, a handy piece of JavaScript called HTML5 Shim, helps translate HTML5 for IE so it can render pages correctly We’ll spare you the technical details about how it works, but as long as you remember to post this just before your tag, your new designs will work just fine in IE The Element As all you seasoned web designers know, the element is a total mess: Yuck Well, have we got good news for you! With HTML5, you’ll notice a pleasant change Ladies and gentlemen, meet the new and improved element That’s right, with just two words, you achieve the same effect as the mess we’ve all grown to know and loathe The best part? It’s totally backwards-compatible, which means that you can use this code to specify the DOCTYPE even if you’re using HTML 4.01 or XHTML 1.0 Why would you want to that? Well, if you’re going to be switching over to HTML5 eventually anyway, you may as well start here So go ahead, what are you waiting for? The Element Moving on, you’ll notice the element Website Name This element is used to differentiate a heading from the rest of the page In this case, the heading is the element, but it can include any of the header elements (-), a table of contents, a search box, a logo — pretty much anything you might consider a heading The element is a good example of how HTML5 strives for more semantic markup See, browsers, search engines, and assistive devices interpret header elements as text, but there’s no special meaning there to set them apart from any of the other text on the page With HTML5, they know that anything inside the elements is, well, a header This means they can interpret them more appropriately That idea of appropriate interpretation is the driving force behind HTML5 The Element The next new element we’re going to cover is :
- Home
- About
- Services
- Contact
- Menu Link
- Menu Link
- Menu Link (…) The Element The element is a little more vague than the other elements we’ve talked about It’s basically used for just what it sounds like: to section off related parts of a document It’s up to you to decide what parts might need to be sectioned off You could use to create logical sections, like subheadings in a long article, or you could use it structurally, like we did in our sample webpage We used elements to set off the introduction to the page, the articles, different areas of the sidebar, etc.: About
- Menu Link
- Menu Link
- Menu Link
- Menu Link
- Menu Link
- Menu Link
- Menu Link
- Menu Link
- Menu Link
- Menu Link
- Menu Link
- Menu Link
- Menu Link
- Menu Link
- Menu Link
- Menu Link
- Menu Link
- Menu Link
Posted on June 29th 2009 (…)
Lorem ipsum dolor sit amet, consectetur adipiscing elit Proin euismod tellus eu orci imper (…)
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed eiusmod tempor incididunt (…)
The Element The element gives you a way to encode dates and times in your webpage code One common use for this element — including in our sample webpage — is to specify the publication date of a piece of content If you’re doing so, be sure to include the pubdate attribute, like so: June 29th 2009 There are actually a few different ways to format the datetime attribute value (the bit between the quotation marks): June 8, 2010 9 a.m on June 8, 2010 9 a.m on June 8, 2010 in Asturias, Spain Dates are always written out in YYYY-MM-DD format, and you can append them with the specific time, if you want To this, put a T right after the date, followed immediately by the time, formatted like so: HH:MM:SS (Note: Seconds are optional If you don’t want to include them, just omit the :SS bit.) Finally, append the whole kit and kaboodle with either: • Z: This sets the time to Coordinated Universal Time (UTC) • +HH:DD or -HH:DD: This allows you to set time-zone offsets from UTC Using +HH:DD format adds the amount of time you specify to your current time; using -HH:DD format subtracts the specified time The Element The element is usually used to mark up sidebars and other content that is related, but not essential, to the rest of the content An can occur within an article (like a sidebar to a story) or, as in our example, as a sidebar menu: CategoriesLorem ipsum dolor sit amet, consectetur adipisicing elit, sed eiusmod tempor (…)
10 Although you can use to create structural or logical sections, you should choose one usage and stick with itLorem ipsum dolor sit amet, consectetur adipisicing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
28 Blog Roll- APPENDIX B: CSS3 CODE Here is the CSS3 code used to style the sample webpage /* Reset v1.0 | 20080212 - http://meyerweb.com/eric/tools/css/reset/ */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; outline: 0; font-size: 100%; vertical-align: baseline; background: transparent; } body { line-height: 1; } ol, ul { 30 } list-style: none; blockquote, q { quotes: none; } blockquote:before, blockquote:after, q:before, q:after { content: ‘’; content: none; } /* remember to define focus styles! */ :focus { outline: 0; } /* remember to highlight inserts somehow! */ ins { text-decoration: none; } del { text-decoration: line-through; } /* tables still need ‘cellspacing=”0”’ in the markup */ table { 31 border-collapse: collapse; border-spacing: 0; } /* tells browsers that don’t read HTML5 tags to render like divs */ header, footer, aside, nav, article, section { display: block; margin: 0; padding: 0; } clear:after { content: “.”; display: block; height: 0; clear: both; visibility: hidden; } /* Layout */ body { background: #f0f0f0; border: none; color: #333; margin: auto; font: 14px/24px Helvetica, Arial, sans-serif; width: 960px; } 32 h1 { font: normal bold 34px/50px Arial, Helvetica, sans-serif; padding-top: 30px; } h2 { font-size: 28px; line-height: 44px; padding: 22px 0; } h3 { font-size: 18px; line-height: 22px; padding: 11px 0; } p{ font-weight: normal; padding-bottom: 22px; } a{ color: #CC6600; text-decoration: none; } a:visited { 33 color: #CC6600; outline: none; text-decoration: none; } a:hover { color: #FF9900; text-decoration: underline; } a:active { color: #CC6600; outline: none; text-decoration: none; } a:focus { outline: 1px dotted; } header h1 { padding: 30px 20px 40px; } nav#global { 34 padding: 10px 0; position: absolute; left: 0; width: 100%; background-color: #333; } nav#global ul { margin: auto; width: 960px; border: none; } nav#global ul li { display: inline; list-style: none; padding-left: 40px; } nav#global ul li a { color: #777; background-color: #222; border: 2px solid #222; font: normal bold 14px/44px Arial, Helvetica, sans-serif; padding: 10px; margin-right: 40px; -moz-border-radius: 5px; -webkit-border-radius: 5px; text-align: center; } nav#global ul li a:hover { 35 background-color: #111; border: 2px solid #444; color: #FF9900; text-decoration: none; } nav#global ul li.selected a { color: #fff; } nav#global ul li.selected a:hover { color: #FF9900; } #intro { background-color: #ccc; margin-top: 100px; padding: 40px; -moz-border-radius: 15px; -webkit-border-radius: 15px; } #intro header h2 { font-weight: normal; line-height: 30px; padding: 0 15px 0; width: 370px; } #intro p { 36 width: 370px; } #intro a { color: #fff; background-color: #333; font: normal bold 14px/44px Arial, Helvetica, sans-serif; padding: 10px; margin-right: 40px; -moz-border-radius: 5px; -webkit-border-radius: 5px; text-align: center; } #intro a:hover { color: #FF9900; background-color: #222; text-decoration: none; } #intro #photo { 37 background-color: #fff; float: right; margin-top: -170px; -moz-box-shadow: 1px 10px #333; -webkit-box-shadow: 1px 10px #333; -moz-border-radius: 4px; -webkit-border-radius: 4px; width: 400px; height: 300px; } #photo div { background-color: #333; margin: 10px auto auto; -moz-border-radius: 2px; -webkit-border-radius: 2px; width: 380px; height: 260px; text-align: center; } #photo div h3 { color: #fff; font-size: 25px; line-height: 25px; padding: 115px 0 0; } div#main { background: url(main_bkgd.png) repeat-y top right; border: none; } #main #articles { 38 float: left; margin-left: 40px; width: 600px; border: none; } article { border-bottom: 1px dotted #aaa; padding: 15px 0; } article:last-child { border-bottom: none; } aside { float: right; margin-top: 40px; margin-right: 40px; } aside section { background-color: #F5F5F5; margin-bottom: 30px; padding: 20px 40px 20px 20px; -moz-border-radius: 5px; -webkit-border-radius: 5px; } aside h3 { } 39 padding: 0 11px 0; nav#categories ul li, nav#archives ul li { list-style: none; margin: 5px 0; } footer { position: absolute; left: 0; width: 100%; background-color: #333; } footer div { margin: auto; padding: 40px 20px 40px; width: 920px; border: none; } footer div section { color: #777; float: left; margin-right: 25px; width: 230px; border: none; } footer div section h3 { 40 color: #fff; } nav#blogRoll ul li, nav#siteMap ul li { margin-left: 15px; } footer #about { margin-right: 60px; width: 330px; } 41