i’ve built many a wordpress site. - Wordpress is HTML and CSS from top to bottom. from wp-admin to themes & plugins. Wordpress3’s default theme twenty ten is HTML5—so I thought I’d show you how you can use it now in your sites right now! - covering a lot today so stop me if you have questions - I’m no expert, just a fanboy. Every day I learn something new about HTML5 and CSS3, so please use this opportunity to teach me a thing or two, too.
Forms Semantics Javascript CSS3 Selectors Properties Fonts I’m not covering everything as there’s so much! My aim today is to show you the useful bits that I find myself using quite often.
HTML5 New Elements Forms Semantics Javascript CSS3 Selectors Properties Fonts I’m not covering everything as there’s so much! My aim today is to show you the useful bits that I find myself using quite often.
HTML - html started in 1991 by TBL - historically W3C is the governing body - distracted by XML and so began the XHTML movement - XHTML2.0 complete non-backward compatible rebuild, total disaster - in 2004 some disgruntled ex w3c people formed the Web Hypertext Application Technology Work Group WHATWG - w3c = democratic vote - WHATWG = final decisions where made by one guy Ian Hickson - lots of contributors but final decision made by Iain Hickson - but now everyone is playing nicely - W3C+WHATWG are combining their efforts
one being “Support Existing Content” - Phrases like Don’t reinvent the wheel and Pave the cowpaths - if there’s a common way designers are doing something—even if it isn’t the best way—it should be put in the HTML5 standard. aka If it aint broke don’t fix it. - so html5 is built on existing standards and conventions - make your life easier - could mean your code could end looking a bit all over the place... - make your code good looking, semantic and accessible - as we move through you’ll realise why you should be using HTML5
hour trying to convince people this is the way to go! Things have started to change. Huge advances in mobile technology has meant that we’re having to surf the web like it’s 1999 again. High speed internet hasn’t made it into our pockets. The number of bytes and server calls are actually a concern again - who wants to pwn your mobile data plans downloading characters and bytes...
than syntax. The smart HTML5 people have done some serious research into the way in which we write HTML and noticed hundreds of regularly trodden paths.
semantics might pan out. I’ll dive into each of the main structural elements - with reference to what the spec says and show an example. This will be a quick-fire run through. but these slides are available online for further perusal.
to mark up a page’s title with its subtitle or tagline. May contain more than just the section’s headings and subheadings — e.g., version history information or publication date.
other documents or to parts within the current document. Not all groups of links on a page need to be in a nav element — only primary navigation links. In particular, it is common for footers to have a list of links to various key parts of a site - you wont need the nav element - the footer element will suffice.
is a thematic grouping of content, typically with a header, possibly with a footer. Examples: chapters in a book, various tabbed pages in a tabbed dialog box, a home page could be split into sections for an introduction, news items, contact information.
site. A forum post, a magazine or newspaper article, a Web log entry, a user-submitted comment, or any other independent item of content. Think of it as an item that can be syndicated via RSS or ATOM
<h2>Sub title</h2> </header> <p>Synergistically optimize flexible communities via cross-‐unit information. Objectively impact bricks-‐and-‐clicks catalysts for change rather than reliable.</p> </article>
inside the video element. User agents should not show this content to the user. Authors should use this content to force older browsers to use a legacy video plugin or to inform the user of how to access the video content.
month color type= so far only webkit browsers and opera will support those types. But that’s OK, because other browsers will just default to type=”text”. So USE these fields.
programmer so I’ll be brief - I haven’t used these things, I just saw them in a movie - what’s interesting to note is that IE has been supporting a lot of these things for quite some time. They did after all invent AJAX back in the IE5 days.
- like the name suggests—top one returns a node list of elements with a class containing test - querySelectorAll() is similar to the way jquery selectors work.
bores programmers half to death! - show you all available css3 selectors; then show you some of the more useful ones - the new properties - media queries - fonts
{color: #eee; } The :nth-child() pseudo-class The :nth-child() pseudo-class targets an element that has a certain number of siblings before it in the document tree. The arguments can be a number, a keyword, or a formula. 1) Matches third p element that is the 3rd child of it’s parent 2) Matches every first, third, fifth, etc li element 3) Contains NAV
have adopted a method of including “cutting edge” CSS properties - “cutting edge” in this case means the CSS is still in draft with the W3C - means you can use them and thus help vendors test their specific implimentation of the CSS standard. - some debate whether this is good or bad. I’m on the fence. I use them and it doesn’t really bother me.
Opacity Opacity sets the degree of opacity of the entire object. This affects all children. ie9 Use vendor prefixes for opacity RGBA HSLA can be used for any colour settings: border-color, color, background-color, etc ie9
url(img02.png) no-‐repeat; Background & Borders Multiple Background Images Finally! Multiple background images! You can position them using the usual background position methods IE9
Border Image Allows you to create image borders. You position the image much like you would position a background image. Quite difficult to explain - but if you’ve used CSS sprites before it’s a similar concept.
transform:rotate(45deg); } #rotate-‐skew-‐scale-‐translate { transform:skew(30deg) scale(1.1,1.1) rotate(40deg) } CSS Transforms change the angle/shape of objects. - skew - scalex scale y - rotate - all together USE VENDOR PREFIXES
ease-‐in-‐out; } img:hover { opacity:0; } CSS Animated Transforms change the angle/shape of objects. - skew - scalex scale y - rotate - all together USE VENDOR PREFIXES
src: local('☺'), url('Titillium.woff') format('woff'), url('Titillium.ttf') format('truetype'), url('Titillium.svg#webfont') format('svg'); } Font Face This is the total cross browser implementation. the smily face prevents the browser from showing a flash of unstyled content EOT = Embedded Open Type for IE WOFF = Web Open Font Format - the standard - includes IE TTF = true type - all browsers
of fonts - deal with very good type foundries Fontsquirrel - lots of free for use fonts. - creates @font-face css for you - has all font formats Google - deal with typekit - small number of free fonts
test against. This example is checking to see if your browser supports the new input type of date. If it doesn’t you can then provide a suitable fallback.
<audio> with H.264, FLV, WMV, or MP3 on any browser http://css3please.com/ - A collection of cross browser css properties and IE filters that will render CSS3 effects like dropshadows, etc http://css3pie.com/ - an IE HTC include which makes ie6-ie8 render css3 features: - border-radius, box-shadow, border-image, multiple background, rgba, gradients http://www.html5test.com/ - will tell you what your browser supports http://www.html5rocks.com - a great place to see examples of awesome html5 stuff http://html5doctor.com/ - THE resource for HTML5