<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title></title>
	<atom:link href="http://www.flash-to-html5.net/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://www.flash-to-html5.net/blog</link>
	<description>HTML5 samples, showcases, tools, tutorials &#38; more...</description>
	<lastBuildDate>Wed, 16 May 2012 05:29:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>An Overview of the Web Storage API</title>
		<link>http://www.flash-to-html5.net/blog/an-overview-of-the-web-storage-api</link>
		<comments>http://www.flash-to-html5.net/blog/an-overview-of-the-web-storage-api#comments</comments>
		<pubDate>Wed, 16 May 2012 05:27:40 +0000</pubDate>
		<dc:creator>Sophie.Y</dc:creator>
				<category><![CDATA[HTML5 Basics]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[HTML5 features]]></category>
		<category><![CDATA[Stored Data]]></category>
		<category><![CDATA[Web Storage API]]></category>

		<guid isPermaLink="false">http://www.flash-to-html5.net/blog/?p=1250</guid>
		<description><![CDATA[Web developers have long yearned for a way to store data long term. Cookies are an option, but they can only store 4KB of data. Additionally, cookies are sent to the server with each HTTP request. This means that cookies, especially large ones, can consume considerable network bandwidth. There have been other attempts to implement [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/05/15.jpg"><img class="alignleft size-full wp-image-1251" title="HTML5 Web Storage" src="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/05/15.jpg" alt="HTML5 Web Storage" width="337" height="286" /></a>Web developers have long yearned for a way to store data long term. Cookies are an option, but they can only store 4KB of data. Additionally, cookies are sent to the server with each HTTP request. This means that cookies, especially large ones, can consume considerable network bandwidth. There have been other attempts to implement storage techniques, but for the most part they have been hacks. Then, along came HTML5 and the Web Storage API to the rescue.</p>
<p>The Web Storage API defines two types of storage areas ― local storage and session storage. Local storage is persistent data which remains until it is explicitly deleted, or until the browser’s cache is cleared. According to the specification, browsers should allocate at least 5MB of local storage per domain. The second storage type, session storage, is also persistent data, however the data is tied to a “top-level browsing context” (i.e. a browser tab or window). Session data remains until it is either deleted or the browsing context is closed. Session storage is particularly useful when a user is interacting with multiple instances of the same website. In such a situation, using local storage could result in the different instances overwriting each others data.</p>
<p><span id="more-1250"></span>The two types of storage areas are accessed through global objects named “localStorage” and “sessionStorage”.  Both storage areas implement the exact same API.  Data is stored as key/value pairs, and all data is stored in string form.  When adding data to storage, it is implicitly converted to a string.  However, when the string data is retrieved from storage it needs to be explicitly converted to the appropriate data type using functions such as <a title="parseInt() Documentation" href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/parseInt" target="_blank">parseInt()</a>.  When dealing with objects, the <a title="Native Browser Support for JSON (Part 1 of 2)" href="http://cjihrig.com/blog/native-browser-support-for-json-part-1/" target="_blank">JSON.parse()</a> and <a title="Native Browser Support for JSON (Part 2 of 2)" href="http://cjihrig.com/blog/native-browser-support-for-json-part-2-of-2/" target="_blank">JSON.stringify()</a> methods should be used for serialization and deserialization.</p>
<h3>Detecting Storage Support</h3>
<p dir="ltr">The Web Storage API, like many other HTML5 features, is not supported by all browsers.  To check if a browser supports storage, use the function shown below.  The function checks for the existence of the global “localStorage” object.  A similar function could be created to check for session storage, but it can be safely assumed that if one storage area exists, then so does the other.</p>
<pre>function localStorageSupported() {
  try {
    return "localStorage" in window &amp;&amp; window["localStorage"] !== null;
  } catch (e) {
    return false;
  }
}</pre>
<h3>Storing Data</h3>
<p>Data is added to storage using the setItem() method.  setItem() takes a key and value as arguments.  If the key does not already exist in storage, then the key/value pair is added.  If the key is already present, then the value is updated.  Several example setItem() usages are shown below.  The examples show how to add data of various types to local and session storage.  Notice that the “key” argument must always be a string, while the type of “value” can vary.</p>
<pre>localStorage.setItem("key", "value");
sessionStorage.setItem("foo", 3.14);
localStorage.setItem("bar", true);
sessionStorage.setItem("baz", JSON.stringify(object));</pre>
<p dir="ltr">Data can also be added to storage using object property assignment statements.  The previous setItem() examples have been rewritten below using assignment statements. Note that the assignment to “key” on the first line will fail silently.  This is because the storage areas have a built in function named key() that will be covered later.  For this reason, the API methods are the preferred way to access storage.</p>
<pre>localStorage.key = "value"; // this fails silently
sessionStorage.foo = 3.14;
localStorage["bar"] = true;
sessionStorage["baz"] = JSON.stringify(object);</pre>
<p>If a site attempts to store too much data, eventually the browser’s storage quota will be exceeded and an exception will be thrown.  To handle this case, try-catch blocks should be used when storing data.  An example of this is shown below.</p>
<pre>try {
  localStorage.setItem("key", "value");
} catch (e) {
  alert("Exceeded Storage Quota!");
}</pre>
<h3>Reading Stored Data</h3>
<p>To read data from storage, the getItem() method is used.  getItem() takes a lookup key as its sole argument.  If the key exists in storage, then the corresponding value is returned.  If the key does not exist, then null is returned.  The following examples use the getItem() method to retrieve the data stored in the setItem() examples.</p>
<pre>var string = localStorage.getItem("key");
var number = sessionStorage.getItem("foo");
var boolean = localStorage.getItem("bar");
var object = JSON.parse(sessionStorage.getItem("baz"));</pre>
<p>Stored data can also be accessed by reading properties of the “localStorage” and “sessionStorage” objects.  The previous getItem() examples have been rewritten below using object property syntax.</p>
<pre>var string = localStorage.key;
var number = sessionStorage.foo;
var boolean = localStorage["bar"];
var object = JSON.parse(sessionStorage["baz"]);</pre>
<h3>Iterating Over Stored Data</h3>
<p>Often times, it is necessary to programmatically loop over all of the items in storage.  The loop’s upper bound is determined by the “length” property of the particular storage area.  The stored keys can be retrieved one at a time using the key() method.  key() takes a single integer parameter that acts as an index to the storage area.  An example of looping over each key/value pair in “localStorage” is shown below.  Of course, session storage can be processed in a similar fashion by substituting “sessionStorage” for “localStorage”.</p>
<pre>for (var i = 0; i &lt; localStorage.length; i++) {
  var key = localStorage.key(i);
  var value = localStorage.getItem(key);
  // do something with the key and value
}</pre>
<h3>Deleting Stored Data</h3>
<p>When data is no longer needed, it should be explicitly removed.  This is especially true for local storage, as it will persist even after the browser is closed.  To delete individual key/value pairs from storage, the removeItem() method is used.  The removeItem() method takes the key to be deleted as its only parameter.  If the key is not present then nothing will happen.  Examples of the removeItem() method are shown below.</p>
<pre>localStorage.removeItem("key");
sessionStorage.removeItem("foo");
localStorage.removeItem("bar");
sessionStorage.removeItem("baz");</pre>
<p>The delete operator can also be used to remove stored data.  The previous example is rewritten below using delete instead of removeItem().</p>
<pre>delete localStorage.key;
delete sessionStorage.foo;
delete localStorage["bar"];
delete sessionStorage["baz"];</pre>
<p dir="ltr">While removeItem() is used to delete individual pieces of data, the clear() method is used to delete all stored data.  Usages of the clear() method are shown below.</p>
<pre>localStorage.clear();
sessionStorage.clear();</pre>
<h3>The storage Event</h3>
<p>A user can potentially have several instances of the same site open at any given time.  Changes made to a storage area in one instance need to be reflected in the other instances.  The Web Storage API accomplishes this synchronization using the “storage” event.  When a storage area is changed, a “storage” event is fired for any other tabs/windows that are sharing the storage area.  Note that a “storage” event is <em>not</em> fired for the tab/window that changes the storage area.</p>
<p>Storage areas can be changed by calls to setItem(), removeItem(), and clear().  However, not all calls to these methods actually change the storage area.  For example, calling clear() on an empty storage area or removeItem() on a key that does not exist will not change the storage area, and therefore will not fire an event.</p>
<p>The “storage” event object has several fields of interest which are described below.  Following the description of the fields is an example “storage” event handler.</p>
<ul>
<li>“key” ― This field is the key argument of setItem() or removeItem(), or null when clear() caused the event to be fired.</li>
<li>“newValue” ― The “value” argument to setItem() is reflected in this field.  Calls to removeItem() and clear() cause this field to be null.</li>
<li>“oldValue” ― This field holds the key’s value prior to a call to setItem() or removeItem().  Calls to clear() cause this field to be null.</li>
<li>“url” ― The “url” field stores the address of the page whose storage area was affected.</li>
<li>“storageArea” ― The “storageArea” field corresponds to the local or session storage area that was changed.</li>
</ul>
<pre>window.addEventListener("storage", function(event) {
  var key = event.key;
  var newValue = event.newValue;
  var oldValue = event.oldValue;
  var url = event.url;
  var storageArea = event.storageArea;
  // handle the event
});</pre>
<h3>Example Page</h3>
<p>The following code implements a sample page for manipulating local storage.  The page is also available online <a title="Web Storage Example" href="http://www.cjihrig.com/development/html5/storage.htm" target="_blank">here</a>.  The example covers the entire local storage API, including the “storage” event.  In order to see the “storage” event in action, the page must be open in at least two separate tabs/windows of the same browser.  The “storage” event will also only work if the page is served over HTTP (i.e. the file:// protocol will not work).</p>
<pre>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;title&gt;Web Storage Example&lt;/title&gt;
  &lt;meta charset="UTF-8" /&gt;
  &lt;script&gt;
    "use strict";
    window.addEventListener("load", function(event) {
      var key = document.getElementById("key");
      var value = document.getElementById("value");
      var add = document.getElementById("add");
      var remove = document.getElementById("remove");
      var clear = document.getElementById("clear");
      var content = document.getElementById("content");
      add.addEventListener("click", function(event) {
        if (key.value !== "") {
          try {
            localStorage.setItem(key.value, value.value);
          } catch (e) {
            alert("Exceeded Storage Quota!");
          }
          refreshContents();
        }
      });
      remove.addEventListener("click", function(event) {
        if (key.value !== "") {
          localStorage.removeItem(key.value);
          refreshContents();
        }
      });
      clear.addEventListener("click", function(event) {
        localStorage.clear();
        refreshContents();
      });
      window.addEventListener("storage", function(event) {
        var k = event.key;
        var newValue = event.newValue;
        var oldValue = event.oldValue;
        var url = event.url;
        var storageArea = event.storageArea;
        alert("EVENT:\n" + k + "\n" + newValue + "\n" + oldValue + "\n" + url + "\n" + storageArea);
        refreshContents();
      });
      function refreshContents() {
        var str = "";
        for (var i = 0, len = localStorage.length; i &lt; len; i++) {
          var k = localStorage.key(i);
          var v = localStorage.getItem(k);
          str += "'" + k + "' = '" + v + "'&lt;br /&gt;";
        }
        key.value = "";
        value.value = "";
        content.innerHTML = str;
      }
      refreshContents();
    });
  &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
  Key:  &lt;input type="text" id="key" /&gt;&lt;br /&gt;
  Value: &lt;input type="text" id="value" /&gt;&lt;br /&gt;
  &lt;input type="button" id="add" value="Add to Storage" /&gt;&amp;nbsp;
  &lt;input type="button" id="remove" value="Remove from Storage" /&gt;&amp;nbsp;
  &lt;input type="button" id="clear" value="Clear Storage" /&gt;&lt;br /&gt;
  Contents of Local Storage:&lt;br /&gt;
  &lt;span id="content"&gt;&lt;/span&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h3>Things to Remember</h3>
<ul>
<li>Local storage persists until it is explicitly deleted or the browser’s cache is cleared.</li>
<li>Session storage persists until it is explicitly deleted or the browsing context is closed.</li>
<li>Data stored by one browser is not accessible by another browser.  For example, data stored by Chrome is not seen by Firefox.</li>
<li>Objects should be stored as JSON strings.</li>
<li>For security reasons, sensitive data should not be stored, especially in local storage.</li>
<li>Changes to a storage area cause a “storage” event to be fired.</li>
<li>As with many other HTML5 features, web storage is not yet implemented consistently.</li>
</ul>
<p>via: <a title="sitepoint" href="http://www.sitepoint.com/an-overview-of-the-web-storage-api/" target="_blank">sitepoint</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flash-to-html5.net/blog/an-overview-of-the-web-storage-api/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 Tool Of The Day – HTML 5 Outliner</title>
		<link>http://www.flash-to-html5.net/blog/html5-tool-of-the-day-%e2%80%93-html-5-outliner</link>
		<comments>http://www.flash-to-html5.net/blog/html5-tool-of-the-day-%e2%80%93-html-5-outliner#comments</comments>
		<pubDate>Thu, 10 May 2012 08:11:12 +0000</pubDate>
		<dc:creator>Sophie.Y</dc:creator>
				<category><![CDATA[HTML5 Tools]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[HTML5 markup]]></category>
		<category><![CDATA[HTML5 outliner]]></category>
		<category><![CDATA[html5 tool]]></category>

		<guid isPermaLink="false">http://www.flash-to-html5.net/blog/?p=1240</guid>
		<description><![CDATA[HTML5 outliner is a great tool that allows you check Your HTML Structure. By examining the outline of your HTML5 markup, you will get an overview of your document. Thus, you may make sure whether you have used headings and sections elements correctly. This HTML5 tool enables you paste in your code, point it to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/05/14.jpg"><img class="alignnone size-full wp-image-1241" title="HTML 5 Outliner" src="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/05/14.jpg" alt="HTML 5 Outliner" width="560" height="348" /></a></p>
<p><a href="http://gsnedders.html5.org/outliner/" target="_blank">HTML5 outliner</a> is a great tool that allows you check Your HTML Structure. By examining the outline of your HTML5 markup, you will get an overview of your document. Thus, you may make sure whether you have used headings and sections elements correctly.</p>
<p>This HTML5 tool enables you paste in your code, point it to a URL or upload a file easily. With these new elements, you are able to make your content flow in a logical manner. As a web designer or developer, the HTML5 outliner is truly another useful tool to have in your toolkit.</p>
<p><span id="more-1240"></span>Moreover, there is another HTML5 outliner (<a href="http://code.google.com/p/h5o/" target="_blank">h5o</a>), which is an implementation of the algorithm in JavaScript. This tool aims to produce outlines in decent browsers and has a Google Chrome extension, which uses the HTML5 outline algorithm to create a table of contents. Try it if necessary.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flash-to-html5.net/blog/html5-tool-of-the-day-%e2%80%93-html-5-outliner/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Safeguard Your Site with HTML5 Sandbox</title>
		<link>http://www.flash-to-html5.net/blog/how-to-safeguard-your-site-with-html5-sandbox</link>
		<comments>http://www.flash-to-html5.net/blog/how-to-safeguard-your-site-with-html5-sandbox#comments</comments>
		<pubDate>Tue, 08 May 2012 08:38:39 +0000</pubDate>
		<dc:creator>Sophie.Y</dc:creator>
				<category><![CDATA[HTML5 Tools]]></category>
		<category><![CDATA[HTML5 Tutorials]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[HTML5 sandbox]]></category>
		<category><![CDATA[Sandbox]]></category>

		<guid isPermaLink="false">http://www.flash-to-html5.net/blog/?p=1224</guid>
		<description><![CDATA[Today’s web applications are mash ups of new experiences into one experience. Think Twitter widgets showing the latest tweets about a product. Or Facebook comments discussing an article. Or even just integrated web pages through an iframe element. These experiences can increase security breaches to your site. Don’t stress … there’s a new kid on [...]]]></description>
			<content:encoded><![CDATA[<p>Today’s web applications are mash ups of new experiences into one experience. Think Twitter widgets showing the latest tweets about a product. Or Facebook comments discussing an article. Or even just integrated web pages through an <code>iframe</code> element. These experiences can increase security breaches to your site.</p>
<p>Don’t stress … there’s a new kid on the block to help you out: the HTML5 sandbox. But before I get to that, let’s quickly review <code>iframe</code> element issues.</p>
<h3>A Black Box</h3>
<p>Embedding content with an <code>iframe</code> is like announcing a party publicly on Facebook. You think you know who you invited, but really you have no idea who passed it on and who’ll show up.</p>
<p>The same is true for framing content. You know what you are referencing, but you have no clue how the site will evolve in the future. Content or functionality (or both) can change any time. Without you knowing … and without your approval.</p>
<h3>Security Concerns Using Iframe</h3>
<p>Browsers handle pages that use <code>iframe</code> just like any other web page. Forms can be used to retrieve user input, scripts can be executed, the page can navigate within the browser window, and browser plugins can be executed. And just like the party crashers who get out of hand, you have no control what the hosted content will do.</p>
<p><span id="more-1224"></span>There is one mechanism in place by default that prevents some kinds of attacks: the cross-domain policy.</p>
<h3>Re-hosting Content From Another Domain</h3>
<p>If hosted content is coming from another domain, cross-domain policy comes into play and it prohibits the “foreign” content from accessing the parent’s document object model.</p>
<p><a href="http://www.flash-to-html5.net/blog/?attachment_id=54022" rel="attachment wp-att-54022" target="_blank"><img title="Unique origin: iframe originating from xyz.com within an HTML5 page originating from mydomain.com" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/04/Screen-Shot-2012-04-27-at-2.05.07-PM.png" alt="" width="678" height="333" /></a></p>
<p>So, the embedded page is not able to read, for instance, cookies or the browser’s local storage for the hosted domain. But there are still risks left.</p>
<p>Hosted content can still re-navigate on the top level. By displaying content the user would expect, the site could attempt to phish confidential information from the user. Or, by using a similarly styled form, attempt to maliciously capture user information that way.</p>
<p>That’s why, even with the cross-domain policy in place, there are still big security risks.</p>
<h3>Re-hosting Content From the Same Domain</h3>
<p><strong>The case for re-hosting content from the same domain is even worse.</strong></p>
<p>When the content comes from the same domain, there are no default security restrictions in place. Embedded content can access the complete loaded browser DOM and manipulate everything.</p>
<p>It kind of makes sense that content on the same domain should be safe. The risk here primarily stems from user-generated content that is re-hosted in the <code>iframe</code>.</p>
<p><a href="http://www.flash-to-html5.net/blog/?attachment_id=54023" rel="attachment wp-att-54023" target="_blank"><img title="Same origin: iframe originating from mydomain.com within an HTML5 page originating from mydomain.com" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/04/Screen-Shot-2012-04-27-at-2.05.21-PM.png" alt="" width="677" height="300" /></a></p>
<h3>A Sandboxed Approach</h3>
<p>These valid security concerns hadn’t been properly addressed by a standards body for a long time. Without a clear W3C standard, it was essential to somehow secure the host from framed content. For example, Microsoft provided a <a href="http://blogs.msdn.com/b/ie/archive/2008/01/18/using-frames-more-securely.aspx" target="_blank">proprietary implementation</a> of <code>iframe</code> security in Internet Explorer 8. Others picked it up and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=341604" target="_blank">discussed</a> it as the baseline for their browsers as well. But standards have matured greatly since IE8.</p>
<p>Modern browsers including Chrome, Firefox, and <a href="http://msdn.microsoft.com/en-us/ie/hh272905.aspx#_HTML5Sandbox" target="_blank">IE10 Platform Preview</a> are based on the <a href="http://dev.w3.org/html5/spec-author-view/the-iframe-element.html#attr-iframe-sandbox" target="_blank">W3C iframe sandbox attribute</a>.</p>
<p>Here’s what we’ll build today with sandbox. See <a href="http://kouder.net/images/demos/sandbox/index.html" target="_blank">the demo here</a>.</p>
<p><a href="http://www.flash-to-html5.net/blog/?attachment_id=53944" rel="attachment wp-att-53944"><img title="HTML5 IFrame Sandbox Demo" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/04/Screen-Shot-2012-04-27-at-2.05.34-PM.png" alt="" width="315" height="394" /></a></p>
<p>Let’s begin by applying the sandbox. Just add it as empty attribute to the <code>iframe</code> element:</p>
<pre>&lt;iframe sandbox src="http://somewebsite.com/default.html"&gt;&lt;/iframe&gt;</pre>
<p>That’s it!</p>
<p>Now, <code>iframe</code> sandboxed content is re-hosted in the browser with the following restrictions:</p>
<ul>
<li>Plugins are disabled. Any kind of ActiveX, Flash, or Silverlight plugin will not be executed.</li>
<li>Forms are disabled. The hosted content is not allowed to make forms post back to any target.</li>
<li>Scripts are disabled. JavaScript is disabled and will not execute.</li>
<li>Links to other browsing contexts are disabled. An anchor tag targeting different browser levels will not execute.</li>
<li>Unique origin treatment. All content is treated under a unique origin. The content is not able to traverse the DOM or read cookie information.</li>
</ul>
<p>This means that even content coming from the same domain is treated with the cross-domain policy, as each <code>iframe</code> content will be viewed as a unique origin.</p>
<p><a href="http://www.flash-to-html5.net/blog/?attachment_id=53945" rel="attachment wp-att-53945"><img title="Unique origin: iframe originating from mydomain.com with a sandbox attribute within an HTML5 page originating from mydomain.com" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/04/Screen-Shot-2012-04-27-at-2.05.48-PM.png" alt="" width="673" height="303" /></a></p>
<p>Embedded content is only permitted to display information. No other actions can be done inside the <code>iframe</code> that could compromise the hosting website or take advantage of the users’ trust.</p>
<h3>Checking for the Sandbox Attribute</h3>
<p>We know that an <code>iframe</code> is an open gate. We know that the <code>sandbox</code> attribute locks down security of hosted content. The decision is clear: Use <code>iframe</code> elements just with the <code>sandbox</code> attribute!</p>
<p>You can confirm that the browser supports the <code>iframe</code> <code>sandbox</code> attribute with a simple check in JavaScript:</p>
<pre>if("sandbox" in document.createElement("iframe")) {
  // render the iframe element ...
} else {
  // embed content through other ways,
  // as the browser does not support the sandbox
}</pre>
<p>If it is supported, just use the <code>sandbox</code> attribute. If not, try to embed the content through other ways or encourage the user with a message that they should upgrade to a <a href="http://www.ietestdrive.com/" target="_blank">modern browser</a>.</p>
<h3>Customizing the Sandbox</h3>
<p>There are cases where you’ll need some level of customization on the restrictions, which is absolutely possible.</p>
<p>Several attribute values relax the standard sandbox policy …</p>
<p>allow-forms</p>
<p>If you want to enable forms post back within the <code>iframe</code> element, you just specify the <code>allow-forms</code> value for the <code>sandbox</code> attribute.</p>
<pre>&lt;iframe sandbox="allow-forms" src="xyz.html"&gt;&lt;/iframe&gt;</pre>
<p>If this value is present, the embedded page is allowed to post back using a form submit within the frame.</p>
<p>allow-scripts</p>
<p>JavaScript is a powerful language and is often used to have dynamic interactions on the client side without resending information to the server. But that power also brings risks when re-hosting foreign web pages.</p>
<p>Therefore, you should carefully consider whether you really want to enable JavaScript in <code>iframe</code> scenarios—especially when the content is from an unknown source.</p>
<p>Enabling JavaScript is done through the <code>allow-scripts</code> value.</p>
<pre>&lt;iframe sandbox="allow-scripts" src="xyz.html"&gt;&lt;/iframe&gt;</pre>
<p>allow-same-origin</p>
<p>By default, an <code>IFRAME</code> page from the same domain has the possibility to access the parent’s document object model.</p>
<p>With the <code>sandbox</code> attribute in place, the page will be treated as not being from the same origin. This page has no access to the resources, even when coming from the same domain.</p>
<p>To re-enable same-origin treatment in a sandboxed scenario, you have to specify the <code>allow-same-origin</code> attribute.</p>
<pre>&lt;iframe sandbox="allow-same-origin" src="xyz.html"&gt;&lt;/iframe&gt;</pre>
<p>The value itself is not very helpful, as you need some script capabilities to make use of it.</p>
<p>For example, if you want to access the local storage of the current domain like this:</p>
<pre>function loadFromStorage(key) {
  if(localStorage) {
    return localStorage.getItem(key);
  }
});</pre>
<p>… you also need the <code>allow-scripts</code> value:</p>
<pre>&lt;iframe sandbox="allow-scripts allow-same-origin" src="xyz.html"&gt;&lt;/iframe&gt;</pre>
<p>Now access works!</p>
<p>But be warned: allowing multiple scripts in the same sandbox can lead to security vulnerabilities. For example, your hosted content can manipulate the attributes of the sandbox and remove further restrictions.</p>
<p>allow-top-navigation</p>
<p>When you use the <code>sandbox</code> attribute, anchor targeting other browsing contexts are ignored and not executed by default. This protects the website hosting the <code>iframe</code> content from being replaced by the hosted content.</p>
<p>For example, this link would not be executed in the default sandbox, as the target would replace the complete web page:</p>
<pre>&lt;a href="xyz.html" target="_top"&gt;Click me&lt;/a&gt;</pre>
<p>Relaxing this policy is only recommended if you trust the content you host.</p>
<pre>&lt;iframe sandbox="allow-top-navigation" src="xyz.html"&gt;&lt;/iframe&gt;</pre>
<p>ms-allow-popups</p>
<p>Sometimes it is useful to allow embedded content opening up new popup windows. A perfect example is a mapping service like Bing Maps.</p>
<p>When embedding Bing Maps, additional functionality like driving directions or destination details can be looked up in popup windows. But since <code>sandbox</code> prohibits this, there’s a setting in Internet Explorer 10 that will enable popups without compromising the sandbox.</p>
<p>The following code shows how to set up <code>ms-allow-popups</code>:</p>
<pre>&lt;iframe sandbox="ms-allow-popups" src="xyz.html"&gt;&lt;/iframe&gt;</pre>
<p>When setting this value, embedded sites are able to display information in a new window.</p>
<pre>&lt;a href="xyz.html" target="_new"&gt;Show Info&lt;/a&gt;</pre>
<h3>Putting it all together</h3>
<p>You can combine several attribute values on one sandbox. For instance, if you want to enable forms post-back, top-level navigation, and JavaScript, just specify:</p>
<pre>&lt;iframe sandbox="allow-forms allow-top-navigation allow-scripts" src="xyz.html"&gt;&lt;/iframe&gt;</pre>
<p>It is also good to know that the sandbox behaves correctly when used in hierarchical situations, using several nested <code>iframe</code>s with different <code>sandbox</code> attribute values. The top-level <code>sandbox</code> always dominates down the hierarchy.</p>
<h3>Get Hands On!</h3>
<p>You can play around with the HTML <code>sandbox</code> in <a href="http://kouder.net/storage/demos/sandbox/index.html" target="_blank">this demo</a>. And you can download a <a href="https://github.com/writeline/HTML5-Sandbox-Demo">copy of this demo</a> from GitHub. To enable the form post-back demo, just open the project folder in WebMatrix and start the project from there.</p>
<p>Then, download a modern browser (like <a href="http://ie.microsoft.com/testdrive/Default.html">Internet Explorer 10 Platform Preview</a>) and familiarize yourself with the <code>sandbox</code> by reading the <a href="http://msdn.microsoft.com/de-de/ie/gg192966.aspx">IE developer guide</a>. This single attribute is a big step toward a more secure web … and modern browsers are finally ready to sandbox embedded content.</p>
<p>via: <a href="http://www.sitepoint.com/how-to-safeguard-your-site-with-html5-sandbox/" target="_blank">sitepoint</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flash-to-html5.net/blog/how-to-safeguard-your-site-with-html5-sandbox/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 Tool Of The Day – Cloudkick Viz</title>
		<link>http://www.flash-to-html5.net/blog/html5-tool-of-the-day-%e2%80%93-cloudkick-viz</link>
		<comments>http://www.flash-to-html5.net/blog/html5-tool-of-the-day-%e2%80%93-cloudkick-viz#comments</comments>
		<pubDate>Fri, 04 May 2012 03:48:26 +0000</pubDate>
		<dc:creator>Sophie.Y</dc:creator>
				<category><![CDATA[HTML5 Tools]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[HTML5 canvas tool]]></category>
		<category><![CDATA[html5 tool]]></category>

		<guid isPermaLink="false">http://www.flash-to-html5.net/blog/?p=1220</guid>
		<description><![CDATA[Cloudkick Viz is another HTML5 canvas tool. Built on HTML5, canvas, and JavaScript, it displays cloud server monitoring information when checking your servers. Servers are plotted in 3D space in real time on basis of performance metrics like CPU usage, Memory usage, and Ping latency. Each server will blink when monitoring data is updated, and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/05/13.jpg"><img class="alignnone size-full wp-image-1221" title="HTML5 Tool Of The Day – Cloudkick Viz" src="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/05/13.jpg" alt="HTML5 Tool Of The Day – Cloudkick Viz" width="558" height="345" /></a></p>
<p align="left"><a href="https://www.cloudkick.com/viz/mozilla/" target="_blank">Cloudkick Viz</a> is another HTML5 canvas tool. Built on HTML5, canvas, and JavaScript, it displays cloud server monitoring information when checking your servers. Servers are plotted in 3D space in real time on basis of performance metrics like CPU usage, Memory usage, and Ping latency. Each server will blink when monitoring data is updated, and if there is a check goes critical, it shakes and turns an angry red. What’s more, if you hover over a server, this canvas tool will show you its name and a ghost trail based on performance history. If you click it, you will get detailed monitoring data.</p>
<p align="left"><span id="more-1220"></span>As you can see from the screenshot, the circles represent your servers. And of cause that more powerful servers will be larger than less powerful ones. The help page of this app will inform you that red pulsing circles indicate servers in a warning or critical state, and flashing circles indicate a server being updated with new data. With this HTML5 canvas tool, you can also rotate the view by clicking and dragging in an empty area or by operating with the arrow keys.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flash-to-html5.net/blog/html5-tool-of-the-day-%e2%80%93-cloudkick-viz/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 Tool Of The Day – Visual Form Builder</title>
		<link>http://www.flash-to-html5.net/blog/html5-tool-of-the-day-%e2%80%93-visual-form-builder</link>
		<comments>http://www.flash-to-html5.net/blog/html5-tool-of-the-day-%e2%80%93-visual-form-builder#comments</comments>
		<pubDate>Thu, 03 May 2012 02:22:56 +0000</pubDate>
		<dc:creator>Sophie.Y</dc:creator>
				<category><![CDATA[HTML5 Tools]]></category>
		<category><![CDATA[HTML coding]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[HTML5 application]]></category>
		<category><![CDATA[HTML5 forms]]></category>
		<category><![CDATA[html5 tool]]></category>

		<guid isPermaLink="false">http://www.flash-to-html5.net/blog/?p=1217</guid>
		<description><![CDATA[Just as its name implies, Visual Form Builder allows you to build and manage all kinds of beautiful HTML5 forms for your website. This HTML5 tool is a plug-in to create fully functional contact forms with a few clicks using a simple and clean interface. No PHP, CSS, or HTML coding requirement. These forms include [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/05/12.jpg"><img class="alignnone size-full wp-image-1218" title="HTML5 Tool Of The Day – Visual Form Builder" src="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/05/12.jpg" alt="HTML5 Tool Of The Day – Visual Form Builder" width="519" height="364" /></a></p>
<p>Just as its name implies, <a href="http://codecanyon.net/item/visual-form-builder-beautiful-forms-in-seconds/162388?ref=zbiskup" target="_blank">Visual Form Builder</a> allows you to build and manage all kinds of beautiful HTML5 forms for your website. This HTML5 tool is a plug-in to create fully functional contact forms with a few clicks using a simple and clean interface. No PHP, CSS, or HTML coding requirement. These forms include jQuery validation, a basic logic-based verification system, and entry tracking. Something to keep in mind is using Visual Form Builder requires a modern browser. However, the forms built by this HTML5 application are compatible with all browsers.</p>
<p align="left"><span id="more-1217"></span>Visual Form Builder enables client and server side validation, and each form you create has its integrated side validation built in. With the powerful and simple validation options, the script will automatically validate HTML5 fields based on their type. This HTML5 form creator supports all field type (Text, Text Area, Select, Radio, Checkbox, Password, File, Email, Number, URL, Date, and Range) and even HTML5 fields. In addition, you can easily add your own additional themes to this application.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flash-to-html5.net/blog/html5-tool-of-the-day-%e2%80%93-visual-form-builder/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 Tool Of The Day – iGrapher</title>
		<link>http://www.flash-to-html5.net/blog/html5-tool-of-the-day-%e2%80%93-igrapher</link>
		<comments>http://www.flash-to-html5.net/blog/html5-tool-of-the-day-%e2%80%93-igrapher#comments</comments>
		<pubDate>Wed, 02 May 2012 07:33:25 +0000</pubDate>
		<dc:creator>Sophie.Y</dc:creator>
				<category><![CDATA[HTML5 Tools]]></category>
		<category><![CDATA[HTML5 canvas]]></category>
		<category><![CDATA[HTML5 canvas tool]]></category>
		<category><![CDATA[html5 tool]]></category>

		<guid isPermaLink="false">http://www.flash-to-html5.net/blog/?p=1213</guid>
		<description><![CDATA[iGrapher is a HTML5 canvas tool, also we may call it a canvas app. It is used for charting, analysis and prediction of different stock, currency and commodity markets. With this tool, you are able to make a schematic and technical drawing of different international stocks from the major markets. These stocks range from the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/05/11.jpg"><img class="alignnone size-full wp-image-1214" title="HTML5 Tool Of The Day – iGrapher" src="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/05/11.jpg" alt="HTML5 Tool Of The Day – iGrapher" width="584" height="414" /></a></p>
<p align="left"><a href="http://igrapher.com/" target="_blank">iGrapher</a> is a HTML5 canvas tool, also we may call it a canvas app. It is used for charting, analysis and prediction of different stock, currency and commodity markets. With this tool, you are able to make a schematic and technical drawing of different international stocks from the major markets. These stocks range from the FTSE to Dow Jones against different commodities including gold and global currencies. At the same time, you can also plot the news activity of a stock to make clear of the correlations between news reports and stock market movements.</p>
<p align="left"><span id="more-1213"></span>iGrapher has many more features like algorithmic analysis of the trends. This web based financial market visualization tool is free of charge and employs canvas to draw the graphs of those financial data. The best thing is this HTML5 tool is very easy to use. What you need to do is make some selections from the right hand menu, then iGrapher will help you draw a graph to compare each selection. Meanwhile, you can check out the value of each selection on the highlighted date by hovering over the graph.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flash-to-html5.net/blog/html5-tool-of-the-day-%e2%80%93-igrapher/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fluid CSS3 Slideshow with Parallax Effect</title>
		<link>http://www.flash-to-html5.net/blog/fluid-css3-slideshow-with-parallax-effect</link>
		<comments>http://www.flash-to-html5.net/blog/fluid-css3-slideshow-with-parallax-effect#comments</comments>
		<pubDate>Wed, 02 May 2012 03:15:49 +0000</pubDate>
		<dc:creator>Sophie.Y</dc:creator>
				<category><![CDATA[HTML5 & CSS3]]></category>
		<category><![CDATA[CSS3 properties]]></category>
		<category><![CDATA[CSS3 tutorial]]></category>
		<category><![CDATA[parallax effect]]></category>

		<guid isPermaLink="false">http://www.flash-to-html5.net/blog/?p=1206</guid>
		<description><![CDATA[View demo Download source In this tutorial, we are going to create a slideshow with a parallax effect with the help of some CSS3 properties. We’ll use radio buttons and sibling combinators for controlling which slide is shown. There will be two backgrounds and the idea is to change the background positions and the position [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://tympanus.net/Tutorials/CSS3FluidParallaxSlideshow/" target="_blank"><img class="alignnone size-full wp-image-1207" title="CSS3FluidParallaxSlideshow" src="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/05/1.jpg" alt="CSS3FluidParallaxSlideshow" width="558" height="259" /></a></p>
<p><a href="http://tympanus.net/Tutorials/CSS3FluidParallaxSlideshow/" target="_blank">View demo</a> <a href="http://tympanus.net/Tutorials/CSS3FluidParallaxSlideshow/CSS3FluidParallaxSlideshow.zip" target="_blank">Download source</a></p>
<p>In this tutorial, we are going to create a slideshow with a parallax effect with the help of some CSS3 properties. We’ll use radio buttons and sibling combinators for controlling which slide is shown. There will be two backgrounds and the idea is to change the background positions and the position of the slider with transitions in order to create a slight parallax effect.</p>
<p>The graphics used in the demo are by: <a href="http://5milli.deviantart.com/art/Global-Map-Vector-100880703" target="_blank">5Milli</a> (Global Vector Map) and by <a href="http://wegraphics.net/downloads/free-vector-infographic-kit/" target="_blank">WeGraphics</a> (Free Vector Infographic Kit).</p>
<div><a href="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/05/2.jpg"><img class="alignnone size-full wp-image-1208" title="supported browsers" src="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/05/2.jpg" alt="supported browsers" width="821" height="79" /></a></div>
<div><strong><br />
</strong></div>
<h4><strong>The Markup</strong></h4>
<p>We will “connect” the input elements to the division with the class sp-content by using the general sibling combinator. For that we will leave the inputs on the same level like the sp-content div. When we click on an input we will change the background color and background position of it (grid pattern) and also the background-position of the sp-parallax-bg div (the world map) with transitions. The respective slide will be shown by moving the sp-slider ul to the right position. The markup looks as follows:</p>
<p><span id="more-1206"></span></p>
<div>
<div id="highlighter_414319">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
<div>12</div>
<div>13</div>
<div>14</div>
<div>15</div>
<div>16</div>
<div>17</div>
<div>18</div>
<div>19</div>
<div>20</div>
<div>21</div>
<div>22</div>
<div>23</div>
<div>24</div>
<div>25</div>
<div>26</div>
<div>27</div>
<div>28</div>
<div>29</div>
<div>30</div>
<div>31</div>
<div>32</div>
<div>33</div>
<div>34</div>
<div>35</div>
</td>
<td>
<div>
<div><code>&lt;</code><code>div</code> <code>class</code><code>=</code><code>"sp-slideshow"</code><code>&gt;</code></div>
<div><code>    </code><code>&lt;</code><code>input</code> <code>id</code><code>=</code><code>"button-1"</code> <code>type</code><code>=</code><code>"radio"</code> <code>name</code><code>=</code><code>"radio-set"</code> <code>class</code><code>=</code><code>"sp-selector-1"</code> <code>checked</code><code>=</code><code>"checked"</code> <code>/&gt;</code></div>
<div><code>    </code><code>&lt;</code><code>label</code> <code>for</code><code>=</code><code>"button-1"</code> <code>class</code><code>=</code><code>"button-label-1"</code><code>&gt;&lt;/</code><code>label</code><code>&gt;</code></div>
<div><code>    </code><code>&lt;</code><code>input</code> <code>id</code><code>=</code><code>"button-2"</code> <code>type</code><code>=</code><code>"radio"</code> <code>name</code><code>=</code><code>"radio-set"</code> <code>class</code><code>=</code><code>"sp-selector-2"</code> <code>/&gt;</code></div>
<div><code>    </code><code>&lt;</code><code>label</code> <code>for</code><code>=</code><code>"button-2"</code> <code>class</code><code>=</code><code>"button-label-2"</code><code>&gt;&lt;/</code><code>label</code><code>&gt;</code></div>
<div><code>    </code><code>&lt;</code><code>input</code> <code>id</code><code>=</code><code>"button-3"</code> <code>type</code><code>=</code><code>"radio"</code> <code>name</code><code>=</code><code>"radio-set"</code> <code>class</code><code>=</code><code>"sp-selector-3"</code> <code>/&gt;</code></div>
<div><code>    </code><code>&lt;</code><code>label</code> <code>for</code><code>=</code><code>"button-3"</code> <code>class</code><code>=</code><code>"button-label-3"</code><code>&gt;&lt;/</code><code>label</code><code>&gt;</code></div>
<div><code>    </code><code>&lt;</code><code>input</code> <code>id</code><code>=</code><code>"button-4"</code> <code>type</code><code>=</code><code>"radio"</code> <code>name</code><code>=</code><code>"radio-set"</code> <code>class</code><code>=</code><code>"sp-selector-4"</code> <code>/&gt;</code></div>
<div><code>    </code><code>&lt;</code><code>label</code> <code>for</code><code>=</code><code>"button-4"</code> <code>class</code><code>=</code><code>"button-label-4"</code><code>&gt;&lt;/</code><code>label</code><code>&gt;</code></div>
<div><code>    </code><code>&lt;</code><code>input</code> <code>id</code><code>=</code><code>"button-5"</code> <code>type</code><code>=</code><code>"radio"</code> <code>name</code><code>=</code><code>"radio-set"</code> <code>class</code><code>=</code><code>"sp-selector-5"</code> <code>/&gt;</code></div>
<div><code>    </code><code>&lt;</code><code>label</code> <code>for</code><code>=</code><code>"button-5"</code> <code>class</code><code>=</code><code>"button-label-5"</code><code>&gt;&lt;/</code><code>label</code><code>&gt;</code></div>
<div><code>    </code><code>&lt;</code><code>label</code> <code>for</code><code>=</code><code>"button-1"</code> <code>class</code><code>=</code><code>"sp-arrow sp-a1"</code><code>&gt;&lt;/</code><code>label</code><code>&gt;</code></div>
<div><code>    </code><code>&lt;</code><code>label</code> <code>for</code><code>=</code><code>"button-2"</code> <code>class</code><code>=</code><code>"sp-arrow sp-a2"</code><code>&gt;&lt;/</code><code>label</code><code>&gt;</code></div>
<div><code>    </code><code>&lt;</code><code>label</code> <code>for</code><code>=</code><code>"button-3"</code> <code>class</code><code>=</code><code>"sp-arrow sp-a3"</code><code>&gt;&lt;/</code><code>label</code><code>&gt;</code></div>
<div><code>    </code><code>&lt;</code><code>label</code> <code>for</code><code>=</code><code>"button-4"</code> <code>class</code><code>=</code><code>"sp-arrow sp-a4"</code><code>&gt;&lt;/</code><code>label</code><code>&gt;</code></div>
<div><code>    </code><code>&lt;</code><code>label</code> <code>for</code><code>=</code><code>"button-5"</code> <code>class</code><code>=</code><code>"sp-arrow sp-a5"</code><code>&gt;&lt;/</code><code>label</code><code>&gt;</code></div>
<div><code>    </code><code>&lt;</code><code>div</code> <code>class</code><code>=</code><code>"sp-content"</code><code>&gt;</code></div>
<div><code>        </code><code>&lt;</code><code>div</code> <code>class</code><code>=</code><code>"sp-parallax-bg"</code><code>&gt;&lt;/</code><code>div</code><code>&gt;</code></div>
<div><code>        </code><code>&lt;</code><code>ul</code> <code>class</code><code>=</code><code>"sp-slider clearfix"</code><code>&gt;</code></div>
<div><code>            </code><code>&lt;</code><code>li</code><code>&gt;&lt;</code><code>img</code> <code>src</code><code>=</code><code>"images/image1.png"</code> <code>alt</code><code>=</code><code>"image01"</code> <code>/&gt;&lt;/</code><code>li</code><code>&gt;</code></div>
<div><code>            </code><code>&lt;</code><code>li</code><code>&gt;&lt;</code><code>img</code> <code>src</code><code>=</code><code>"images/image2.png"</code> <code>alt</code><code>=</code><code>"image02"</code> <code>/&gt;&lt;/</code><code>li</code><code>&gt;</code></div>
<div><code>            </code><code>&lt;</code><code>li</code><code>&gt;&lt;</code><code>img</code> <code>src</code><code>=</code><code>"images/image3.png"</code> <code>alt</code><code>=</code><code>"image03"</code> <code>/&gt;&lt;/</code><code>li</code><code>&gt;</code></div>
<div><code>            </code><code>&lt;</code><code>li</code><code>&gt;&lt;</code><code>img</code> <code>src</code><code>=</code><code>"images/image4.png"</code> <code>alt</code><code>=</code><code>"image04"</code> <code>/&gt;&lt;/</code><code>li</code><code>&gt;</code></div>
<div><code>            </code><code>&lt;</code><code>li</code><code>&gt;&lt;</code><code>img</code> <code>src</code><code>=</code><code>"images/image5.png"</code> <code>alt</code><code>=</code><code>"image05"</code> <code>/&gt;&lt;/</code><code>li</code><code>&gt;</code></div>
<div><code>        </code><code>&lt;/</code><code>ul</code><code>&gt;</code></div>
<div><code>    </code><code>&lt;/</code><code>div</code><code>&gt;</code><code>&lt;!-- sp-content --&gt;</code></div>
<div><code>&lt;/</code><code>div</code><code>&gt;</code><code>&lt;!-- sp-slideshow --&gt;</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The list elements are the wrappers for each slide and although we are using simply images here, you can use any kind of content.</p>
<h4><strong>The CSS</strong></h4>
<p>We’ll set the width of the main container to 80% and set the width of the divisions with class sp-content and class sp-parallax-bg to 100%. The sp-content div will have a background color and a background image (grid) that we will move whenever we slide the slider ul. The sp-parallax-bg div will have a map as background image and we will also move the background position.</p>
<div>
<div id="highlighter_602624">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
<div>12</div>
<div>13</div>
<div>14</div>
<div>15</div>
<div>16</div>
<div>17</div>
<div>18</div>
<div>19</div>
<div>20</div>
<div>21</div>
<div>22</div>
<div>23</div>
<div>24</div>
<div>25</div>
<div>26</div>
<div>27</div>
<div>28</div>
<div>29</div>
<div>30</div>
</td>
<td>
<div>
<div><code>.sp-slideshow {</code></div>
<div><code>    </code><code>position</code><code>: </code><code>relative</code><code>;</code></div>
<div><code>    </code><code>margin</code><code>: </code><code>10px</code> <code>auto</code><code>;</code></div>
<div><code>    </code><code>width</code><code>: </code><code>80%</code><code>;</code></div>
<div><code>    </code><code>max-width</code><code>: </code><code>1000px</code><code>;</code></div>
<div><code>    </code><code>min-width</code><code>: </code><code>260px</code><code>;</code></div>
<div><code>    </code><code>height</code><code>: </code><code>460px</code><code>;</code></div>
<div><code>    </code><code>border</code><code>: </code><code>10px</code> <code>solid</code> <code>#fff</code><code>;</code></div>
<div><code>    </code><code>border</code><code>: </code><code>10px</code> <code>solid</code> <code>rgba(</code><code>255</code><code>,</code><code>255</code><code>,</code><code>255</code><code>,</code><code>0.9</code><code>);</code></div>
<div><code>    </code><code>box-shadow: </code><code>0</code> <code>2px</code> <code>6px</code> <code>rgba(</code><code>0</code><code>,</code><code>0</code><code>,</code><code>0</code><code>,</code><code>0.2</code><code>);</code></div>
<div><code>}</code></div>
<div><code>.sp-content {</code></div>
<div><code>    </code><code>background</code><code>: </code><code>#7d7f72</code> <code>url</code><code>(../images/grid.png) </code><code>repeat</code> <code>scroll</code> <code>0</code> <code>0</code><code>;</code></div>
<div><code>    </code><code>position</code><code>: </code><code>relative</code><code>;</code></div>
<div><code>    </code><code>width</code><code>: </code><code>100%</code><code>;</code></div>
<div><code>    </code><code>height</code><code>: </code><code>100%</code><code>;</code></div>
<div><code>    </code><code>overflow</code><code>: </code><code>hidden</code><code>;</code></div>
<div><code>}</code></div>
<div><code>.sp-parallax-bg {</code></div>
<div><code>    </code><code>background</code><code>: </code><code>url</code><code>(../images/map.png) </code><code>repeat-x</code> <code>scroll</code> <code>0</code> <code>0</code><code>;</code></div>
<div><code>    </code><code>background-</code><code>size</code><code>: cover;</code></div>
<div><code>    </code><code>position</code><code>: </code><code>absolute</code><code>;</code></div>
<div><code>    </code><code>top</code><code>: </code><code>0</code><code>;</code></div>
<div><code>    </code><code>left</code><code>: </code><code>0</code><code>;</code></div>
<div><code>    </code><code>width</code><code>: </code><code>100%</code><code>;</code></div>
<div><code>    </code><code>height</code><code>: </code><code>100%</code><code>;</code></div>
<div><code>    </code><code>overflow</code><code>: </code><code>hidden</code><code>;</code></div>
<div><code>}</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The styles of the inputs and the labels:</p>
<div>
<div id="highlighter_140762">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
<div>12</div>
<div>13</div>
<div>14</div>
<div>15</div>
<div>16</div>
<div>17</div>
<div>18</div>
<div>19</div>
<div>20</div>
<div>21</div>
<div>22</div>
<div>23</div>
<div>24</div>
<div>25</div>
<div>26</div>
<div>27</div>
<div>28</div>
<div>29</div>
<div>30</div>
<div>31</div>
<div>32</div>
<div>33</div>
<div>34</div>
<div>35</div>
<div>36</div>
<div>37</div>
<div>38</div>
<div>39</div>
<div>40</div>
<div>41</div>
<div>42</div>
<div>43</div>
<div>44</div>
</td>
<td>
<div>
<div><code>.sp-slideshow input {</code></div>
<div><code>    </code><code>position</code><code>: </code><code>absolute</code><code>;</code></div>
<div><code>    </code><code>bottom</code><code>: </code><code>15px</code><code>;</code></div>
<div><code>    </code><code>left</code><code>: </code><code>50%</code><code>;</code></div>
<div><code>    </code><code>width</code><code>: </code><code>9px</code><code>;</code></div>
<div><code>    </code><code>height</code><code>: </code><code>9px</code><code>;</code></div>
<div><code>    </code><code>z-index</code><code>: </code><code>1001</code><code>;</code></div>
<div><code>    </code><code>cursor</code><code>: </code><code>pointer</code><code>;</code></div>
<div><code>    </code><code>opacity: </code><code>0</code><code>;</code></div>
<div><code>}</code></div>
<div><code>.sp-slideshow input + label {</code></div>
<div><code>    </code><code>position</code><code>: </code><code>absolute</code><code>;</code></div>
<div><code>    </code><code>bottom</code><code>: </code><code>15px</code><code>;</code></div>
<div><code>    </code><code>left</code><code>: </code><code>50%</code><code>;</code></div>
<div><code>    </code><code>width</code><code>: </code><code>6px</code><code>;</code></div>
<div><code>    </code><code>height</code><code>: </code><code>6px</code><code>;</code></div>
<div><code>    </code><code>display</code><code>: </code><code>block</code><code>;</code></div>
<div><code>    </code><code>z-index</code><code>: </code><code>1000</code><code>;</code></div>
<div><code>    </code><code>border</code><code>: </code><code>3px</code> <code>solid</code> <code>#fff</code><code>;</code></div>
<div><code>    </code><code>border</code><code>: </code><code>3px</code> <code>solid</code> <code>rgba(</code><code>255</code><code>,</code><code>255</code><code>,</code><code>255</code><code>,</code><code>0.9</code><code>);</code></div>
<div><code>    </code><code>border-radius: </code><code>50%</code><code>;</code></div>
<div><code>    </code><code>transition: background-color linear </code><code>0.1</code><code>s;</code></div>
<div><code>}</code></div>
<div><code>.sp-slideshow input:checked + label {</code></div>
<div><code>    </code><code>background-color</code><code>: </code><code>#fff</code><code>;</code></div>
<div><code>    </code><code>background-color</code><code>: rgba(</code><code>255</code><code>,</code><code>255</code><code>,</code><code>255</code><code>,</code><code>0.9</code><code>);</code></div>
<div><code>}</code></div>
<div><code>.sp-selector</code><code>-1</code><code>, .button-label</code><code>-1</code> <code>{</code></div>
<div><code>    </code><code>margin-left</code><code>: </code><code>-36px</code><code>;</code></div>
<div><code>}</code></div>
<div><code>.sp-selector</code><code>-2</code><code>, .button-label</code><code>-2</code> <code>{</code></div>
<div><code>    </code><code>margin-left</code><code>: </code><code>-18px</code><code>;</code></div>
<div><code>}</code></div>
<div><code>.sp-selector</code><code>-4</code><code>, .button-label</code><code>-4</code> <code>{</code></div>
<div><code>    </code><code>margin-left</code><code>: </code><code>18px</code><code>;</code></div>
<div><code>}</code></div>
<div><code>.sp-selector</code><code>-5</code><code>, .button-label</code><code>-5</code> <code>{</code></div>
<div><code>    </code><code>margin-left</code><code>: </code><code>36px</code><code>;</code></div>
<div><code>}</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>We’ve set the opacity of the inputs to 0 so that they are not visible. The labels are under the radio button and we will make it look like a little circle. All the inputs and labels will be positioned absolutely and we will place them next to each other by applying a left margin.</p>
<p>Next, we will style the arrows which are simply labels with the respective <em>for</em> attribute. Note, that clicking on a label to active an associated input might not work in mobile browsers. But anyway, you can navigate using the dots since we are actually clicking on the inputs.</p>
<p>The arrow labels have the following style:</p>
<div>
<div id="highlighter_796223">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
<div>12</div>
<div>13</div>
<div>14</div>
<div>15</div>
<div>16</div>
<div>17</div>
<div>18</div>
<div>19</div>
</td>
<td>
<div>
<div><code>.sp-arrow {</code></div>
<div><code>    </code><code>position</code><code>: </code><code>absolute</code><code>;</code></div>
<div><code>    </code><code>top</code><code>: </code><code>50%</code><code>;</code></div>
<div><code>    </code><code>width</code><code>: </code><code>28px</code><code>;</code></div>
<div><code>    </code><code>height</code><code>: </code><code>38px</code><code>;</code></div>
<div><code>    </code><code>margin-top</code><code>: </code><code>-19px</code><code>;</code></div>
<div><code>    </code><code>display</code><code>: </code><code>none</code><code>;</code></div>
<div><code>    </code><code>opacity: </code><code>0.8</code><code>;</code></div>
<div><code>    </code><code>cursor</code><code>: </code><code>pointer</code><code>;</code></div>
<div><code>    </code><code>z-index</code><code>: </code><code>1000</code><code>;</code></div>
<div><code>    </code><code>background</code><code>: </code><code>transparent</code> <code>url</code><code>(../images/arrows.png) </code><code>no-repeat</code><code>;</code></div>
<div><code>    </code><code>transition: opacity linear </code><code>0.3</code><code>s;</code></div>
<div><code>}</code></div>
<div><code>.sp-arrow:hover{</code></div>
<div><code>    </code><code>opacity: </code><code>1</code><code>;</code></div>
<div><code>}</code></div>
<div><code>.sp-arrow:active{</code></div>
<div><code>    </code><code>margin-top</code><code>: </code><code>-18px</code><code>;</code></div>
<div><code>}</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Now, let’s define when each arrow is shown. On the first slide we, for example, don’t want to show the left arrow. And on the last slide we don’t want to show the right arrow:</p>
<div>
<div id="highlighter_928260">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
<div>12</div>
<div>13</div>
<div>14</div>
<div>15</div>
<div>16</div>
</td>
<td>
<div>
<div><code>.sp-selector</code><code>-1:</code><code>checked ~ .sp-arrow.sp-a</code><code>2</code><code>,</code></div>
<div><code>.sp-selector</code><code>-2:</code><code>checked ~ .sp-arrow.sp-a</code><code>3</code><code>,</code></div>
<div><code>.sp-selector</code><code>-3:</code><code>checked ~ .sp-arrow.sp-a</code><code>4</code><code>,</code></div>
<div><code>.sp-selector</code><code>-4:</code><code>checked ~ .sp-arrow.sp-a</code><code>5</code> <code>{</code></div>
<div><code>    </code><code>right</code><code>: </code><code>15px</code><code>;</code></div>
<div><code>    </code><code>display</code><code>: </code><code>block</code><code>;</code></div>
<div><code>    </code><code>background-position</code><code>: </code><code>top</code> <code>right</code><code>;</code></div>
<div><code>}</code></div>
<div><code>.sp-selector</code><code>-2:</code><code>checked ~ .sp-arrow.sp-a</code><code>1</code><code>,</code></div>
<div><code>.sp-selector</code><code>-3:</code><code>checked ~ .sp-arrow.sp-a</code><code>2</code><code>,</code></div>
<div><code>.sp-selector</code><code>-4:</code><code>checked ~ .sp-arrow.sp-a</code><code>3</code><code>,</code></div>
<div><code>.sp-selector</code><code>-5:</code><code>checked ~ .sp-arrow.sp-a</code><code>4</code> <code>{</code></div>
<div><code>    </code><code>left</code><code>: </code><code>15px</code><code>;</code></div>
<div><code>    </code><code>display</code><code>: </code><code>block</code><code>;</code></div>
<div><code>    </code><code>background-position</code><code>: </code><code>top</code> <code>left</code><code>;</code></div>
<div><code>}</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>When an input is selected, the sp-content div will have a transition for the <em>background-position</em> and the <em>background-color</em>. The second transition is going to take a bit longer:</p>
<div>
<div id="highlighter_373819">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
</td>
<td>
<div>
<div><code>.sp-slideshow input:checked ~ .sp-content {</code></div>
<div><code>    </code><code>transition: background-position linear </code><code>0.6</code><code>s, background-color linear </code><code>0.8</code><code>s;</code></div>
<div><code>}</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The div with the world map (sp-parallax-bg) will also have a transition for the background-position:</p>
<div>
<div id="highlighter_239565">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
</td>
<td>
<div>
<div><code>.sp-slideshow input:checked ~ .sp-content .sp-parallax-bg {</code></div>
<div><code>    </code><code>transition: background-position linear </code><code>0.7</code><code>s;</code></div>
<div><code>}</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>In this way we can add a background parallax effect.</p>
<p>Let’s define the changes to color and background-position for the sp-content div:</p>
<div>
<div id="highlighter_852626">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
<div>12</div>
<div>13</div>
<div>14</div>
<div>15</div>
<div>16</div>
<div>17</div>
<div>18</div>
<div>19</div>
<div>20</div>
<div>21</div>
<div>22</div>
<div>23</div>
<div>24</div>
</td>
<td>
<div>
<div><code>input.sp-selector</code><code>-1:</code><code>checked ~ .sp-content {</code></div>
<div><code>    </code><code>background-position</code><code>: </code><code>0</code> <code>0</code><code>;</code></div>
<div><code>    </code><code>background-color</code><code>: </code><code>#727b7f</code><code>;</code></div>
<div><code>}</code></div>
<div><code>input.sp-selector</code><code>-2:</code><code>checked ~ .sp-content {</code></div>
<div><code>    </code><code>background-position</code><code>: </code><code>-100px</code> <code>0</code><code>;</code></div>
<div><code>    </code><code>background-color</code><code>: </code><code>#7f7276</code><code>;</code></div>
<div><code>}</code></div>
<div><code>input.sp-selector</code><code>-3:</code><code>checked ~ .sp-content {</code></div>
<div><code>    </code><code>background-position</code><code>: </code><code>-200px</code> <code>0</code><code>;</code></div>
<div><code>    </code><code>background-color</code><code>: </code><code>#737f72</code><code>;</code></div>
<div><code>}</code></div>
<div><code>input.sp-selector</code><code>-4:</code><code>checked ~ .sp-content {</code></div>
<div><code>    </code><code>background-position</code><code>: </code><code>-300px</code> <code>0</code><code>;</code></div>
<div><code>    </code><code>background-color</code><code>: </code><code>#79727f</code><code>;</code></div>
<div><code>}</code></div>
<div><code>input.sp-selector</code><code>-5:</code><code>checked ~ .sp-content {</code></div>
<div><code>    </code><code>background-position</code><code>: </code><code>-400px</code> <code>0</code><code>;</code></div>
<div><code>    </code><code>background-color</code><code>: </code><code>#7d7f72</code><code>;</code></div>
<div><code>}</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>… and the sp-parallax-bg div:</p>
<div>
<div id="highlighter_364694">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
<div>12</div>
<div>13</div>
<div>14</div>
<div>15</div>
<div>16</div>
<div>17</div>
<div>18</div>
<div>19</div>
</td>
<td>
<div>
<div><code>input.sp-selector</code><code>-1:</code><code>checked ~ .sp-content .sp-parallax-bg {</code></div>
<div><code>    </code><code>background-position</code><code>: </code><code>0</code> <code>0</code><code>;</code></div>
<div><code>}</code></div>
<div><code>input.sp-selector</code><code>-2:</code><code>checked ~ .sp-content .sp-parallax-bg {</code></div>
<div><code>    </code><code>background-position</code><code>: </code><code>-200px</code> <code>0</code><code>;</code></div>
<div><code>}</code></div>
<div><code>input.sp-selector</code><code>-3:</code><code>checked ~ .sp-content .sp-parallax-bg {</code></div>
<div><code>    </code><code>background-position</code><code>: </code><code>-400px</code> <code>0</code><code>;</code></div>
<div><code>}</code></div>
<div><code>input.sp-selector</code><code>-4:</code><code>checked ~ .sp-content .sp-parallax-bg {</code></div>
<div><code>    </code><code>background-position</code><code>: </code><code>-600px</code> <code>0</code><code>;</code></div>
<div><code>}</code></div>
<div><code>input.sp-selector</code><code>-5:</code><code>checked ~ .sp-content .sp-parallax-bg {</code></div>
<div><code>    </code><code>background-position</code><code>: </code><code>-800px</code> <code>0</code><code>;</code></div>
<div><code>}</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The unordered list with the class sp-slider will have a width of 500%. This is because we have 5 slides. It will have a transition for the left value, that we will change depening on the input that is checked:</p>
<div>
<div id="highlighter_80557">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
</td>
<td>
<div>
<div><code>.sp-slider {</code></div>
<div><code>    </code><code>position</code><code>: </code><code>relative</code><code>;</code></div>
<div><code>    </code><code>left</code><code>: </code><code>0</code><code>;</code></div>
<div><code>    </code><code>width</code><code>: </code><code>500%</code><code>;</code></div>
<div><code>    </code><code>height</code><code>: </code><code>100%</code><code>;</code></div>
<div><code>    </code><code>list-style</code><code>: </code><code>none</code><code>;</code></div>
<div><code>    </code><code>margin</code><code>: </code><code>0</code><code>;</code></div>
<div><code>    </code><code>padding</code><code>: </code><code>0</code><code>;</code></div>
<div><code>    </code><code>transition: </code><code>left</code> <code>ease-in </code><code>0.8</code><code>s;</code></div>
<div><code>}</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Each list element is a slide and it will also have a transition for the opacity. We will give both, the slide and the image inside the box-sizing property of “border-box”. This will allow us to set a padding but also use 100% values for heights and widths and not worry about any overflow:</p>
<div>
<div id="highlighter_347195">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
<div>12</div>
<div>13</div>
<div>14</div>
<div>15</div>
<div>16</div>
<div>17</div>
<div>18</div>
<div>19</div>
</td>
<td>
<div>
<div><code>.sp-slider &gt; li {</code></div>
<div><code>    </code><code>color</code><code>: </code><code>#fff</code><code>;</code></div>
<div><code>    </code><code>width</code><code>: </code><code>20%</code><code>;</code></div>
<div><code>    </code><code>box-sizing: border-box;</code></div>
<div><code>    </code><code>height</code><code>: </code><code>100%</code><code>;</code></div>
<div><code>    </code><code>padding</code><code>: </code><code>0</code> <code>60px</code><code>;</code></div>
<div><code>    </code><code>float</code><code>: </code><code>left</code><code>;</code></div>
<div><code>    </code><code>text-align</code><code>: </code><code>center</code><code>;</code></div>
<div><code>    </code><code>opacity: </code><code>0.4</code><code>;</code></div>
<div><code>    </code><code>transition: opacity ease-in </code><code>0.4</code><code>s </code><code>0.8</code><code>s;</code></div>
<div><code>}</code></div>
<div><code>.sp-slider &gt; li img{</code></div>
<div><code>    </code><code>box-sizing: border-box;</code></div>
<div><code>    </code><code>display</code><code>: </code><code>block</code><code>;</code></div>
<div><code>    </code><code>margin</code><code>: </code><code>0</code> <code>auto</code><code>;</code></div>
<div><code>    </code><code>padding</code><code>: </code><code>40px</code> <code>0</code> <code>50px</code> <code>0</code><code>;</code></div>
<div><code>    </code><code>max-height</code><code>: </code><code>100%</code><code>;</code></div>
<div><code>    </code><code>max-width</code><code>: </code><code>100%</code><code>;</code></div>
<div><code>}</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Now we need to set the correct left values for each selected slide:</p>
<div>
<div id="highlighter_888949">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
<div>12</div>
<div>13</div>
<div>14</div>
<div>15</div>
<div>16</div>
<div>17</div>
<div>18</div>
<div>19</div>
</td>
<td>
<div>
<div><code>input.sp-selector</code><code>-1:</code><code>checked ~ .sp-content .sp-slider {</code></div>
<div><code>    </code><code>left</code><code>: </code><code>0</code><code>;</code></div>
<div><code>}</code></div>
<div><code>input.sp-selector</code><code>-2:</code><code>checked ~ .sp-content .sp-slider {</code></div>
<div><code>    </code><code>left</code><code>: </code><code>-100%</code><code>;</code></div>
<div><code>}</code></div>
<div><code>input.sp-selector</code><code>-3:</code><code>checked ~ .sp-content .sp-slider {</code></div>
<div><code>    </code><code>left</code><code>: </code><code>-200%</code><code>;</code></div>
<div><code>}</code></div>
<div><code>input.sp-selector</code><code>-4:</code><code>checked ~ .sp-content .sp-slider {</code></div>
<div><code>    </code><code>left</code><code>: </code><code>-300%</code><code>;</code></div>
<div><code>}</code></div>
<div><code>input.sp-selector</code><code>-5:</code><code>checked ~ .sp-content .sp-slider {</code></div>
<div><code>    </code><code>left</code><code>: </code><code>-400%</code><code>;</code></div>
<div><code>}</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Each current slide will then get opacity 1:</p>
<div>
<div id="highlighter_52536">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
</td>
<td>
<div>
<div><code>input.sp-selector</code><code>-1:</code><code>checked ~ .sp-content .sp-slider &gt; li:first-child,</code></div>
<div><code>input.sp-selector</code><code>-2:</code><code>checked ~ .sp-content .sp-slider &gt; li:nth-child(</code><code>2</code><code>),</code></div>
<div><code>input.sp-selector</code><code>-3:</code><code>checked ~ .sp-content .sp-slider &gt; li:nth-child(</code><code>3</code><code>),</code></div>
<div><code>input.sp-selector</code><code>-4:</code><code>checked ~ .sp-content .sp-slider &gt; li:nth-child(</code><code>4</code><code>),</code></div>
<div><code>input.sp-selector</code><code>-5:</code><code>checked ~ .sp-content .sp-slider &gt; li:nth-child(</code><code>5</code><code>){</code></div>
<div><code>    </code><code>opacity: </code><code>1</code><code>;</code></div>
<div><code>}</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>That’s all, hope you like it!</p>
<p><a href="http://tympanus.net/Tutorials/CSS3FluidParallaxSlideshow/" target="_blank">View demo</a> <a href="http://tympanus.net/Tutorials/CSS3FluidParallaxSlideshow/CSS3FluidParallaxSlideshow.zip" target="_blank">Download source</a></p>
<p>Via: <a href="http://tympanus.net/codrops/2012/04/30/fluid-css3-slideshow-with-parallax-effect/" target="_blank">codrops</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flash-to-html5.net/blog/fluid-css3-slideshow-with-parallax-effect/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Five HTML5 Tools to Manage Video like a Geek</title>
		<link>http://www.flash-to-html5.net/blog/five-html5-tools-to-manage-video-like-a-geek</link>
		<comments>http://www.flash-to-html5.net/blog/five-html5-tools-to-manage-video-like-a-geek#comments</comments>
		<pubDate>Fri, 27 Apr 2012 08:40:01 +0000</pubDate>
		<dc:creator>Sophie.Y</dc:creator>
				<category><![CDATA[HTML5 Tools]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[html5 video]]></category>
		<category><![CDATA[HTML5 Video element]]></category>
		<category><![CDATA[HTML5 video tools]]></category>

		<guid isPermaLink="false">http://www.flash-to-html5.net/blog/?p=1184</guid>
		<description><![CDATA[HTML5 &#60;video&#62; tag is one of those features that drive people exciting. It is often presented as an alternative to flash on browsers. No matter where you sit in the HTML5-Flash debate, the fact is HTML5 video is supported by major browsers; mobile devices are being shipped without support for Flash video and web developers [...]]]></description>
			<content:encoded><![CDATA[<p>HTML5 &lt;video&gt; tag is one of those features that drive people exciting. It is often presented as an alternative to flash on browsers. No matter where you sit in the HTML5-Flash debate, the fact is HTML5 video is supported by major browsers; mobile devices are being shipped without support for Flash video and web developers are adjust strategy accordingly.</p>
<p>So this post is for those who need to host their own video content via HTML5. We collect 5 practical HTML5 video tools to host video as HTML5 as possible.</p>
<p><strong><a href="http://www.sothinkmedia.com/video-converter/?utm_source=html5vc&amp;utm_medium=article&amp;utm_campaign=0409" target="_blank">Sothink Video Free Converter</a></strong></p>
<p>Since modern browsers have already supported HTML5 &lt;video&gt; tag and the trans-platform display of HTML5 video, supporting HTML5 video for your website is an effective way to get more traffic. All you need is a helping hand to complete the task.</p>
<p>Sothink Video Converter is a professional video converter that capable of <a href="http://www.sothinkmedia.com/video-converter/html5/index.htm?utm_source=html5vc&amp;utm_medium=article&amp;utm_campaign=0409" target="_blank">HTML5 video conversion</a>. Except for the support of all the common formats, it converts video to HTML5 formats (OGG, MP4, and WebM); and more importantly, it generates HTML5 video codes directly, which means you can embed codes to website without any hand-code writing.</p>
<p><a href="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/04/19.jpg"><img class="alignnone size-full wp-image-1185" title="HTML5 video " src="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/04/19.jpg" alt="HTML5 video " width="450" height="337" /></a></p>
<p><span id="more-1184"></span>You can convert the video to OGG, MP4, and WebM simultaneously; and there will be an html file in the output folder, that’s where the HTML5 video code lies. The code will be looked like this:</p>
<p><a href="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/04/2.jpg"><img class="alignnone size-full wp-image-1186" title="HTML5 video code " src="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/04/2.jpg" alt="HTML5 video code " width="697" height="111" /></a></p>
<p>You can embed this video code to your site; thus, the video will be displayed on any browser that supports HTML5 &lt;video&gt; tag. Meanwhile, you can customize the code as needed, such as add poster, skin and playlist.</p>
<p><strong><a href="http://westciv.com/tools/video/" target="_blank">HTML5 Video element maker</a></strong></p>
<p>HTML5 Video element maker is an online application for you to generate video code for your website. If you have any online video to share, you can use this application to generate HTML5 video code.</p>
<p><a href="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/04/3.jpg"><img class="alignnone size-full wp-image-1187" title="HTML5 Video element maker" src="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/04/3.jpg" alt="HTML5 Video element maker" width="450" height="197" /></a></p>
<p>It provides different options for you to choose. You can add URL of video source, choose video attributes as needed, set poster of video and provide the fall back video when the browser is not support HTML5 video format. It will generate the code automatically. Here is a little test of HTML5 video code generation:</p>
<p><a href="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/04/4.jpg"><img class="alignnone size-full wp-image-1188" title="HTML5 video code generation" src="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/04/4.jpg" alt="HTML5 video code generation" width="914" height="113" /></a></p>
<p>You can use this code to your site directly or customize as needed.</p>
<p><strong><a href="http://www.ppt-to-html5.com/" target="_blank">Html5 Point</a></strong></p>
<p>HTML5 Point is a PowerPoint plug-in. It converts professional PowerPoint presentation to HTML5 slideshow. HTML5 Point supports all versions of Microsoft PowerPoint. It grasps the trans-platforms features of HTML5. The converted output in HTML5 format allows you to view the slideshows on mobile technologies like iPad, iPhone and Android devices or easily distribute it through most of the web browsers with a web link. The output file retains the videos from the original PowerPoint presentation. You can share the slideshow with worldwide audience.</p>
<p><a href="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/04/5.jpg"><img class="alignnone size-full wp-image-1189" title="HTML5 slideshow" src="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/04/5.jpg" alt="HTML5 slideshow" width="450" height="314" /></a></p>
<p>Here is an HTML5 sample converted from PowerPoint:</p>
<p><a href="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/04/6.jpg"><img class="alignnone size-full wp-image-1190" title="HTML5 sample converted from PowerPoint" src="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/04/6.jpg" alt="HTML5 sample converted from PowerPoint" width="450" height="357" /></a></p>
<p><strong><a href="http://videojs.com/">Video js</a></strong></p>
<p>Video.js, builds on JavaScript and CSS, is an easy to use HTML5 video player. It provides a common controls skin, fixes cross-browser inconsistencies, adds additional features like full screen and subtitles, manages the fallback to Flash or other playback technologies when HTML5 video isn&#8217;t supported, and also provides a consistent JavaScript API for interacting with the video.</p>
<p><a href="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/04/7.jpg"><img class="alignnone size-full wp-image-1191" title="Video.js" src="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/04/7.jpg" alt="Video.js" width="450" height="220" /></a></p>
<p>To get Video.js running on web page, you need to copy following lines into your HTML document &#8220;&lt;head&gt;&#8221;:</p>
<p><a href="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/04/82.jpg"><img class="alignnone size-full wp-image-1201" title="HTML5 code" src="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/04/82.jpg" alt="HTML5 code" width="516" height="35" /></a></p>
<p>And copy the code in the &#8220;&lt;body&gt;&#8221;:</p>
<p><a href="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/04/91.jpg"><img class="alignnone size-full wp-image-1202" title="html5 code 2" src="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/04/91.jpg" alt="html5 code 2" width="532" height="96" /></a></p>
<p>Now, you can see the HTML5 video on your website.<strong></strong></p>
<p><strong><a href="http://camendesign.com/code/video_for_everybody">Video for Everybody</a></strong></p>
<p>Video for Everybody provides a set of HTML code to embed a video into website by using HTML5 &lt;video&gt;. It is one of the first cross-browser HTML5 video solutions on the web.</p>
<p>The most unique aspect is that is does not use JavaScript. It is especially important for users who do not support JavaScript like RSS readers or Apple device users.</p>
<p><a href="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/04/10.jpg"><img class="alignnone size-full wp-image-1194" title="Video for Everybody" src="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/04/10.jpg" alt="Video for Everybody" width="450" height="330" /></a></p>
<p>The video will be played as long as the browser supports HTML5 &lt;video&gt;, it will fall back to Flash automatically if the browser doesn’t support HTML5. You can locally host the Flash file or embed an existing file, like a YouTube clip, for instance. There is a deprecated version that can also try to fallback to QuickTime before playing Flash.</p>
<p>It provides the full source code and compacted code; you can use the codes for your own site:</p>
<p><a href="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/04/81.jpg"><img class="alignnone size-full wp-image-1195" title="source code " src="http://www.flash-to-html5.net/blog/wp-content/uploads/2012/04/81.jpg" alt="source code " width="516" height="35" /></a></p>
<p><strong>Conclusion:</strong></p>
<p>They are easy to use tools for web developers to host their video in a HTML5 way. They generate HTML5 code for you to simply integrate to website. And it’s fortunate to find a number of other awesome tools available on the market; you are welcome to share your favorite tool in the comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flash-to-html5.net/blog/five-html5-tools-to-manage-video-like-a-geek/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flickr&#8217;s new HTML5-based uploader lets you upload bigger files faster</title>
		<link>http://www.flash-to-html5.net/blog/flickrs-new-html5-based-uploader-lets-you-upload-bigger-files-faster</link>
		<comments>http://www.flash-to-html5.net/blog/flickrs-new-html5-based-uploader-lets-you-upload-bigger-files-faster#comments</comments>
		<pubDate>Thu, 26 Apr 2012 09:02:40 +0000</pubDate>
		<dc:creator>Sophie.Y</dc:creator>
				<category><![CDATA[HTML5 News]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[HTML5 uploader]]></category>

		<guid isPermaLink="false">http://www.flash-to-html5.net/blog/?p=1182</guid>
		<description><![CDATA[Flickr is launching a new HTML5-based uploader today, which provides a far cleaner experience when adding your files to the image storage and sharing service. You can now upload images and videos by simply dragging them into the browser, with preview thumbnails allowing you to manage the order of photos, or crop and rotate them [...]]]></description>
			<content:encoded><![CDATA[<div><img src="http://cdn1.sbnation.com/entry_photo_images/3826604/Flickr_large_verge_medium_landscape.png" alt="Flickr HTML5 uploader" width="640" height="427" /></div>
<p>Flickr is launching a new HTML5-based uploader today, which provides a far cleaner experience when adding your files to the image storage and sharing service. You can now upload images and videos by simply dragging them into the browser, with preview thumbnails allowing you to manage the order of photos, or crop and rotate them before they reach your Photostream. There are also a number of other pre-publication options — it&#8217;s easier to add titles, tags, groups, and edit copyright options before you share your images with the world.</p>
<p><span id="more-1182"></span>Besides the new interface, Flickr has changed a couple of significant things in the backend: it promises 20-30 percent faster upload speeds for US users, or between 50-60 percent faster for international users. It&#8217;s also raised the file size cap to 30MB for free accounts or 50MB for premium, meaning that your super high-resolution panoramas can be shared in all of their glory.</p>
<p>The new uploader works with Chrome 6, Safari 5, and Firefox 8 (or newer), and will be rolling out to all users within the next couple of weeks. These new features are hardly cutting edge — everything from Google+ to imgur already offer this kind of system — but we&#8217;re sure it&#8217;s welcome use for dedicated Flickr users.</p>
<p>Via: <a href="http://www.theverge.com/2012/4/25/2974424/flickr-html5-web-uploader-speed-file-size" target="_blank">theverge</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flash-to-html5.net/blog/flickrs-new-html5-based-uploader-lets-you-upload-bigger-files-faster/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Create an Audio Player in HTML5 &amp; CSS3 [Tutorial]</title>
		<link>http://www.flash-to-html5.net/blog/how-to-create-an-audio-player-in-html5-css3-tutorial</link>
		<comments>http://www.flash-to-html5.net/blog/how-to-create-an-audio-player-in-html5-css3-tutorial#comments</comments>
		<pubDate>Thu, 26 Apr 2012 03:25:42 +0000</pubDate>
		<dc:creator>Sophie.Y</dc:creator>
				<category><![CDATA[HTML5 Tutorials]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[html5 audio]]></category>
		<category><![CDATA[html5 tutorial]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.flash-to-html5.net/blog/?p=1177</guid>
		<description><![CDATA[Today’s tutorial we will code an Audio Player from Impressionist UI by Vladimir Kudinov. We will code it with CSS3 for the styling and the “MediaElement.js” for the functionality. MediaElement.js is a HTML5 audio and video player that also works for older browsers using Flash and Silverlight to mimic the HTML5 MediaElement API. Step 1 [...]]]></description>
			<content:encoded><![CDATA[<p><img title="preview" src="http://cdn.designmodo.com/wp-content/uploads/2012/04/preview1.png" alt="" width="600" height="157" /></p>
<p>Today’s tutorial we will code an Audio Player from Impressionist UI by Vladimir Kudinov. We will code it with CSS3 for the styling and the “<a href="http://mediaelementjs.com/" target="_blank">MediaElement.js</a>” for the functionality. MediaElement.js is a HTML5 audio and video player that also works for older browsers using Flash and Silverlight to mimic the <a href="http://www.w3.org/TR/html5/the-video-element.html" target="_blank">HTML5 MediaElement API</a>.</p>
<h4><strong>Step 1 – Downloading MediaElement.js</strong></h4>
<p>First we need to download the <em>“MediaElement.js”</em> script and extract it. Then from the <em>“build”</em> folder we need three files:</p>
<ul>
<li>flashmediaelement.swf</li>
<li>mediaelement-and-player.min.js</li>
<li>silverlightmediaelement.xap</li>
</ul>
<p>Then copy all these three files to the same directory, I will copy for my <em>“js”</em> folder.</p>
<h4><strong>Step 2 – HTML Markup</strong></h4>
<p>Now, we need to link to the jQuery Library, we can host it locally or use the one hosted by Google. Then we need to link to <em>“mediaelement-and-player.min.js”</em> script file and the CSS file. All this three files need to be inside of the <code>&lt;head&gt;</code> tag.</p>
<div id="highlighter_183978">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>&lt;</code><code>head</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>    </code><code>&lt;</code><code>title</code><code>&gt;Audio Player&lt;/</code><code>title</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>    </code><code>&lt;</code><code>script</code> <code>src</code><code>=</code><code>"https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"</code><code>&gt;&lt;/</code><code>script</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>    </code><code>&lt;</code><code>script</code> <code>src</code><code>=</code><code>"js/mediaelement-and-player.min.js"</code><code>&gt;&lt;/</code><code>script</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>    </code><code>&lt;</code><code>link</code> <code>rel</code><code>=</code><code>"stylesheet"</code> <code>href</code><code>=</code><code>"css/style.css"</code> <code>media</code><code>=</code><code>"screen"</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>7</code></td>
<td><code>&lt;/</code><code>head</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p><span id="more-1177"></span>To create the player we will add a <code>&lt;div&gt;</code> width the class <em>“audio-player”</em>. This div will be the container for our player elements. Let’s add a <code>&lt;h1&gt;</code> tag for the song title and <code>&lt;img&gt;</code> for the cover. Then we will add the <code>&lt;audio&gt;</code> tag that will link to our song and we’ll also set the id to <em>“audio-player”</em>.</p>
<div id="highlighter_755900">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>&lt;</code><code>div</code> <code>class</code><code>=</code><code>"audio-player"</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>    </code><code>&lt;</code><code>h1</code><code>&gt;Demo - Preview Song&lt;/</code><code>h1</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>    </code><code>&lt;</code><code>img</code> <code>class</code><code>=</code><code>"cover"</code> <code>src</code><code>=</code><code>"img/cover.png"</code> <code>alt</code><code>=</code><code>""</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>    </code><code>&lt;</code><code>audio</code> <code>id</code><code>=</code><code>"audio-player"</code> <code>src</code><code>=</code><code>"demo.mp3"</code> <code>type</code><code>=</code><code>"audio/mp3"</code> <code>controls</code><code>=</code><code>"controls"</code><code>&gt;&lt;/</code><code>audio</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>&lt;/</code><code>div</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>To finish we need to add this code before the ending of the <code>&lt;/body&gt;</code> tag. Also we need to add the same id as we used in the <code>&lt;audio&gt;</code> tag to load the player. You can set some settings too, for more info read the <a href="http://mediaelementjs.com/" target="_blank">“MediaElement.js”</a> documentation.</p>
<div id="highlighter_921182">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>&lt;</code><code>script</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>    </code><code>$(document).ready(function() {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>        </code><code>$('#audio-player').mediaelementplayer({</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>            </code><code>alwaysShowControls: true,</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>            </code><code>features: ['playpause','volume','progress'],</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>            </code><code>audioVolume: 'horizontal',</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>7</code></td>
<td><code>            </code><code>audioWidth: 400,</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>8</code></td>
<td><code>            </code><code>audioHeight: 120</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>9</code></td>
<td><code>        </code><code>});</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code>    </code><code>});</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>11</code></td>
<td><code>&lt;/</code><code>script</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p><img title="step2" src="http://cdn.designmodo.com/wp-content/uploads/2012/04/step22.png" alt="" width="600" height="286" /></p>
<h4><strong>Step 3 – Container Styles</strong></h4>
<p>First let’s add some reset styles for all the elements that we will use in the container.</p>
<div id="highlighter_447019">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>.audio-player,</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>.audio-player div,</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>.audio-player h</code><code>1</code><code>,</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>.audio-player a,</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>.audio-player img,</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>.audio-player span,</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>7</code></td>
<td><code>.audio-player button {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>8</code></td>
<td><code>    </code><code>margin</code><code>: </code><code>0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>9</code></td>
<td><code>    </code><code>padding</code><code>: </code><code>0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code>    </code><code>border</code><code>: </code><code>none</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>11</code></td>
<td><code>    </code><code>outline</code><code>: </code><code>none</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>12</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>Now let’s style the player container, we will set the width to 400px and height to 120px. We will also add a css3 background gradient and rounded corners.</p>
<div id="highlighter_797719">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>div.audio-player {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>    </code><code>position</code><code>: </code><code>relative</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>    </code><code>width</code><code>: </code><code>400px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>    </code><code>height</code><code>: </code><code>120px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>    </code><code>background</code><code>: </code><code>#4c4e5a</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>7</code></td>
<td><code>    </code><code>background</code><code>: -webkit-linear-gradient(</code><code>top</code><code>, </code><code>#4c4e5a</code> <code>0%</code><code>, </code><code>#2c2d33</code> <code>100%</code><code>);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>8</code></td>
<td><code>    </code><code>background</code><code>: -moz-linear-gradient(</code><code>top</code><code>, </code><code>#4c4e5a</code> <code>0%</code><code>, </code><code>#2c2d33</code> <code>100%</code><code>);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>9</code></td>
<td><code>    </code><code>background</code><code>: -o-linear-gradient(</code><code>top</code><code>, </code><code>#4c4e5a</code> <code>0%</code><code>, </code><code>#2c2d33</code> <code>100%</code><code>);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code>    </code><code>background</code><code>: -ms-linear-gradient(</code><code>top</code><code>, </code><code>#4c4e5a</code> <code>0%</code><code>, </code><code>#2c2d33</code> <code>100%</code><code>);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>11</code></td>
<td><code>    </code><code>background</code><code>: linear-gradient(</code><code>top</code><code>, </code><code>#4c4e5a</code> <code>0%</code><code>, </code><code>#2c2d33</code> <code>100%</code><code>);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>12</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>13</code></td>
<td><code>    </code><code>-webkit-border-radius: </code><code>3px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>14</code></td>
<td><code>    </code><code>-moz-border-radius: </code><code>3px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>15</code></td>
<td><code>    </code><code>border-radius: </code><code>3px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>16</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p><img title="step3" src="http://cdn.designmodo.com/wp-content/uploads/2012/04/step32.png" alt="" width="600" height="232" /></p>
<h4><strong>Step 4 – Title &amp; Cover</strong></h4>
<p>Let’s position the title and cover on the player container and then add some typography styles for the title.</p>
<div id="highlighter_104689">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>.audio-player h</code><code>1</code> <code>{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>    </code><code>position</code><code>: </code><code>absolute</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>    </code><code>top</code><code>: </code><code>37px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>    </code><code>left</code><code>: </code><code>165px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>    </code><code>font-family</code><code>: </code><code>Helvetica</code><code>, </code><code>Arial</code><code>, </code><code>sans-serif</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>7</code></td>
<td><code>    </code><code>font-weight</code><code>: </code><code>bold</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>8</code></td>
<td><code>    </code><code>font-size</code><code>: </code><code>14px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>9</code></td>
<td><code>    </code><code>color</code><code>: </code><code>#ececec</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code>    </code><code>text-shadow</code><code>: </code><code>1px</code> <code>1px</code> <code>1px</code> <code>rgba(</code><code>0</code><code>,</code><code>0</code><code>,</code><code>0</code><code>, .</code><code>5</code><code>);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>11</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>12</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>13</code></td>
<td><code>.audio-player .cover {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>14</code></td>
<td><code>    </code><code>position</code><code>: </code><code>absolute</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>15</code></td>
<td><code>    </code><code>top</code><code>: </code><code>0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>16</code></td>
<td><code>    </code><code>left</code><code>: </code><code>0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>17</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p><img title="step4" src="http://cdn.designmodo.com/wp-content/uploads/2012/04/step42.png" alt="" width="600" height="162" /></p>
<h4><strong>Step 5 – Controls Buttons</strong></h4>
<p>Now we will style the player controls <em>(play/pause, mute/unmute)</em>. To do it we will start by giving some general styles to the buttons and then we’ll set a fixed width and height. We will position the <em>“pause/play”</em> buttons and<em> “mute/unmute”</em> buttons in the same position and they will toggle on click event.</p>
<div id="highlighter_975860">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>.mejs-controls .mejs-button button {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>    </code><code>cursor</code><code>: </code><code>pointer</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>    </code><code>display</code><code>: </code><code>block</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>    </code><code>position</code><code>: </code><code>absolute</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>    </code><code>text-indent</code><code>: </code><code>-9999px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>7</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>8</code></td>
<td><code>.mejs-controls .mejs-play button,</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>9</code></td>
<td><code>.mejs-controls .mejs-pause button {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code>    </code><code>width</code><code>: </code><code>21px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>11</code></td>
<td><code>    </code><code>height</code><code>: </code><code>21px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>12</code></td>
<td><code>    </code><code>top</code><code>: </code><code>35px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>13</code></td>
<td><code>    </code><code>left</code><code>: </code><code>135px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>14</code></td>
<td><code>    </code><code>background</code><code>: </code><code>transparent</code> <code>url</code><code>(../img/play-pause.png) </code><code>0</code> <code>0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>15</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>16</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>17</code></td>
<td><code>.mejs-controls .mejs-pause button { </code><code>background-position</code><code>:</code><code>0</code> <code>-21px</code><code>; }</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>18</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>19</code></td>
<td><code>.mejs-controls .mejs-mute button,</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>20</code></td>
<td><code>.mejs-controls .mejs-unmute button {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>21</code></td>
<td><code>    </code><code>width</code><code>: </code><code>14px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>22</code></td>
<td><code>    </code><code>height</code><code>: </code><code>12px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>23</code></td>
<td><code>    </code><code>top</code><code>: </code><code>70px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>24</code></td>
<td><code>    </code><code>left</code><code>: </code><code>140px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>25</code></td>
<td><code>    </code><code>background</code><code>: </code><code>transparent</code> <code>url</code><code>(../img/mute-unmute.png) </code><code>0</code> <code>0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>26</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>27</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>28</code></td>
<td><code>.mejs-controls .mejs-unmute button { </code><code>background-position</code><code>: </code><code>0</code> <code>-12px</code><code>; }</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p><img title="step5" src="http://cdn.designmodo.com/wp-content/uploads/2012/04/step52.png" alt="" width="600" height="162" /></p>
<h4><strong>Step 6 – Volume Slider</strong></h4>
<p>To style the volume slider we’ll position it, then we will give a 200px width and 8px height. We also need to set a background color, some shadows and rounded corners.</p>
<div id="highlighter_650715">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>.mejs-controls div.mejs-horizontal-volume-slider {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>    </code><code>position</code><code>: </code><code>absolute</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>    </code><code>top</code><code>: </code><code>71px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>    </code><code>left</code><code>: </code><code>165px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>    </code><code>cursor</code><code>: </code><code>pointer</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>7</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>8</code></td>
<td><code>.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>9</code></td>
<td><code>    </code><code>width</code><code>: </code><code>200px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code>    </code><code>height</code><code>: </code><code>8px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>11</code></td>
<td><code>    </code><code>background</code><code>: </code><code>#212227</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>12</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>13</code></td>
<td><code>    </code><code>-webkit-box-shadow: </code><code>inset</code> <code>0px</code> <code>1px</code> <code>0px</code> <code>rgba(</code><code>0</code><code>,</code><code>0</code><code>,</code><code>0</code><code>, .</code><code>3</code><code>), </code><code>0px</code> <code>1px</code> <code>0px</code> <code>rgba(</code><code>255</code><code>,</code><code>255</code><code>,</code><code>255</code><code>, .</code><code>25</code><code>);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>14</code></td>
<td><code>    </code><code>-moz-box-shadow: </code><code>inset</code> <code>0px</code> <code>1px</code> <code>0px</code> <code>rgba(</code><code>0</code><code>,</code><code>0</code><code>,</code><code>0</code><code>, .</code><code>3</code><code>), </code><code>0px</code> <code>1px</code> <code>0px</code> <code>rgba(</code><code>255</code><code>,</code><code>255</code><code>,</code><code>255</code><code>, .</code><code>25</code><code>);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>15</code></td>
<td><code>    </code><code>box-shadow: </code><code>inset</code> <code>0px</code> <code>1px</code> <code>0px</code> <code>rgba(</code><code>0</code><code>,</code><code>0</code><code>,</code><code>0</code><code>, .</code><code>3</code><code>), </code><code>0px</code> <code>1px</code> <code>0px</code> <code>rgba(</code><code>255</code><code>,</code><code>255</code><code>,</code><code>255</code><code>, .</code><code>25</code><code>);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>16</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>17</code></td>
<td><code>    </code><code>-webkit-border-radius: </code><code>6px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>18</code></td>
<td><code>    </code><code>-moz-border-radius: </code><code>6px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>19</code></td>
<td><code>    </code><code>border-radius: </code><code>6px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>20</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>Then we need to style the<em> “current volume”</em>, to do it we’ll add a custom image background, rounded corners, etc.</p>
<div id="highlighter_990282">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>    </code><code>position</code><code>: </code><code>absolute</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>    </code><code>width</code><code>: </code><code>0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>    </code><code>height</code><code>: </code><code>6px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>    </code><code>top</code><code>: </code><code>1px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>    </code><code>left</code><code>: </code><code>1px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>7</code></td>
<td><code>    </code><code>background</code><code>: </code><code>url</code><code>(../img/volume-bar.png) </code><code>repeat-x</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>8</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>9</code></td>
<td><code>    </code><code>-webkit-border-radius: </code><code>6px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code>    </code><code>-moz-border-radius: </code><code>6px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>11</code></td>
<td><code>    </code><code>border-radius: </code><code>6px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>12</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p><img title="step6" src="http://cdn.designmodo.com/wp-content/uploads/2012/04/step6.png" alt="" width="600" height="162" /></p>
<h4><strong>Step 7 – Progress Bar</strong></h4>
<p>The progress bar styles are almost basics. We will give the same width as the player container (400px) and position it to the bottom. We will also make the left and right corner rounded. Then we will set some background colors for each time state <em>(total, loaded and current</em>). As you may notice we need to set the width to 0 for the loaded and current time and as the song plays or is loaded the width will increase.</p>
<div id="highlighter_110516">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>.mejs-controls div.mejs-time-rail { </code><code>width</code><code>: </code><code>400px</code><code>; }</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>.mejs-controls .mejs-time-rail span {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>    </code><code>position</code><code>: </code><code>absolute</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>    </code><code>display</code><code>: </code><code>block</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>    </code><code>width</code><code>: </code><code>400px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>7</code></td>
<td><code>    </code><code>height</code><code>: </code><code>5px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>8</code></td>
<td><code>    </code><code>left</code><code>: </code><code>0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>9</code></td>
<td><code>    </code><code>bottom</code><code>: </code><code>0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code>    </code><code>cursor</code><code>: </code><code>pointer</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>11</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>12</code></td>
<td><code>    </code><code>-webkit-border-radius: </code><code>0px</code> <code>0px</code> <code>2px</code> <code>2px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>13</code></td>
<td><code>    </code><code>-moz-border-radius: </code><code>0px</code> <code>0px</code> <code>2px</code> <code>2px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>14</code></td>
<td><code>    </code><code>border-radius: </code><code>0px</code> <code>0px</code> <code>2px</code> <code>2px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>15</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>16</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>17</code></td>
<td><code>.mejs-controls .mejs-time-rail .mejs-time-total { </code><code>background</code><code>: </code><code>#999999</code><code>; }</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>18</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>19</code></td>
<td><code>.mejs-controls .mejs-time-rail .mejs-time-loaded {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>20</code></td>
<td><code>    </code><code>width</code><code>: </code><code>0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>21</code></td>
<td><code>    </code><code>background</code><code>: </code><code>#cccccc</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>22</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>23</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>24</code></td>
<td><code>.mejs-controls .mejs-time-rail .mejs-time-current {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>25</code></td>
<td><code>    </code><code>width</code><code>: </code><code>0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>26</code></td>
<td><code>    </code><code>background</code><code>: </code><code>#64b44c</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>27</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p><img title="step7" src="http://cdn.designmodo.com/wp-content/uploads/2012/04/step7.png" alt="" width="600" height="162" /></p>
<h4><strong>Step 8 – Progres &amp; Volume Handle</strong></h4>
<p>Now we will add a handle to the progress bar and volume slider. Basically we will only add a background image, set the width / height and position it.</p>
<div id="highlighter_873941">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>.mejs-controls .mejs-time-rail .mejs-time-handle,</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-handle {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>    </code><code>position</code><code>: </code><code>absolute</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>    </code><code>display</code><code>: </code><code>block</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>    </code><code>width</code><code>: </code><code>12px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>    </code><code>height</code><code>: </code><code>14px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>7</code></td>
<td><code>    </code><code>top</code><code>: </code><code>-4px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>8</code></td>
<td><code>    </code><code>background</code><code>: </code><code>url</code><code>(../img/handle.png) </code><code>no-repeat</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>9</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>11</code></td>
<td><code>.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-handle { </code><code>top</code><code>: </code><code>-2px</code><code>; }</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p><img title="step8" src="http://cdn.designmodo.com/wp-content/uploads/2012/04/step8.png" alt="" width="600" height="162" /></p>
<h4><strong>Step 9 – Time Tooltip</strong></h4>
<p>To finish the audio player we will add a time tooltip that will appear when we hover over the progress bar. The styles are almost the same as in the other steps, we will position it, add a fixed width/height values and a background image. We will also add some typography styles.</p>
<div id="highlighter_248642">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>.mejs-controls .mejs-time-rail .mejs-time-float {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>    </code><code>position</code><code>: </code><code>absolute</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>    </code><code>display</code><code>: </code><code>none</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>    </code><code>width</code><code>: </code><code>33px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>    </code><code>height</code><code>: </code><code>23px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>    </code><code>top</code><code>: </code><code>-26px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>7</code></td>
<td><code>    </code><code>margin-left</code><code>: </code><code>-17px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>8</code></td>
<td><code>    </code><code>background</code><code>: </code><code>url</code><code>(../img/time-box.png);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>9</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>11</code></td>
<td><code>.mejs-controls .mejs-time-rail .mejs-time-float-current {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>12</code></td>
<td><code>    </code><code>width</code><code>: </code><code>33px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>13</code></td>
<td><code>    </code><code>display</code><code>: </code><code>block</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>14</code></td>
<td><code>    </code><code>left</code><code>: </code><code>0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>15</code></td>
<td><code>    </code><code>top</code><code>: </code><code>4px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>16</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>17</code></td>
<td><code>    </code><code>font-family</code><code>: </code><code>Helvetica</code><code>, </code><code>Arial</code><code>, </code><code>sans-serif</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>18</code></td>
<td><code>    </code><code>font-size</code><code>: </code><code>10px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>19</code></td>
<td><code>    </code><code>font-weight</code><code>: </code><code>bold</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>20</code></td>
<td><code>    </code><code>color</code><code>: </code><code>#666666</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>21</code></td>
<td><code>    </code><code>text-align</code><code>: </code><code>center</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>22</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p><img title="step9" src="http://cdn.designmodo.com/wp-content/uploads/2012/04/step9.png" alt="" width="600" height="162" /></p>
<h4><strong>Conclusion</strong></h4>
<p>We’ve successfully coded this Audio Player. If you have any question let me know in the comments. Also don’t forget to leave some feedback and share it with your friends. Follow us if you want to be the first to know about the latest tutorials and articles.</p>
<div><a href="http://designmodo.com/demo/audioplayer/" target="_blank"><img title="Preview" src="http://cdn.designmodo.com/wp-content/uploads/2011/11/previewbtn.png" alt="Preview" /></a> <a href="http://designmodo.com/tweet/audioplayer.php" target="_blank"><img title="Download" src="http://cdn.designmodo.com/wp-content/uploads/2011/11/downloadbtn.png" alt="Download" /></a></div>
<div>Via: <a href="http://designmodo.com/audio-player/" target="_blank">Designmodo</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.flash-to-html5.net/blog/how-to-create-an-audio-player-in-html5-css3-tutorial/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

