Skip to main content

Home/ HTML5 development/ Group items tagged time

Rss Feed Group items tagged

Vernon Fowler

Bruce Lawson's personal site  : The best of s - 0 views

  • Update 10 August 2012: in response to a query, I checked again and pubdate is gone from both the WHATWG and W3C specs.
  • Previously, you could only mark up precise dates. So, 13 November 1905 could be expressed in HTML <time datetime="1905-11-13"> but November 1905 couldn’t be. This is a problem for historians where sometimes the precise date isn’t known.
  • Neither can you indicate date ranges. To mark up From “21/02/2012 to 25/02/2012″, use two separate <time> elements.
  • ...3 more annotations...
  • So <time datetime="P4D"> is a duration of 4 days
  • <time datetime="1905"> means the year 1905
  • <time datetime="1905-11"> means November 1905
Vernon Fowler

The time element (and microformats) | HTML5 Doctor - 0 views

  • There is a boolean attribute pubdate specifically for this
  • <time datetime="2010-01-20" pubdate>
Vernon Fowler

The article element | HTML5 Doctor - 0 views

  • A weblog-style <article> A published date leads us to add a <header>, and there’s also content that would be suitable in a <footer> elements. <article>  <header>    <h1>Apple</h1>    <p>Published: <time pubdate="pubdate">2009-10-09</time></p>  </header>  <p>The <b>apple</b> is the pomaceous fruit of the apple tree...</p>  ...  <footer>    <p><small>Creative Commons Attribution-ShareAlike License</small></p>  </footer></article>
Vernon Fowler

HTML5 and Search Engine Optimisation (SEO) | HTML5 Doctor - 0 views

  • The Doctors’ advice on SEO is to follow Google’s time-honoured guidelines: write valid, cross-browser, accessible HTML, don’t misuse markup or “cloak” with CSS, make a site with a clear hierarchy and text links, and write good content:
Vernon Fowler

HTML5 forms input types | HTML5 Doctor - 0 views

  • Once more, the iPhone recognises type="tel", only this time it goes one step further and completely changes the keyboard to the standard phone keyboard, as shown on the left in Figure 6. In addition to the iPhone, some Android devices (such as HTC Desire, shown on the right in Figure 6) also display a numeric keyboard for type="tel". That’s pretty handy, don’t you think? Nice, big keys for entering a phone number help you to get that big, nasty form completed quickly.
  • In contrast to Opera’s implementation, the iPhone (Figure 8) and some Android devices (such as HTC Desire, shown on the right in Figure 6-13) simply render the field as a standard text box but optimize the keyboard for easy input.
  • Chris’ technique may soon become absolete though with the introduction of the inputmode attribute. The attribute, recently added to the specification will allow users to specify the type of input mechanism that is most useful for users. When implemented, you will be able to choose between numeric, latin, email, or kana input modes.
  • ...3 more annotations...
  • To make the iPhone render with the standard telephone keypad as we saw for type="text" Chris Coyier, of CSS Tricks devised a little hoax you can use. Rather than using type=”number”, use a standard type="text" input and add a pattern attribute that accepts only numbers, as shown below. This solution isn’t ideal but if you think it could be useful, Chris has put a short video together showing it in action. <input type="text" pattern="[0-9]*" name="shoe-size">
  • There are dedicated keys for the @ and . characters to help you complete the field more efficiently. As we discussed with type="search", there is no downside to using type="email" right now. If a browser doesn’t support it, it will degrade to type="text". And in some browsers, users will get a helping hand.
  • The url input type, as you might expect, is for web addresses. You can use the multiple attribute to enter more than one URL. Like type="email", a browser will carry out simple validation on these fields and present an error message on form submission. This is likely to include looking for forward slashes, periods, and spaces, and possibly detecting a valid top-level domain (such as .com or .co.uk). Use the url input type like so: <input type="url" name="url" required>
1 - 6 of 6
Showing 20 items per page