<?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>Web Designer - Defining the internet through beautiful design &#187; HTML</title>
	<atom:link href="http://www.webdesignermag.co.uk/category/tutorials/html-tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webdesignermag.co.uk</link>
	<description>Web Design for real people</description>
	<lastBuildDate>Thu, 09 Feb 2012 01:00:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Create interactive animations from a Twitter feed</title>
		<link>http://www.webdesignermag.co.uk/tutorials/create-interactive-animations-from-a-twitter-feed/</link>
		<comments>http://www.webdesignermag.co.uk/tutorials/create-interactive-animations-from-a-twitter-feed/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 17:10:08 +0000</pubDate>
		<dc:creator>Steve Jenkins</dc:creator>
				<category><![CDATA[Dreamweaver]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Illustrator]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://www.webdesignermag.co.uk/?p=8307</guid>
		<description><![CDATA[Twitter streams don’t have to be boring lists – there’s a world of ways to visualise what people are tweeting, so let’s get creative…]]></description>
			<content:encoded><![CDATA[<!--Mockup--><!--final--><p><img class="alignnone size-full wp-image-8319" title="Create interactive animations from a Twitter feed" src="http://www.webdesignermag.co.uk/wp-content/uploads/2012/02/Mockup.jpg" alt="Create interactive animations from a Twitter feed" width="610" height="473" />Twitter is a great tool for getting the pulse of the world, and is becoming more and more pervasive as mainstream media starts to include tweets in audience participation. The majority of users access and use Twitter through the http://twitter.com website, but thanks to the public API, we can now take the data from Twitter and do something a little different with it.<br />
This tutorial is inspired by the excellent Tori’s Eye site, found at http://toriseye.quodis.com/#webdesigner. This is a visualisation of a Twitter stream that places some stylised birds into a landscape, flying across the screen to deliver tweets. It uses the Twitter JSON API to grab tweets from the Twitter timeline and a smattering of JavaScript to present them in an engaging manner.<br />
In our version we’ll simplify how this is done, but we’ll be using the same basic principles to create an animation along similar lines to Tori’s Eye. Once you’ve completed this workshop you should have the understanding and tools at your disposal to create your own visualisation in new and exciting ways. Perhaps you’ll feel compelled to let us know what you come up with by Tweeting us (naturally) via @WebDesignerMag.</p>
<p><strong>tools | tech | trends:</strong> Adobe Illustrator, Dreamweaver, jQuery, HTML, CSS &amp; Twitter<br />
<strong>expert:</strong> Sam Hampton-Smith<br />
<strong>tutorial files: <a title="Twitter visualisations" href="http://www.webdesignermag.co.uk/tutorial-files/issue-190-tutorial-files/">download here</a></strong></p>
<p><strong>01. Design a mockup</strong><br />
We start off by taking direct inspiration from the Tori’s Eye visualisation and designing a replica inside Illustrator. Our file can be found on the disc, but to get the textures we’ve used you’ll need to visit www.sxc.hu and search for paper and rusty metal stock. Note that we’ve separated out the background and the birds onto different layers for easier export later.</p>
<p><strong>02. Output to PNG</strong><br />
Once we’re happy with the overall visual look, we need to export the graphics in a format suitable for use in the final HTML design. The background can be a straight JPEG as it doesn’t need any transparency. The birds, however, must be in PNG format. You need to isolate one bird and export it – this will become the master bird graphic.</p>
<p><strong>03. Other elements</strong><br />
In Tori’s Eye the trees are separated into a layer above the birds, so that the birds can fly behind them. We’ve chosen not to mimic this for ease of understanding, but we did separate out the trees onto their own transparent PNG layer just in case we want to replicate the layers later down the line. You can find all our graphics on this month’s CD.</p>
<p><strong>04. Create the HTML structure</strong><br />
We’ve got our graphics sorted, so now let’s create the basic HTML structure. Add the step code to a new page in your web editor. We’ll create some basic CSS rules, and to keep it simple we’ll retain all our style and script code in this one file. If you want a quick step up, we’ve included the basic HTML page on the disc – just open up ‘start.html’.</p>
<p><em> &lt;html&gt;</em><br />
<em>&lt;head&gt;</em><br />
<em>&lt;title&gt;Twitter Animation&lt;/title&gt;</em><br />
<em>&lt;style&gt;</em><br />
<em>&lt;/style&gt;</em><br />
<em>&lt;/head&gt;</em><br />
<em>&lt;body&gt;</em><br />
<em>&lt;div id=&#8221;container&#8221;&gt;</em><br />
<em>&lt;div id=&#8221;trees&#8221;&gt;</em><br />
<em>&lt;div id=&#8221;tweetscontainer&#8221;&gt;</em><br />
<em>&lt;/div&gt;</em><br />
<em>&lt;/div&gt;</em><br />
<em>&lt;/div&gt;</em><br />
<em>&lt;/body&gt;</em><br />
<em>&lt;/html&gt;</em></p>
<p><strong> 05.  Add some CSS</strong><br />
Apply this CSS; the full code is on the disc.</p>
<p><em> body {</em><br />
<em> font-family:    arial, helv, sans- serif;</em><br />
<em>font-size:    66%;</em><br />
<em>background:    #f9f9f9;</em><br />
<em>padding:    20px;</em><br />
<em>}</em><br />
<em>#container {</em><br />
<em>position:    relative;</em><br />
<em>width:            1024px;</em><br />
<em>height:        700px;</em><br />
<em>margin:        auto;</em><br />
<em>background:  transparent url(styles/background.jpg) no-repeat top left;</em></p>
<p><strong>06. Grab jQuery</strong><br />
Visit http://jquery.com and download the latest version of the library. jQuery makes it easy for us to interact with different elements on the page and create animations. To this end, we’ll install it at the top of our page, and set up a function beneath ready to hold all of the code to make our visualisation work.</p>
<p><em>&lt;script type=&#8221;text/javascript&#8221;  src=&#8221;scripts/jquery.js&#8221;&gt;&lt;/script&gt;</em><br />
<em>&lt;script type=&#8221;text/javascript&#8221;&gt;</em><br />
<em>$(document).ready(function(){</em><br />
<em>// Your jQuery code will slot in     here</em><br />
<em> });</em><br />
<em>&lt;/script&gt;</em></p>
<p><strong>07. Connect to Twitter</strong><br />
Twitter has an API that’s publicly accessible. If you’re creating a full application, you may want to sign up for a specific developer API key, but for our purposes we’re just going to use the public version. We can call this using jQuery’s JSON method. Note that we’re passing in a search term that will return matching tweets – change this to suit you. Full code is on the CD.</p>
<p><em>var url = &#8220;http://search.twitter.com/ search.json?q=iphone&amp;rpp=15&amp;callback=?&#8221;;</em><br />
<em>var tweets = $(&#8216;&lt;ul id=&#8221;tweets&#8221;&gt;&#8217;).         appendTo(&#8220;#tweetscontainer&#8221;);</em><br />
<em>$.getJSON(url,  function(data){</em><br />
<em>// Do something with the data returned</em></p>
<p><strong>08. Parsing JSON</strong><br />
The data is returned from Twitter as a JSON object. JSON is a straightforward way to wrap data as a set of keys and values in an array. All we need to do is to iterate through the returned array and generate HTML. code from the values for each set of data. Add the code below to do this; full code is on the cover disc.</p>
<p>$.getJSON(url,  function(data){<br />
$.each(data.results, function(i,item){<br />
tweets.append(&#8216;&lt;li&gt;&lt;div&gt;&lt;img src=&#8221;&#8216;  + item.profile_image_url +&#8217;&#8221; alt=&#8221;&#8216; +<br />
item.from_user + &#8216;&#8221; width=&#8221;73&#8243;           height=&#8221;73&#8243; /&gt;&lt;p&gt;&lt;a href=&#8221;http://twitter.       com/&#8217;+item.from_user<br />
+&#8217;/statuses/&#8217;+item.id+&#8217;&#8221; title=&#8221;Click    here to view this on twitter&#8221;&gt;&#8217;+item.from_      user+&#8217;&lt;/a&gt; at<br />
&#8216;+item.created_at+&#8217;: &#8216;+item.text.           replace(/(\w+:\/\/[A-Za-z0-9-_]+\.              [A-Za-z0-9-_:%&amp;\?\/.=]+)/gi, &#8216;&lt;a<br />
href=&#8221;$1&#8243;&gt;$1&lt;/a&gt;&#8217;).replace(/             [\@]+([A-Za-z0-9-_]+)/gi, &#8216;&lt;a href=&#8221;http://     twitter.com/$1&#8243;&gt;@$1&lt;/</p>
<p><strong>09. Output results</strong><br />
Our code generates a list item (&lt;li&gt;) for each tweet, wrapping the actual contents of the tweet inside a &lt;div&gt; tag. We’ll use this later on to show and hide the tweet, but for now you should have 15 list items once the code has finished doing its work.</p>
<p><strong>10. Test it out</strong><br />
It’s worth taking a moment to make sure your script is loading the tweets and outputting them in HTML. Although this will look pretty ugly, it’s a quick way to verify everything is working as it should. Once you’ve loaded it in your browser and observed all your tweets loading, you can move on to the next step.</p>
<p><strong>11. More style</strong><br />
Let’s deal with the ugliness first of all. Each list item will become a bird that we animate across the screen. We’ve already set our container to have overflow:hidden, so we’ll be able to position our birds so that they start off outside the visible area, then animate them into position. Add the CSS below to set the start position for each &lt;li&gt;. Full code is on the disc.</p>
<p><em>#tweets {</em><br />
<em>position:    absolute;</em><br />
<em>top: 0;</em><br />
<em>left:  0;</em><br />
<em>width:  2000px;</em><br />
<em>margin-left:  -300px;</em></p>

					<div class="adInPost">
						<script type="text/javascript">
							GA_googleFillSlot("WD_MidPage_MPU1");
						</script>
					</div><p><strong>12. Create speed variables for the birdies</strong><br />
We’re going to generate a speed variable for each list item and run a function periodically to set the position of the bird. Each time the function runs, we’ll use the speed variable to reposition the list item by a set amount, and as we repeatedly run our function, so the list items will appear to be animated across the page.</p>
<p><strong>13. Generate random values</strong><br />
We’re going to use random numbers to set the speed of each bird so that the birds don’t all fly across the screen at the same rate. JavaScript lets us generate random numbers using the Math.random() function. Add the code below to call up a random number between 0 and 9 to represent the speed of each bird.</p>
<p><em>var speed=Math.floor(Math.random()*10)+1;     </em></p>
<p><strong>14. Set the start position</strong><br />
We don’t, however, want them all to be at the same vertical level, otherwise it’ll become very monotonous – so to avoid this we need to set a random starting position. We also need to store the speed value for each bird, and we can do this using the .data() method in jQuery. Add the code below to set the vertical position and store the speed. We also set the horizontal position to offset a little for each &lt;li&gt;.</p>
<p><em>var offsettop=Math.floor(Math. random()*400)+10;</em><br />
<em>$(&#8220;#tweets li:last&#8221;).data(&#8220;speed&#8221;,speed).css({top:offsettop,right:2000+(i*30)});</em></p>
<p><strong>15. Get things moving</strong><br />
Although jQuery has the animate() method, we’ll use a straight setInterval function and set the position of each bird using CSS alone. This will enable us to control the frame rate more easily and give more predictable results. To start we’ll need a function that fires periodically; add the code below to create this.</p>
<p><em>var t = setInterval(function(){</em><br />
<em>// we’ll set the position of each bird every 30 milliseconds</em><br />
<em>},30);</em></p>
<p><strong>16. Get things moving 2</strong><br />
Each time the function fires, we want to update the position of every bird to its new location on screen. Add this step’s code to grab the speed for each bird from the data() object and update the position of the bird accordingly. Again, full code is on the CD.</p>
<p><em>var t = setInterval(function(){</em><br />
<em>$(&#8220;#tweets li&#8221;).each(function(){</em><br />
<em>// grab the speed variable</em><br />
<em>speed = $(this).data(&#8220;speed&#8221;);</em><br />
<em>// and the current position</em><br />
<em>xpos = $(this).css(&#8220;left&#8221;);</em><br />
<em>// if the bird is off the left hand side of the screen, reset it to the right</em></p>
<p><strong>17. Time to test</strong><br />
It’s time to open your page and test it out. All being well, after a short delay while the Twitter feed loads, you should see birds flying across the screen with tweets sitting on top of them. We’re nearly there now – just a bit of tidying up to do!</p>
<p><strong>18. Pause for thought</strong><br />
The first thing that we notice is that it’s a little tricky to read the tweets as they zoom past. Let’s make the bird stop in position when the cursor is hovered over it. We’ll want the bird to carry on moving when we mouse off the bird, so add a clause to the animation function, and add a class to the bird as we mouse over to exclude it from the animation.</p>
<p><em>$(&#8220;#tweets li&#8221;).not(&#8220;.hover&#8221;).each(functio…</em><br />
<em>$(&#8220;#tweets li&#8221;).hover(function(){</em><br />
<em>$(this).addClass(&#8220;hover&#8221;);</em><br />
<em>$(this).css({zIndex:1000});</em><br />
<em>},function(){</em><br />
<em>$(this).removeClass(&#8220;hover&#8221;);</em><br />
<em>});</em></p>
<p><strong>19. More style</strong><br />
Now we’ve got our birds flying across the screen, it would be nice to have the actual tweets appearing only when each bird is moused over. We’ll apply a little more panache to the way the tweets are displayed at the same time. Add the CSS below to hide the tweets until mouseover, and get them looking a bit more presentable. You will find the full code for this step on the cover disc.</p>
<p><em>#tweets li div {</em><br />
<em>display:  none;</em><br />
<em>padding:             10px;</em><br />
<em>background:    rgba(0,0,0,0.7);</em><br />
<em>color:                 #fff;</em><br />
<em>min-height:    93px;</em><br />
<em>margin-top:    100px;</em></p>
<p><strong>20. Another quick test</strong><br />
If you test again now you should see the birds without all the tweets sitting on top of them, and as you move your mouse over the top of a bird it should stop in its tracks, and the tweet should then display underneath it. With these changes, we think the page is looking much slicker, plus it makes the Twitter stream much more fun to interact with!</p>
<p><strong>21. Tweak to suit</strong><br />
When you test out your page you’ll almost certainly find that you want to modify some of the values – especially the random number generation and setInterval delay, as this will affect how quickly the birds fly across the screen. Try experimenting with a few different values to see the effect they have, and tweak values to taste.</p>
<p><strong>22. Take it to the next level</strong><br />
Your overall visualisation should now be working nicely. Test in all your target browsers and check that everything works as it should. You might now want to consider extending the functionality so that the user can input their own search term, or so that some birds are bigger/faster than others – get creative and show us what you produce. You might end up in the Lightbox!</p>
<p><img class="alignnone size-full wp-image-8318" title="Create interactive animations from a Twitter feed" src="http://www.webdesignermag.co.uk/wp-content/uploads/2012/02/final.jpg" alt="Create interactive animations from a Twitter feed" width="610" height="397" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesignermag.co.uk/tutorials/create-interactive-animations-from-a-twitter-feed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Take control of your backgrounds with CSS3</title>
		<link>http://www.webdesignermag.co.uk/blog/backgrounds-with-css3/</link>
		<comments>http://www.webdesignermag.co.uk/blog/backgrounds-with-css3/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 17:02:16 +0000</pubDate>
		<dc:creator>Mark Billen</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Dreamweaver]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[backgrounds]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[walkthrough]]></category>

		<guid isPermaLink="false">http://www.webdesignermag.co.uk/?p=8308</guid>
		<description><![CDATA[
CSS3 offers designers more flexibility with background images. Here we take a look at some of the key properties]]></description>
			<content:encoded><![CDATA[<!--Final--><!--size01--><!--size02--><p><a href="http://www.webdesignermag.co.uk/wp-content/uploads/2012/02/Final.jpg"><img class="alignnone size-full wp-image-8309" title="Take control of your backgrounds with CSS3" src="http://www.webdesignermag.co.uk/wp-content/uploads/2012/02/Final.jpg" alt="Take control of your backgrounds with CSS3" width="500" height="294" /></a></p>
<p><strong>Take control of your backgrounds with CSS3</strong></p>
<p>CSS3 offers designers more flexibility with background images. Here we take a look at some of the key properties</p>
<p>Background images have played a key role in web design for as long as CSS has been popular, and support has been available. They are the aesthetic that creates the persona of a page. The big issue with background images is their lack of flexibility. They can repeat – perfect for textures, and they can be fixed to stay in place on screen but they cannot be resized. This means that developers who want a beautiful full-screen canvas, or simply more flexibility, have to improvise with absolute positioned tags, image sizes or code.<br />
The background-size property, part of the CSS3 Backgrounds and Borders module, grants designers far more scope to be creative and with cleaner code. And, with support for multiple backgrounds by its side, this tasty duo is set to finally give web designers a chance to make the most of their backdrops.</p>
<p>This article was originally featured in Web Designer issue 190, authored by Steve Jenkins. There are no project files required for this tutorial.</p>
<p><strong>01 Default value</strong></p>
<p><a href="http://www.webdesignermag.co.uk/wp-content/uploads/2012/02/size01.jpg"><img class="alignnone size-full wp-image-8310" title="Take control of your backgrounds with CSS3" src="http://www.webdesignermag.co.uk/wp-content/uploads/2012/02/size01.jpg" alt="Take control of your backgrounds with CSS3" width="500" height="322" /></a></p>
<p>The default value for the background-size property is auto. This displays the background image at its original size, eg 1,000 x 700px. The background-size property works in tandem with the background property so if the image is set to no-repeat only one instance will appear; on the other hand, if set to repeat it will do just that.</p>
<p><strong>02 Specific size</strong></p>

					<div class="adInPost">
						<script type="text/javascript">
							GA_googleFillSlot("WD_MidPage_MPU1");
						</script>
					</div><p><a href="http://www.webdesignermag.co.uk/wp-content/uploads/2012/02/size02.jpg"><img class="alignnone size-full wp-image-8313" title="Take control of your backgrounds with CSS3" src="http://www.webdesignermag.co.uk/wp-content/uploads/2012/02/size02.jpg" alt="Take control of your backgrounds with CSS3" width="500" height="305" /></a></p>
<p>An alternative to the auto option is a specific set of dimensions, eg 500 x 350px. The first value refers to the width of the image while the second refers to the height. Again, the repeat property helps to determine how the background appears.</p>
<p><strong>03 Auto values</strong><br />
Background-size allows for the combination of specific sizes and the auto option. If the first value (width) is set to 500px and the second value to auto, the height will be automatically reduced proportionately to the width. This keeps the image’s original aspect ratio. If only the first value is added it is assumed that the second is auto.</p>
<p>001 <em>#topsection{</em><br />
002 <em>background: url(images/image.jpg) no-repeat</em><br />
003 <em>background-size: 500px auto;</em><br />
004 <em>}</em></p>
<p><strong>04 Auto width</strong><br />
Adding the auto value first changes the perspective of an image. The first value (width) will now be determined by the second value (the height). The height will become the static value and the height will be automatically reduced/increased proportionately to the width, again keeping the aspect ratio.</p>
<p>001 <em>#topsection{</em><br />
002 <em>background: url(images/image.jpg) no-repeat</em><br />
003 <em>background-size: auto 500px; </em><br />
004 <em>}</em></p>
<p>05 Percentages<br />
To add more flexibility to the size of a background image the values can be added as percentages. Adding a percentage as the first value, eg 50%, determines that the width will be 50% of the screen or 50% of the containing div tag. The second value (height) will be set to auto and its size will be kept in proportion.</p>
<p>001 <em>#topsection{</em><br />
002 <em>background: url(images/image.jpg) no-repeat</em><br />
003 <em>background-size: auto 500px;}</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesignermag.co.uk/blog/backgrounds-with-css3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build responsive sites using the 320 and up framework</title>
		<link>http://www.webdesignermag.co.uk/tutorials/build-responsive-sites-using-the-320-and-up-framework/</link>
		<comments>http://www.webdesignermag.co.uk/tutorials/build-responsive-sites-using-the-320-and-up-framework/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 08:30:27 +0000</pubDate>
		<dc:creator>Steve Jenkins</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[320 and up]]></category>
		<category><![CDATA[Responsive design]]></category>
		<category><![CDATA[Thord Daniel Hedengren]]></category>

		<guid isPermaLink="false">http://www.webdesignermag.co.uk/?p=8101</guid>
		<description><![CDATA[Adopt the 320 and up framework to build flexible layouts that respond and react to desktop, mobile and tablet screens]]></description>
			<content:encoded><![CDATA[<!--wpwwp5--><!--wpwwp4--><!--step1-1--><!--step31--><!--step81--><!--step102--><!--step121--><!--step132--><!--step141--><!--step16-2--><p><img class="alignnone size-full wp-image-8120" title="Build responsive sites using the 320 and up framework" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/wpwwp5.jpg" alt="Build responsive sites using the 320 and up framework" width="610" height="399" /></p>
<p><img class="alignnone size-full wp-image-8119" title="Build responsive sites using the 320 and up framework" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/wpwwp4.jpg" alt="Build responsive sites using the 320 and up framework" width="610" height="443" /></p>
<p>The hottest trend in web design right now is responsive design. Thanks to the powers of CSS3 and HTML5, we can finally embrace the concept of One Web, which lets us build one website that adapts to the device it is being viewed upon. This is necessary since the plethora of devices on the market is ever-growing, and with that we get more and more screen resolutions to take into account. For most projects it just isn’t possible to build a mobile version, an app and then a tablet version, and a desktop one at that – there is no sense in the economy there.<br />
Luckily responsive web design can help, thanks to the possibility to query the screen resolution using   @media and min-width, and then act upon that. This means that we can have one set of styles for resolutions up to 768 pixels, and one for those above, for example.<br />
320 and Up is an interesting framework developed by Andy Clarke that helps you build sites, starting with the most common denominator, which is the smallest screen. Then we add to it with additional styles. This tutorial will help you understand how to start working with it, so that you can apply it to your own projects.</p>
<h3>tools | tech | trends: HTML, CSS, JavaScript, 320 and up (framework)<br />
expert: Thord Daniel Hedengren<br />
tutorial files: <a title="320 and up" href="http://www.webdesignermag.co.uk/tutorial-files/issue-186-tutorial-files/" target="_self">download</a></h3>
<p><strong>01. Download 320 and Up</strong><br />
<img class="alignnone size-full wp-image-8103" title="Build responsive sites using the 320 and up framework" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/step1-1.jpg" alt="Build responsive sites using the 320 and up framework" width="610" height="335" /><br />
The first thing we need to do is download the 320 and Up framework. At the time of press the most current version available is 0.9, and you can access it directly by visiting http://stuffandnonsense.co.uk/projects/320andup/latest.zip</p>
<p><strong>02. Examine the package</strong><br />
The 320 and Up ZIP archive contains two folders, one titled Multiple linked style sheets and one called Single style sheet. These contain different versions of the 320 and Up framework, either as one style sheet or split up into several. The fewer style sheets you use the better, since it makes it easier on the server due to fewer requests, but it also means the files get bigger and perhaps harder to work with. Copy the contents of the Single style sheet folder to a place of your choosing. That’s what we’ll work with.</p>
<p><strong>03. A closer look at the contents</strong><br />
<img class="alignnone size-full wp-image-8105" title="step3" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/step31.jpg" alt="Build responsive sites using the 320 and up framework" width="610" height="364" /><br />
320 and Up is an organised framework, as you’ll see when looking at the contents of the Single style sheet folder. You’ve got your style sheets in a folder called ‘CSS’, images in the ‘img’ folder and JavaScript files in the ‘js’ folder. You’ll also notice ‘index.html’ and ‘404.html’, which will help us create our mobile site.</p>
<p><strong>04. Let’s take a look at ‘index.html’</strong><br />
The ‘index.html’ file is essentially empty of content, the only thing we get is a h1 heading at the top and the basic HTML markup needed. What’s interesting is the actual markup obviously, and the style sheets that make it all happen. Get familiar with ‘index.html’ and, if things like viewport are Greek to you, at least take a look at the page markup, starting with header on line 63, down to the closing off footer on line 78.</p>
<p><strong>05. ‘index.html’ in the browser</strong><br />
Looking at ‘index.html’ in the browser as it is now doesn’t tell us much, but the developer has been kind enough to leave us a grid that we can ”activate”. Open ‘style.css’ (in the CSS folder) and scroll down to line 64. There, uncomment the url(../img/tmp/grid.png) repeat-y 50% 0 part for the html tag. Reloading ‘index.html’ in the browser will show a grid image being repeated, which will be helpful as we go along.</p>
<p><strong>06. Let’s add some content</strong><br />
Let’s add some content to ‘index.html’. First of all, change the contents of h1 (on line 64) to something else, and then put a few simple paragraphs within the &lt;div role=”main”&gt; tag on line 69. Dragging the Browser window now<br />
will just let the content flow to almost full width.</p>
<p><strong>07. Populate the other columns</strong><br />
To really get an idea of how things relate to each other, let’s add some paragraphs to the &lt;div role=”complementary”&gt; as well. Then, while we’re at it, put something within the &lt;footer role=”contentinfo” class=”clearfix”&gt;, preferably something that tells you it is from the footer.</p>
<p><strong>08. It doesn’t work!</strong><br />
<img class="alignnone size-full wp-image-8109" title="step8" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/step81.jpg" alt="Build responsive sites using the 320 and up framework" width="610" height="306" /><br />
Taking a look at ‘index.html’ as it is now, you’ll notice that nothing aligns – the content is just presented in one long column. That’s because 320 and Up doesn’t come littered with stylings for your desktop experience.</p>
<p><strong>09. Find our way in the style sheet</strong><br />
If you want to learn a thing or two on how to organise a style sheet, look no further than to ‘style.css’. There’s even an index at the start of the file, which is nice. Consult it to find your way in the file.</p>
<p><strong>10. Let’s add some style</strong><br />
<img class="alignnone size-full wp-image-8110" title="step10" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/step102.jpg" alt="Build responsive sites using the 320 and up framework" width="610" height="534" /><br />
In ‘style.css’, you’ll find that the media queries start at line 423. There you’ll find a placeholder for adding styles for screens larger than 480 pixels (min-width: 480px is the rule). Let’s make some changes to the h1 tag here, shall we? The added code changes the h1 color to blue, gives it padding and a line below it whenever the screen is more than 480 pixels. Obviously we could add more, but this will do for this particular size.</p>
<p><em>001 /*480px ______________ */<br />
002 @media only screen and (min-width: 480px) {<br />
003 /* 2.HEADINGS */<br />
004 h1 {<br />
005 color: blue;<br />
006 padding-bottom: .1em;<br />
006 border-bottom: 1px solid #bbb;<br />
007 }</em></p>

					<div class="adInPost">
						<script type="text/javascript">
							GA_googleFillSlot("WD_MidPage_MPU1");
						</script>
					</div><p><strong>11. Column markup</strong><br />
If you drag your Browser window right now, you’ll find that larger screens also inherit the style we added in step 10. That’s because we’re designing from the small screen out. Next resolution is 768 pixels upwards (line 453 in ‘style.css’), so let’s make this the point where we start using columns. First, open ‘index.html’ and find &lt;div role=”main”&gt;, to which you’ll add class=”content-main”. Then do the same with &lt;div role=”complementary”&gt; but add class=”content-complementary”. This will make it easier for us to style the div containers using CSS.</p>
<p><strong>12. Add the main column style</strong><br />
<img class="alignnone size-full wp-image-8111" title="step12" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/step121.jpg" alt="Build responsive sites using the 320 and up framework" width="610" height="420" /><br />
Next, go back to ‘style.css’ and the @media rule for min-width: 768px (and up). Here, under ”11. MAIN”, we’ll add the necessary style to float the div.content-main container left.</p>
<p><em>001 /* 11.MAIN */<br />
002 div.maincontent {<br />
003 float: left;<br />
004 width: 65%;<br />
005 }</em></p>
<p><strong>13. Add the secondary column style</strong><br />
<img class="alignnone size-full wp-image-8112" title="step13" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/step132.jpg" alt="Build responsive sites using the 320 and up framework" width="610" height="420" /><br />
Now, let’s give the secondary column, the one with the role ”complementary” in ‘index.html’, float: right and a better suited width. In fact, let’s also make sure that the font size differs and the color is dark grey rather than black as the main content. Refer to ”3. TYPOGRAPHY” and ”12. COMPLEMENTARY” in the code below, still within the @media rule with<br />
min-width: 768px, of course.</p>
<p><em>001 /*768px ___________ */<br />
002 @media only screen and (min-width:     768px) {<br />
003 /* 3.TYPOGRAPHY */<br />
004 div.complementarycontent p {<br />
005 font-size: 0.9em;<br />
006 color: #666;<br />
007 }<br />
008 /* 11.MAIN */<br />
009 div.maincontent {<br />
010 float: left;<br />
011 width: 65%;<br />
012 }<br />
013 /* 12.COMPLIMENTARY */<br />
014 div.complementarycontent {<br />
015 float: right;<br />
016 width: 30%;<br />
017 }<br />
018 }/*/mediaquery*/</em></p>
<p><strong>14. Draw the line</strong><br />
<img class="alignnone size-full wp-image-8113" title="step14" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/step141.jpg" alt="Build responsive sites using the 320 and up framework" width="610" height="367" /><br />
There are several sizes beyond min-width: 768px, but chances are you want to draw the line somewhere as to how wide your site can be. We’ll do that in the @media query with min-width: 992px, setting the maximum allowed width to 960 pixels. While we’re at it, let’s also make that blue h1 heading a bit larger, shall we?</p>
<p>001 /*992px ____________ */<br />
002 @media only screen and (min-width:     992px) {<br />
003 /* 1.ROOT */<br />
004 body {<br />
005 max-width: 960px;<br />
006 }<br />
007 /* 2.HEADINGS */<br />
008 h1 {<br />
009 font-size: 4em;<br />
010 padding-bottom: .5em;<br />
011 }<br />
012 /* 17.MODERNIZR */<br />
013 }/*/mediaquery*/</p>
<p><strong>15. Add an image</strong><br />
Images need some love if they are to fit to the screen size. Let’s open ‘index.html’ and add one to the HTML markup, between two paragraph tags in the main div container. For demonstration purposes, we added ‘image.jpg’ to the img/tmp/ folder.</p>
<p><strong>16. Scale the image</strong><br />
<img class="alignnone size-full wp-image-8115" title="Build responsive sites using the 320 and up framework" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/step16-2.jpg" alt="Build responsive sites using the 320 and up framework" width="610" height="646" /><br />
We need to make sure that the image scales with the content. The solution is to give all img tags max-width: 100%, which will make sure that it never exceeds its wrapping container’s width. Adding max-width: 100% to img on<br />
the screen sizes you want this behaviour on is easy, of course. You might want it to be a global thing, in which case you would add it to the img tag globally.</p>
<p><em>001 div.content img {<br />
002 max-width: 100%;<br />
003 }</em></p>
<p><strong>17. Hide an element</strong><br />
Let’s say that we don’t want to show the complimentary column’s content if the screen width is smaller than 480 pixels. We do this with display: none applied to div.complimentarycontent, which will stop it from rendering. To make it work, we first must add it under ”12.COMPLIMENTARY” on line 255 in ‘style.css’, to make it a starting point.</p>
<p><em>001 /* 12.COMPLIMENTARY */<br />
002 div.complimentarycontent {<br />
003 display: none;<br />
004 }</em></p>
<p><strong>18. Show the element when needed</strong><br />
So now div.complimentarycontent is hidden on small screens, and since that is where the code begins, all other resolutions will inherit it. To sort that out we’ll have to add display: block to div.complimentarycontent at the @media rule, where we want it to start appearing. In this case, that would be at min-width: 768px, where we’ll add display:block to the already present stylings of div.complimentarycontent.</p>
<p><em>001 /*768px ______________ */<br />
002 @media only screen and (min-width: 768px) {<br />
003 /* 3.TYPOGRAPHY */<br />
004 div.complimentarycontent p {<br />
005 font-size: 0.9em;<br />
006 color: #666;<br />
007 }<br />
008 /* 5.FIGURES &amp; IMAGES */<br />
009 div.content img {<br />
010 max-width: 100%;<br />
011 }<br />
012 /* 11.MAIN */<br />
013 div.maincontent {<br />
014 float: left;<br />
015 width: 65%;<br />
016 }<br />
017 /* 12.COMPLIMENTARY */<br />
018 div.complimentarycontent {<br />
019 display: block;<br />
020 float: right;<br />
021 width: 30%;<br />
022 }<br />
023 /* 17.MODERNIZR */<br />
024 }/*/mediaquery*/</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesignermag.co.uk/tutorials/build-responsive-sites-using-the-320-and-up-framework/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Animated infographics with HTML, CSS &amp; jQuery</title>
		<link>http://www.webdesignermag.co.uk/tutorials/animated-infographics-with-html-css-jquery/</link>
		<comments>http://www.webdesignermag.co.uk/tutorials/animated-infographics-with-html-css-jquery/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 08:30:43 +0000</pubDate>
		<dc:creator>Steve Jenkins</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Infographics]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.webdesignermag.co.uk/?p=8034</guid>
		<description><![CDATA[Web infographics are beautiful but typically static. Find out how to add a touch of interactivity. ]]></description>
			<content:encoded><![CDATA[<!--completed--><!--Step011--><!--Step02--><!--step03--><!--step04--><!--step051--><!--Step07--><!--Step08--><!--step10--><!--Step11--><!--Step12--><!--Step13--><!--Step15--><!--Step16--><!--Step17--><!--Step20--><!--step21--><!--Global-Warming-Infographic-Josh-Overton-200x150--><p><img class="alignnone size-full wp-image-8067" title="Animated infographics with HTML, CSS & jQuery" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/completed.jpg" alt="Animated infographics with HTML, CSS & jQuery" width="610" height="953" /></p>
<p>Infographics are a great way of presenting data in an easy-to-understand, digestible form that can highlight the key learning points without the need to get down and dirty with numbers. Because of their ability to convey a message with high impact, they’ve become hugely popular on the web over the past few years. But the vast majority of them suffer from being static, un-interactive and formulaic. As a result, day by day they are losing their original impact as viewers tire of seeing the same visual approach – think of it like eating the same meal over and over.<br />
At the heart of the infographic is the idea that data is being shared, so why not use that to build an interactive, animated design that retains the core link to a data source, and looks great at the same time? In this tutorial we’re using HTML, CSS and jQuery to do just that…</p>
<h3>tools | tech | trends: Adobe Illustrator, HTML editor of choice, jQuery<br />
expert: Sam Hampton-Smith<br />
tutorial files: <a href="http://www.webdesignermag.co.uk/tutorial-files/issue-186-tutorial-files/" target="_self">download</a></h3>
<p><strong>01. Choose a data source</strong><br />
<img class="alignnone size-full wp-image-8062" title="Step01" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/Step011.jpg" alt="Animated infographics with HTML, CSS & jQuery" width="610" height="440" /><br />
The first thing we need to do is to decide on a data source we’ll use to create our infographic. There are numerous sources of interesting data across the web, including data.gov.uk, data.un.org and www.imf.org/external/data.htm, or take a look at gapminder.org to get some inspiration. We’ve cheated and made up some dummy data for our graphic.</p>
<p><strong>02. Mockup design</strong><br />
<img class="alignnone size-full wp-image-8047" title="Animated infographics with HTML, CSS & jQuery" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/Step02.jpg" alt="Animated infographics with HTML, CSS & jQuery" width="610" height="447" /><br />
As it’s an infographic, we really want to mock it up in some graphics software first, so we have a good idea of what our final output will look like. We can also use the mockup to output any graphics we need to render. Illustrator is perfect for this, but you can use whatever software you have installed to the same effect.</p>
<p><strong>03. Create core HTML</strong><br />
<img class="alignnone size-full wp-image-8048" title="Animated infographics with HTML, CSS & jQuery" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/step03.jpg" alt="Animated infographics with HTML, CSS & jQuery" width="610" height="348" /><br />
We’re going to create our interactive infographic using an HTML table as the data source. This has the benefit of making the data accessible – if for some reason the user doesn’t want to, or can’t render the graphical version, the data will still be visible. Start off by creating a basic HTML page.</p>
<p><strong>04. Data goes in tables</strong><br />
<img class="alignnone size-full wp-image-8049" title="Animated infographics with HTML, CSS & jQuery" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/step04.jpg" alt="Animated infographics with HTML, CSS & jQuery" width="610" height="403" /><br />
Convert and format your data source into an HTML table. Try to keep it easy to navigate and sparse, though – remember that we’ll be using code to get access to the values within the table, so it needs to be simple. Don’t nest your data many tables deep!</p>
<p><strong>05. Static HTML for design</strong><br />
<img class="alignnone size-full wp-image-8050" title="step05" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/step051.jpg" alt="Animated infographics with HTML, CSS & jQuery" width="610" height="440" /><br />
Separately from the table, we’re going to create the necessary HTML to display our full infographic, and then we’ll use jQuery to show and animate this. Start off by creating the core &lt;div&gt;s for the infographic area, the two bar charts and the area chart. Don’t put the real data in these, just make sure you give each a hook for jQuery by using a unique class or ID.</p>
<p><strong>06. Add placeholder structure</strong><br />
We need to create the placeholder content and structure for the rest of the infographic. Again, don’t worry about putting in the final data, but do make sure you separate the label and values within your markup, and add appropriate hooks for your script to grab onto.</p>
<p><strong>07. Build your CSS</strong><br />
<img class="alignnone size-full wp-image-8051" title="Animated infographics with HTML, CSS & jQuery" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/Step07.jpg" alt="Animated infographics with HTML, CSS & jQuery" width="610" height="710" /><br />
Having created the markup, it’s time to style it to look vaguely like our mockup, so add the necessary CSS rules to create the look in the browser. Position the bar charts absolutely, from the bottom of their parent &lt;div&gt;s to get good alignment. Do the same for the area chart at the bottom of the page.</p>
<p><strong>08. Test your layout</strong><br />
<img class="alignnone size-full wp-image-8052" title="Animated infographics with HTML, CSS & jQuery" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/Step08.jpg" alt="Animated infographics with HTML, CSS & jQuery" width="610" height="465" /><br />
Before you proceed any further, you should test your layout in all the browsers that matter to you – it<br />
will become much more difficult to bug check once you’ve got your jQuery code in place, so spend the time now to make sure everything renders as planned across all desired browsers.</p>
<p><strong>09. Bring on the script!</strong><br />
We’re going to use jQuery to grab the data from the table and populate all the placeholder content in our infographic. Start off by grabbing the latest build from jquery.com, and add a new script to your page to hold your own jQuery code. Finally, add a $(document).ready() function.</p>
<p><strong>10. Pull out the data</strong><br />
<img class="alignnone size-full wp-image-8053" title="Animated infographics with HTML, CSS & jQuery" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/step10.jpg" alt="Animated infographics with HTML, CSS & jQuery" width="610" height="370" /><br />
As we’re using a table on the same HTML page as our data source, we don’t need to worry about being too careful with unexpected data in our code. You can either take a manual approach to extracting a piece of data, or try to do it programmatically. The latter would be preferable if you wanted to allow for 2011 data at a later stage, but here we’ll go for the easiest route.</p>

					<div class="adInPost">
						<script type="text/javascript">
							GA_googleFillSlot("WD_MidPage_MPU1");
						</script>
					</div><p><strong>11. Place the data</strong><br />
<img class="alignnone size-full wp-image-8054" title="Animated infographics with HTML, CSS & jQuery" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/Step11.jpg" alt="Animated infographics with HTML, CSS & jQuery" width="610" height="696" /><br />
All the hooks you created earlier are now useful as we copy and transplant the individual bits of data into their final positions. Now we can update our table, and the data values will automatically change in our infographic. The next thing we’ll need to do is to apply CSS relative to the data.</p>
<p><strong>12. A little maths</strong><br />
<img class="alignnone size-full wp-image-8055" title="Animated infographics with HTML, CSS & jQuery" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/Step12.jpg" alt="Animated infographics with HTML, CSS & jQuery" width="610" height="393" /><br />
This is where it can get a little messy, especially if you’re not keen on maths, but stay with us – it’s quite straightforward. We need to work out how big each bar in the chart should be, relative to each other. We’ve got four bars overall, and they all relate to one another.</p>
<p><strong>13. Work it out</strong><br />
<img class="alignnone size-full wp-image-8056" title="Animated infographics with HTML, CSS & jQuery" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/Step13.jpg" alt="Animated infographics with HTML, CSS & jQuery" width="610" height="373" /><br />
To get the range, work out what the tallest you want a bar to be, and the shortest. The tallest will be mapped to the largest figure in our data, and the shortest to the lowest value. Now it’s simply a case of using an equation to get the height for the other two bars. Use jQuery to apply the CSS to the bars.</p>
<p><strong>14. Repeat for the area chart</strong><br />
We need to repeat the same steps for our area chart at the bottom of our graphic, but instead of just height, we’re also working out width, which makes it a little bit more complicated. A lot of infographics on the web cheat here and don’t use real area comparisons, so don’t worry too much about applying some artistic license along the way.</p>
<p><strong>15. Calculate the change</strong><br />
<img class="alignnone size-full wp-image-8057" title="Animated infographics with HTML, CSS & jQuery" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/Step15.jpg" alt="Animated infographics with HTML, CSS & jQuery" width="610" height="372" /><br />
Finally we need to calculate the change between the two years. To do this, we’ll add the female and male figures for each year and compare the two results by dividing the second by the first. The result shows the percentage of the original, and by subtracting from 100% we get the percentage change.</p>
<p><strong>16. Making it animate</strong><br />
<img class="alignnone size-full wp-image-8058" title="Animated infographics with HTML, CSS & jQuery" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/Step16.jpg" alt="Animated infographics with HTML, CSS & jQuery" width="610" height="300" /><br />
So far we’ve created a static infographic programmatically. As you change the data in the table, the charts update to the new values as appropriate. But we’re no better off than had we saved a graphic (other than making it simple to maintain). What we want is animation of our chart when the user loads the page. Change each of your jQuery CSS() calls to an animate() call.</p>
<p><strong>17. Stagger it</strong><br />
<img class="alignnone size-full wp-image-8059" title="Animated infographics with HTML, CSS & jQuery" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/Step17.jpg" alt="Animated infographics with HTML, CSS & jQuery" width="610" height="369" /><br />
We need to customise our animations to take a little longer, and also stagger them so that they don’t all animate into place at the same time. We can do this using the delay() method to offset the animation. You can also make the charts animate from zero rather than the original defaults we mocked up by adding a CSS() call before the delay() method.</p>
<p><strong>18. Respond to the user</strong><br />
We want to respond to user interaction, so we’ll need to add some functions and additional animations. The easiest choice for interaction is mouseover(), as we won’t need to explain to the user what they need to do – as they move their mouse over the chart, it will change appearance accordingly.</p>
<p><strong>19. Opacity is king</strong><br />
One way we can draw attention to the current data is to darken down the remainder of the infographic. Add an ‘opacity’ class to each  top-level container and add a separate jQuery function for mouseover, setting all but the current container to animate opacity down to 0.7.</p>
<p><strong>20. Hide the raw data</strong><br />
<img class="alignnone size-full wp-image-8060" title="Animated infographics with HTML, CSS & jQuery" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/Step20.jpg" alt="Animated infographics with HTML, CSS & jQuery" width="610" height="385" /><br />
You might choose to format your table nicely so that it adds to the value of the completed piece, but for our purposes it doesn’t fit into our design, so we’ll use jQuery to hide the table from view (see shot below). In doing it this way, should the JavaScript not load for any reason, the table will remain visible, making the data accessible.</p>
<p><strong>21. Test cross-browser</strong><br />
<img class="alignnone size-full wp-image-8061" title="Animated infographics with HTML, CSS & jQuery" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/step21.jpg" alt="Animated infographics with HTML, CSS & jQuery" width="610" height="465" /><br />
Congratulations – you’ve created an interactive infographic. All that remains is to test the cross-browser thoroughly to make sure everything works as expected. Some of the CSS effects might not work perfectly in every browser, but hopefully you picked this up in step 8. Now go forth and create some compelling content to replace all those static infographics!</p>
<h3><em><strong>LOVE INFOGRAPHICS &#8211; TRY THIS</strong></em></h3>
<p><a rel="bookmark" href="../tutorials/photoshop-vector-style-infographics/"><img class="size-full wp-image-8037 alignleft" style="margin-right: 5px;" title="Animated infographics with HTML, CSS & jQuery" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/12/Global-Warming-Infographic-Josh-Overton-200x150.jpg" alt="Animated infographics with HTML, CSS & jQuery" width="99" height="75" /><span style="color: #000000;"><strong>Photoshop: Vector-style infographics</strong></span></a><br />
Learn how to design a simple infographic which combines a statistical message and the current trend for stylish vector graphics</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesignermag.co.uk/tutorials/animated-infographics-with-html-css-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cross-browser fonts and CSS styling rules</title>
		<link>http://www.webdesignermag.co.uk/tutorials/cross-browser-fonts-and-css-styling-rules/</link>
		<comments>http://www.webdesignermag.co.uk/tutorials/cross-browser-fonts-and-css-styling-rules/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 10:58:20 +0000</pubDate>
		<dc:creator>Steve Jenkins</dc:creator>
				<category><![CDATA[Dreamweaver]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Cross-browser]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Dreamweaver CS5]]></category>
		<category><![CDATA[Enrique Ramírez]]></category>
		<category><![CDATA[Espresso]]></category>
		<category><![CDATA[Fonts]]></category>
		<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://www.webdesignermag.co.uk/?p=7206</guid>
		<description><![CDATA[Add beautiful, rich and cross-browser compatible typography for your page designs using @font-face and CSS]]></description>
			<content:encoded><![CDATA[<!--WD184_054-056Fonts--><p><img class="alignnone size-full wp-image-7219" title="Cross-browser fonts and CSS styling rules" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/09/WD184_054-056Fonts.jpg" alt="Cross-browser fonts and CSS styling rules" width="550" height="458" /></p>
<p>Ever since the web started, designers have desired to bring the beauty of their favourite fonts into their designs. Unfortunately, we’ve been limited and just been able to use a handful of ‘web-safe’ fonts (fonts that most computers will have installed) for the dynamic text in our designs, leaving using images or flash movies of non web-safe fonts (our precious, expensive and beautiful bought fonts) as our only resource for bringing them alive on the web.<br />
Our desire was so strong that tools were created to bring these fonts into our tool belt – sIFR, Cufón, Flir and a few more – all with pros and cons, but none was really giving us the flexibility we needed. Today, with the strength and support CSS3 is getting, especially from browser developers, we can now make use of one of its greatest features: @font-face. This nifty tool gives us the power to embed any font we want into a website as native text (rather than an image or an object). Of course, it comes with a few limitations, but nothing that can’t be easily learnt and mastered in order to get all major browsers to display it exactly the way you want it.</p>
<p><strong>tools | tech | trends</strong>: HTML5, CSS3, Dreamweaver CS5 / Espresso<strong><br />
expert:</strong> Enrique Ramírez<br />
<strong>tutorial files &amp; code:</strong> <a href="http://www.webdesignermag.co.uk/tutorial-files/issue-184-tutorial-files/" target="_self">Download here</a></p>
<p><strong>01. The markup</strong><br />
On your text editor, create a new file. Add an HTML5 doctype, an empty &lt;style&gt; tag in the header and a few paragraphs on the body, each with an h1 to h6 header. Add a blockquote for good measure. You’ll be adding different styles to each of these elements,<br />
so keep them well separated for better comparison.</p>
<p><em>&lt;!DOCTYPE html&gt;<br />
&lt;html lang=”en”&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Web Fonts Styling&lt;/title&gt;<br />
&lt;meta charset=”utf-8” /&gt;<br />
&lt;meta http-equiv=”X-UA-Compatible”     content=”IE=edge,chrome=1” /&gt;<br />
&lt;style type=”text/css”&gt;<br />
&lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;h1&gt;Quick Brown Fox jumps over&#8230;&lt;/h1&gt;<br />
&lt;p&gt;Lorem ipsum dolor sit amet,         consectetur adipiscing elit. &lt;/p&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</em></p>
<p><strong>02. The basic styling</strong><br />
Go to your &lt;style&gt; tag in the header, and give the basic page a prettier look. Add a background and font colour. Give some basic styling to the heading tags as well: a colour and a margin will be enough for now. You don’t need much, just some initial styling to make things easier and more inspiring to start working with.</p>
<p><em>body { background: #423C4D;<br />
color: #C4C1C8;<br />
margin: 0 auto;<br />
padding: 100px 0;<br />
width: 660px; }</em></p>
<p><em>h1, h2, h3, h4, h5, h6 {<br />
color: #fff;<br />
margin: 24px auto 12px; }</em></p>
<p><strong>03. Body font</strong><br />
Next comes what’s probably the most important step on any website you’ll ever code: defining the global (default) font for the website. Define its line height, which is the space between lines of text, its font size and its font family. Helvetica Neue is an excellent specimen for our next experiments. You can go funky and add some text shadow to improve readability.</p>
<p><em>body {<br />
background: #423C4D;<br />
color: #C4C1C8;<br />
font-family: ‘Helvetica Neue’, Arial,  Helvetica, sans-serif;<br />
font-size: 12px;<br />
line-height: 1.6;<br />
margin: 0 auto;<br />
padding: 100px 0;<br />
text-shadow: 1px 1px rgba(0,0,0,.8);<br />
width: 660px; }</em></p>
<p><em> </em></p>
<p><em>h1, h2, h3, h4, h5, h6 {<br />
color: #fff;<br />
line-height: 1.2;<br />
margin: 24px auto 12px;<br />
text-shadow: none; }</em></p>
<p><strong>04. Custom fonts</strong><br />
To integrate a custom font on your website, all you need is the source file. However, different browsers support different formats, so normally you’ll want to convert your ‘.ttf’ file to all of them for a real cross-browser experience. A great tool for this can be found at http://fontsquirrel.com/fontface/generator. IMPORTANT: Make sure the font’s licence allows for @font-face embedding.</p>
<p><strong>05. @font-face</strong><br />
You may use a tool (like Font Squirrel’s) to generate the code, but it’s wise to understand it first. Using @font-face is simple: for each font you begin defining its name with the ‘font-family’ property, and then point out the font location within ‘src’. Note that ‘.eot’ file (for IE) must be in a different line.</p>
<p><em>@font-face {</em></p>
<p><em> </em></p>
<p><em>font-family: &#8216;CaviarDreamsRegular&#8217;;</em></p>
<p><em> </em></p>
<p><em>src: url(&#8216;fonts/CaviarDreams-webfont.eot&#8217;);</em></p>
<p><em> </em></p>
<p><em>src: url(&#8216;fonts/CaviarDreams-webfont.eot?#iefix&#8217;) format(&#8216;embedded-opentype&#8217;),</em></p>
<p><em> </em></p>
<p><em>url(&#8216;fonts/CaviarDreams-webfont.woff&#8217;) format(&#8216;woff&#8217;),</em></p>
<p><em> </em></p>
<p><em>url(&#8216;fonts/CaviarDreams-webfont.ttf&#8217;) format(&#8216;truetype&#8217;),</em></p>
<p><em> </em></p>
<p><em>url(&#8216;fonts/CaviarDreams-webfont.svg#CaviarDreamsRegular&#8217;) format(&#8216;svg&#8217;);</em></p>
<p><em> </em></p>
<p><em>}</em></p>
<p><strong>06. Using @font-face fonts</strong><br />
Now that you’ve defined your fonts, you can start using them with the ‘font-family’ CSS property. Just add the name you defined in the previous step to any selector. You can now adjust its size, line height, colour or any other style you want. It’s as styleable as any Arial text!</p>
<p><em>h1 {</em></p>
<p><em> </em></p>
<p><em>font-size: 42px;</em></p>
<p><em> </em></p>
<p><em>font-family: CaviarDreamsRegular, &#8216;Helvetica Neue&#8217;, Arial, Helvetica, sans-serif;</em></p>
<p><em> </em></p>
<p><em>font-weight: 100;</em></p>
<p><em> </em></p>
<p><em>text-align: center;</em></p>
<p><em> </em></p>
<p><em>width: 500px;</em></p>
<p><em> </em></p>
<p><em>}</em></p>
<p><strong>07. Font-weight fun</strong><br />
Something that goes unnoticed most of the time is that ‘font-weight’ serves for more than ‘bold’ and ‘normal’. You can set any multiple of 100 from 100 to 900, where 400 is the same as normal, and 700 is bold. For example, using Helvetica Neue with font-weight 100, we get a beautiful Ultra Light version.</p>
<p><em>h2 {font-size: 36px; font-weight: 100; letter-spacing: .1em;}</em></p>
<p><strong>08. Text-shadow</strong><br />
CSS3 has a very versatile module called ‘text-shadow’. Its syntax is simple: first comes the x position, then the y position, then the feathering of the shadow, and lastly the colour. Text-shadow can be really useful to increase readability of a chunk of text, by having it offset. You can also create some nice effects with it.</p>
<p><em>h3 {</em></p>
<p><em> </em></p>
<p><em>font-size: 38px;</em></p>
<p><em> </em></p>
<p><em>text-shadow: 5px 5px black;</em></p>
<p><em> </em></p>
<p><em>position: relative;</em></p>
<p><em> </em></p>
<p><em>}</em></p>
<p><strong>09. Handwritten notes</strong><br />
One of the advantages of @font-face is that you can add a lot more personality to blocks of content within your design. A handwritten note, for example. You can use a handwritten font for the box, a notepad background and assign a line-height so the text fits in the grid. The effect is very unique.</p>
<p><em>blockquote {</em></p>
<p><em> </em></p>
<p><em>background: #918F94 url(&#8216;bg-notepad.jpg&#8217;) left 10px;</em></p>
<p><em> </em></p>
<p><em>color: #333;</em></p>
<p><em> </em></p>
<p><em>float: right;</em></p>
<p><em> </em></p>
<p><em>font-family: DesyrelRegular;</em></p>
<p><em> </em></p>
<p><em>font-size: 18px;</em></p>
<p><em> </em></p>
<p><em>line-height: 23px;</em></p>
<p><em> </em></p>
<p><em>margin: 0 -24px 1em 1em;</em></p>
<p><em> </em></p>
<p><em>padding: 10px 15px;</em></p>
<p><em> </em></p>
<p><em>text-shadow: -1px -1px rgba(0,0,0,.15);</em></p>
<p><em> </em></p>
<p><em>width: 300px;</em></p>
<p><em> </em></p>
<p><em> -webkit-box-shadow: 2px 2px white;</em></p>
<p><em> </em></p>
<p><em>-moz-box-shadow: 3px 3px 3px rgba(0,0,0,.35);}</em></p>
<p><em> </em></p>
<p><em> blockquote p {margin: 0;}</em></p>
<p><em> </em></p>
<p><em>blockquote p:first-of-type {text-indent: 0;}</em></p>
<p><strong>10. Text-transform</strong><br />
For the times where your content will be user-submitted and you want to keep it in a certain format, text-transform can be of tremendous help. You can transform text to lowercase, uppercase or capitalise it. This can be very useful for some handwritten fonts where you want proper capitalisation, since uppercase characters are highly adorned.</p>
<p><em>h4 {</em></p>
<p><em> </em></p>
<p><em>font-family: CaviarDreamsRegular, &#8216;Helvetica Neue&#8217;, Arial, Helvetica, sans-serif;</em></p>
<p><em> </em></p>
<p><em>font-size: 36px;</em></p>
<p><em> </em></p>
<p><em>font-weight: normal;</em></p>
<p><em> </em></p>
<p><em>text-transform: lowercase;}</em></p>
<p><em> </em></p>
<p><em>h4 strong {text-transform: uppercase;}</em></p>
<p><strong>11. Letter-spacing</strong><br />
Another powerful tool for styling your text, CSS’s letter spacing will add or remove space between characters. You can use any unit you may like, but ems are recommended to keep the aspect ratio between font sizes. Big fonts tend to look better with bigger letter spacing. Apply this to your h4 to see a good example.</p>
<p><em>h4 {letter-spacing: .5em;}</em></p>
<p><strong>12. Font-stretch</strong><br />
Some fonts have a condensed and/or expanded style within, which often results in a very different-looking font. This can be very handy and save space and bandwidth when using @font-face. Fortunately, there’s an easy way to use these styles. Setting the element’s font-stretch to condensed will give us a more impact-like font that’s very suitable for headers.</p>
<p><em>h5 {</em></p>
<p><em> </em></p>
<p><em>font-size: 30px;</em></p>
<p><em> </em></p>
<p><em>font-stretch: condensed;}</em></p>
<p><strong>13. Text-shadow revisited</strong><br />
You can have some more fun with the text-shadow property. You can stack more than one text shadow, making it possible to add a glow to your text to increase contrast, all while adding some double text to the background. Or you could even stack coloured glows!</p>
<p><em>h6 {</em></p>
<p><em> </em></p>
<p><em>font-size: 48px;</em></p>
<p><em> </em></p>
<p><em>font-stretch: condensed;</em></p>
<p><em> </em></p>
<p><em>padding: 10px;</em></p>
<p><em> </em></p>
<p><em>text-align: center;</em></p>

					<div class="adInPost">
						<script type="text/javascript">
							GA_googleFillSlot("WD_MidPage_MPU1");
						</script>
					</div><p><em> </em></p>
<p><em>text-shadow: 3px 3px 8px #BD9E59,</em></p>
<p><em> </em></p>
<p><em>-3px -3px 8px #BD4B3B,</em></p>
<p><em> </em></p>
<p><em>-3px 3px 8px #7EBD56,</em></p>
<p><em> </em></p>
<p><em>3px -3px 8px #964BBD,</em></p>
<p><em> </em></p>
<p><em>-3px -3px rgba(255,255,255,.3);</em></p>
<p><em> </em></p>
<p><em>}</em></p>
<p><strong>14. Add gradients</strong><br />
You can give your text a bit of texture by filling it with a gradient above it. First, relative-position your element. Then create an :after pseudo class on your element, use an empty content declaration, absolute-position it above your text with roughly the same height and apply a gradient background to it (it can be an image as well).</p>
<p><em>h6 {position: relative;}</em></p>
<p><em> </em></p>
<p><em>h6:after {</em></p>
<p><em> </em></p>
<p><em>content: &#8220;&#8221;;</em></p>
<p><em> </em></p>
<p><em>display: block;</em></p>
<p><em> </em></p>
<p><em>height: 52px;</em></p>
<p><em> </em></p>
<p><em>left: 0;</em></p>
<p><em> </em></p>
<p><em>position: absolute;</em></p>
<p><em> </em></p>
<p><em>top: 15px;</em></p>
<p><em> </em></p>
<p><em>width: 100%;</em></p>
<p><em> </em></p>
<p><em> background: -moz-linear-gradient(top, rgba(66,60,77,.8) 0%, rgba(66,60,77,0) 90%);</em></p>
<p><em> </em></p>
<p><em>background: -webkit-linear-gradient(top, rgba(66,60,77,.8) 0%,rgba(66,60,77,0) 100%);</em></p>
<p><em> </em></p>
<p><em>background: linear-gradient(top, rgba(66,60,77,.8) 0%,rgba(66,60,77,0) 100%);}</em></p>
<p><strong>15. Transformations</strong><br />
You can rotate your text to any degree using the transform CSS property. Adding a 15 degree rotation can be a great way to have styled text positioned in, say, a badge on a product to grab attention. The transform property also has a scale option, which can make your text twice its size without changing its font-size.</p>
<p><em>h6 {</em></p>
<p><em> </em></p>
<p><em>-webkit-transform: rotate(-5deg) scale(1.5);</em></p>
<p><em> </em></p>
<p><em>-moz-transform: rotate(-5deg) scale(1.5);</em></p>
<p><em> </em></p>
<p><em>transform: rotate(-5deg) scale(1.5);}</em></p>
<p><strong>16. Text-stroke</strong><br />
Webkit brings you another nifty feature, which lets you add a stroke to your text. The property name is ‘webkit-text-stroke’ and its syntax is similar to border’s, but without the ‘border-style’. Note that so far this will only work on webkit browsers, so it’s advised to use -webkit-text-fill-color to compensate for any accessibility issues.</p>
<p><em>h6 {</em></p>
<p><em> </em></p>
<p><em>color: #fff;</em></p>
<p><em> </em></p>
<p><em> -webkit-text-stroke: 1px #333;</em></p>
<p><em> </em></p>
<p><em>-webkit-text-fill-color: #423C4D;}</em></p>
<p><strong>17. Hover effects</strong><br />
For places where mouse interactivity is a must, you can combine any of the styles mentioned and apply them to a :hover element. Paired with an :after and a few animations, you can grab the user’s attention fast and effectively. Animations on text elements go smoother than on graphics, so it’d be wise to use that advantage.</p>
<p><em>.fin {</em></p>
<p><em> </em></p>
<p><em>color: #fff;</em></p>
<p><em> </em></p>
<p><em>font-family: TangerineRegular, &#8216;Helvetica Neue&#8217;, Arial, Helvetica, sans-serif;</em></p>
<p><em> </em></p>
<p><em>font-style: italic;</em></p>
<p><em> </em></p>
<p><em>font-size: 120px;</em></p>
<p><em> </em></p>
<p><em>margin: 0;</em></p>
<p><em> </em></p>
<p><em>position: relative;</em></p>
<p><em> </em></p>
<p><em>text-align: center;</em></p>
<p><em> </em></p>
<p><em>text-shadow: 3px 3px black;</em></p>
<p><em> </em></p>
<p><em> -webkit-transition: all 1s ease-in-out;</em></p>
<p><em> </em></p>
<p><em>-moz-transition: all 1s ease-in-out;</em></p>
<p><em> </em></p>
<p><em>-o-transition: all 1s ease-in-out;</em></p>
<p><em> </em></p>
<p><em>}</em></p>
<p><em> </em></p>
<p><em> .fin:hover {</em></p>
<p><em> </em></p>
<p><em>-webkit-transform: rotate(-5deg) scale(1.5);</em></p>
<p><em> </em></p>
<p><em>-moz-transform: rotate(-5deg) scale(1.5);</em></p>
<p><em> </em></p>
<p><em>transform: rotate(-5deg) scale(1.5);</em></p>
<p><em> </em></p>
<p><em>}</em></p>
<p><em> </em></p>
<p><em>.fin:hover:after {</em></p>
<p><em> </em></p>
<p><em>content: &#8220;Fin&#8221;;</em></p>
<p><em> </em></p>
<p><em>display: block;</em></p>
<p><em> </em></p>
<p><em>height: 52px;</em></p>
<p><em> </em></p>
<p><em>left: 0;</em></p>
<p><em> </em></p>
<p><em>position: absolute;</em></p>
<p><em> </em></p>
<p><em>top: 0;</em></p>
<p><em> </em></p>
<p><em>width: 100%;</em></p>
<p><em> </em></p>
<p><em> text-shadow: 3px 3px 8px #BD9E59,</em></p>
<p><em> </em></p>
<p><em>-3px -3px 8px #BD4B3B,</em></p>
<p><em> </em></p>
<p><em>-3px 3px 8px #7EBD56,</em></p>
<p><em> </em></p>
<p><em>3px -3px 8px #964BBD,</em></p>
<p><em> </em></p>
<p><em>-3px -3px rgba(255,255,255,.3);}</em></p>
<p><strong>18. Bottom line</strong><br />
You’ve now got a very good understanding and knowledge to achieve rich texts in your designs. However, beware not to fall into bad practices. Abusing or overusing these new possibilities can prove detrimental to your designs. The general rule of thumb to follow with text is: if it doesn’t aid impact or legibility, it’s better off gone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesignermag.co.uk/tutorials/cross-browser-fonts-and-css-styling-rules/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Create iPad digital editions with Mag+</title>
		<link>http://www.webdesignermag.co.uk/tutorials/magplus-experience/</link>
		<comments>http://www.webdesignermag.co.uk/tutorials/magplus-experience/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 10:27:26 +0000</pubDate>
		<dc:creator>Steve Jenkins</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Apple iPad]]></category>
		<category><![CDATA[Digital Magazine]]></category>
		<category><![CDATA[InDesign]]></category>
		<category><![CDATA[Mag+]]></category>
		<category><![CDATA[WebKit]]></category>

		<guid isPermaLink="false">http://www.webdesignermag.co.uk/?p=6906</guid>
		<description><![CDATA[Expand the functionality and user experience of Mag+ with HTML functionality. It’s easier than you think.]]></description>
			<content:encoded><![CDATA[<!--finalshotsTWSnowCover--><!--step1--><!--step2--><!--step31--><!--step4--><!--step5--><!--step6--><!--step7-e1311673506155--><!--step8--><!--step9--><!--step101--><!--step111--><!--step121--><!--step13--><!--step14--><!--step15--><!--tech_step1--><!--tech_step2--><!--tech_step3--><p><img class="alignnone size-full wp-image-6909" title="Create iPad digital editions with Mag+" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/finalshotsTWSnowCover.jpg" alt="Create iPad digital editions with Mag+" width="500" height="586" /></p>
<p>The possibilities for digital magazines on the iPad are breathtaking. Many publishers, excited about the possibilities, are keenly moving their titles on to this format – in a bid to delight readers both new and old. One software solution really catching on is Mag+, from Moving Media+, the platform behind pioneering titles like Popular Science+ and Transworld Snowboarding.</p>
<p>In this tutorial you’ll learn a more advanced technique, adding html functionality directly in InDesign to enhance the user experience.</p>
<p>Everything you need to know about the Mag+ software – including downloading it for free – is on <a href="http://www.magplus.com/">http://www.magplus.com</a>. In this tutorial, we assume you have already got to grips with the basics.</p>
<p><strong>STEP 01</strong><br />
<img class="alignnone size-full wp-image-6910" title="Create iPad digital editions with Mag+" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/step1.jpg" alt="Create iPad digital editions with Mag+" width="500" height="367" /><br />
The right template<br />
Start up InDesign and open the included template file [FILENAME]. This is the main template for all design work in the Mag+ format. If you want to add your own swatches and formats you do so as you would with any document, create or import them into your new document.</p>
<p><strong>STEP 02</strong><br />
<img class="alignnone size-full wp-image-6911" title="Create iPad digital editions with Mag+" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/step2.jpg" alt="Create iPad digital editions with Mag+" width="500" height="824" /><br />
Set up document<br />
Activate the Mag+ plugin and fill in the required fields. ”Issue” is the folder you export to, ”Id” is the name the document you will have in the code, ”Name” is what shows up in the Production Tool and when users bookmark a page, so make it something descriptive. All these can be named whatever you choose.</p>
<p><strong>STEP 03</strong><br />
<img class="alignnone size-full wp-image-6912" title="step3" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/step31.jpg" alt="Create iPad digital editions with Mag+" width="500" height="228" /><br />
Prepare your assets<br />
Prepare your image assets at this stage. The images you want to switch should all be of the exact same size and resolution. At this stage, also prepare a layout version of the first image in the sequence by making a copy and setting that copy to 132 dpi resolution, without changing file dimensions.</p>
<p><strong>STEP 04</strong><br />
<img class="alignnone size-full wp-image-6913" title="Create iPad digital editions with Mag+" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/step4.jpg" alt="Create iPad digital editions with Mag+" width="500" height="261" /><br />
Assets in place<br />
The folder [Changing Images] holds all your html assets. In here you’ll find the ”assets” sub-folder. Place your prepared images, except for the 132 dpi version, in here. In the included html document we point to that folder, but you can change it to another folder if you wish.</p>
<p><strong>STEP 05</strong><br />
<img class="alignnone size-full wp-image-6914" title="Create iPad digital editions with Mag+" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/step5.jpg" alt="Create iPad digital editions with Mag+" width="500" height="244" /><br />
Code writing<br />
Substitute the included image links in the html document for the ones you just created. The string &lt;img src=&#8221;assets/chair0X.jpg&#8221; /&gt; should instead point to your files. Also, change the viewport parameter ”width” to the width in pixels for the images you’re using.</p>
<p><strong>STEP 06</strong><br />
<img class="alignnone size-full wp-image-6915" title="Create iPad digital editions with Mag+" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/step6.jpg" alt="Create iPad digital editions with Mag+" width="500" height="574" /><br />
Test run in Webkit<br />
Test run your html document in Safari or Chrome (or another Webkit based browser), since they give the best approximation of how this function will work on the iPad. The webview windows in Mag+ use the iPad’s built-in browser capabilities. But it still makes sense to testrun on the desktop.</p>
<p><strong>STEP 07</strong><br />
<img class="alignnone size-full wp-image-6916" title="step7" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/step7-e1311673506155.jpg" alt="Create iPad digital editions with Mag+" width="480" height="490" /><br />
Test run on iPad<br />
You should also test run your html functionality in Mobile Safari on the iPad. The simplest way to do this is to use Dropbox’s public folder for a direct web link. For more on how to achieve this in a simple way – see the boxout on ”Testing your html on the device”.</p>
<p><strong>STEP 08<br />
<img class="alignnone size-full wp-image-6917" title="Create iPad digital editions with Mag+" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/step8.jpg" alt="Create iPad digital editions with Mag+" width="500" height="492" /><br />
</strong>Basic layout<br />
In InDesign, create your layout, remembering to make allowances for the richer functionality and reader interaction. So don’t place too much stuff on top of the image you are defining as an html area. More on this in the next step.</p>

					<div class="adInPost">
						<script type="text/javascript">
							GA_googleFillSlot("WD_MidPage_MPU1");
						</script>
					</div><p><strong> STEP 09</strong><br />
<img class="alignnone size-full wp-image-6918" title="Create iPad digital editions with Mag+" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/step9.jpg" alt="Create iPad digital editions with Mag+" width="500" height="616" /><br />
Drag and drop<br />
The 132 dpi image you created in Step 3 is your placeholder for the html file. Just drag and drop it into your InDesign workspace. The 132 dpi resolution will show up at the correct size in your document.</p>
<p><strong>STEP 10</strong><br />
<img class="alignnone size-full wp-image-6919" title="step10" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/step101.jpg" alt="Create iPad digital editions with Mag+" width="500" height="366" /><br />
Image to HTML<br />
The image you dragged into InDesign can now be set up as an html area. Select it and set ”Object type” to ”HTML” in the Mag+ plugin. Click on ”File” to choose the local html file you have set up. This will now use that exact area as a webview window for your html.</p>
<p><strong>STEP 11</strong><br />
<img class="alignnone size-full wp-image-6920" title="step11" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/step111.jpg" alt="Create iPad digital editions with Mag+" width="500" height="574" /><br />
Setting options<br />
You can set your pinning options for the html just like you would with any other object. But there are a couple of options especially for the HTML object type. In this case, when we have defined an exact viewport size we can leave the ”Scale contents to fit box” checked.</p>
<p><strong>STEP 12</strong><br />
<img class="alignnone size-full wp-image-6921" title="step12" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/step121.jpg" alt="Create iPad digital editions with Mag+" width="500" height="820" /><br />
Setup for review<br />
Set up your system for reviewing by starting your Mag+ Reviewer app on your iPad. Make sure your iPad and your computer are on the same wireless network. Input the IP address from the info field at the top right in the Reviewer app into the ”Push review to device” field.</p>
<p><strong>STEP13</strong><br />
<img class="alignnone size-full wp-image-6922" title="Create iPad digital editions with Mag+" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/step13.jpg" alt="Create iPad digital editions with Mag+" width="500" height="358" /><br />
Fast review<br />
Hit ”Fast Review” to check out your vertical on your iPad. The html and the included assets are exported to the device and are locally stored within the file. Test out your html functionality on the iPad. You’ll see that the placeholder image is just used for the lo-res preview.</p>
<p><strong>STEP 14</strong><br />
<img class="alignnone size-full wp-image-6923" title="Create iPad digital editions with Mag+" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/step14.jpg" alt="Create iPad digital editions with Mag+" width="500" height="147" /><br />
Export to PT<br />
When you’re happy with what you see in the fast review, you are ready to export your vertical to the Production Tool. Simply make sure the ”Issue” folder is set up correctly and hit ”Export”. Point your Production Tool to that folder, hit Refresh if you haven’t already done so.</p>
<p><strong>STEP 15</strong><br />
<img class="alignnone size-full wp-image-6907" title="Create iPad digital editions with Mag+" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/step15.jpg" alt="Create iPad digital editions with Mag+" width="500" height="343" /><br />
Include in issue<br />
You should now see your exported vertical in the Clipboard section of the Production Tool, to the left. Drag that vertical into the Content Verticals area and place it where you’d like. If you have multiple verticals you can preview them together by hitting ”Review All” or ”Review Selected”.</p>
<p><strong>TECHNIQUE</strong><br />
Web check with Dropbox</p>
<p><strong>STEP 01</strong><br />
<img class="alignnone size-full wp-image-6962" title="Create iPad digital editions with Mag+" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/tech_step1.jpg" alt="Create iPad digital editions with Mag+" width="500" height="639" /><br />
Create an account<br />
If you don’t have Dropbox, open a free 2GB account at <a href="http://www.dropboxhq.com/">http://www.dropbox.com</a>. For this purpose you’ll only need the “Public” folder, which serves as your web server.</p>
<p><strong>STEP02</strong><br />
<img class="alignnone size-full wp-image-6963" title="Create iPad digital editions with Mag+" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/tech_step2.jpg" alt="Create iPad digital editions with Mag+" width="500" height="63" /><br />
Move your assets<br />
Copy your html folder into the “Public” folder of your Dropbox folder. Then right-click on the .html file and choose “Copy public link”. This is now your html index file.</p>
<p><strong>STEP 03</strong><br />
<img class="alignnone size-full wp-image-6961" title="Create iPad digital editions with Mag+" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/tech_step3.jpg" alt="Create iPad digital editions with Mag+" width="500" height="120" /><br />
Go to iPad<br />
Send yourself the link, or write it directly into Mobile Safari on the iPad. Now you can check that your html works as it should. Good luck.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesignermag.co.uk/tutorials/magplus-experience/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a basic HTML5 page with the new layout tags</title>
		<link>http://www.webdesignermag.co.uk/tutorials/create-a-basic-html5-page/</link>
		<comments>http://www.webdesignermag.co.uk/tutorials/create-a-basic-html5-page/#comments</comments>
		<pubDate>Mon, 25 Jul 2011 13:16:02 +0000</pubDate>
		<dc:creator>Mark Billen</dc:creator>
				<category><![CDATA[Dreamweaver]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[layouts]]></category>
		<category><![CDATA[tags]]></category>
		<category><![CDATA[Template]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.webdesignermag.co.uk/?p=6945</guid>
		<description><![CDATA[How to build a simple and semantic one-page template with HTML5]]></description>
			<content:encoded><![CDATA[<!--Final2--><p><img class="alignnone size-full wp-image-6949" title="Final" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/Final2.jpg" alt="Create a basic HTML5 page with the new layout tags" width="500" height="417" /></p>
<p><strong>Create a basic HTML5 page with the new layout tags</strong></p>
<p>How to build a simple and semantic one-page template with HTML5</p>
<p><strong>tools | tech | trends:</strong> Photoshop, Adobe Dreamweaver, HTML5<br />
<strong>expert:</strong> Neil Pearce</p>
<p>This article originally appeared in Web Designer issue 181, you can download the cover CD tutorial files by <a href="http://www.webdesignermag.co.uk/wp-content/uploads/2011/03/HTML5_Layout_Tags_with_PSD.zip" target="_blank">clicking here</a></p>
<p>In this tutorial, we’re going to build a one-page template using some of the next-generation techniques from HTML5. Everyone’s talking about HTML5, it’s perhaps the most-hyped technology since people started putting rounded corners on everything. Apparently though, HTML5 won’t be completely supported until 2022, but this is a misconception based on the projected date that HTML5 will reach the stage in the W3C process known as Candidate Recommendation (REC).All this means is that the spec won’t be completely finished until you can use all of it, and in at least two browsers. But don’t let that stop you from using the new tags now – after all, this industry moves so damn fast that it’s nice to be able to stay ahead for once!<br />
HTML5 introduces a bunch of new elements that will make our pages more semantic, cleaner and faster. It also includes fancy APIs for drawing graphics on screen, storing data offline, playing video and a lot more. The web industry is buzzing right now with the introduction of both HTML5 and CSS3, and if you couple that with jQuery (or any other JavaScript library), then you have some very powerful, sought-after skills all ready to take the industry by the scruff of the neck! So open up the supplied PSD design (on the CD) and let’s get cracking…</p>

					<div class="adInPost">
						<script type="text/javascript">
							GA_googleFillSlot("WD_MidPage_MPU1");
						</script>
					</div><p><strong>01 Set things up</strong><br />
Before we jump into Photoshop, it’s always a good idea to create the basic markup first. Open up a new file in Dreamweaver (or your chosen editor), and name it ‘index.html’ and add the new and very simple doctype and head section. It isn’t even necessary for HTML5, but it’s used for current and older browsers that require a specified doctype. Browsers that do not understand this doctype will render the markup in Standards mode.</p>
<p>001 <em>&lt;!DOCTYPE html&gt;</em><br />
002 <em>&lt;html&gt;</em><br />
003 <em>&lt;head&gt;</em><br />
004 <em>&lt;meta http-equiv=”Content-Type” content=”text/html; charset=utf-8”&gt;</em><br />
005 <em>&lt;!&#8211;[if lt IE 9]&gt;</em><br />
006 <em>&lt;script src=”http://html5shiv.googlecode.com/svn/trunk/html5.js”&gt;&lt;/script&gt;</em><br />
007 <em>&lt;![endif]&#8211;&gt;</em><br />
008 <em>&lt;link rel=”stylesheet” href=”styles.css”&gt;</em><br />
009 <em>&lt;title&gt;Web designer&lt;/title&gt;</em><br />
010 <em>&lt;/head&gt;</em></p>
<p><strong>02 Inside the head</strong><br />
As you can see, the new doctype is much cleaner than what you would have if you were writing HTML4 or XHTML. You will also notice the link to the style sheet is missing its type attribute. This is no longer necessary, as it’s implied that this link refers to style sheets. This is also true for any links to scripts that you may use.</p>
<p>001 <em>&lt;link rel=”stylesheet” href=”styles.css”&gt;</em><br />
002 <em>&lt;script src=”js/scripts.js”&gt;&lt;/script&gt;</em></p>
<p><strong>03 HTML5 shiv</strong><br />
In IE, excluding the newest version (IE9), you cannot apply styles to elements that the browser does not recognise and our new HTML5 elements, in all their glory, are not recognised to CSS rules. This is where Remy Sharp’s html5shiv comes to the rescue.<br />
Simply include the link in your page’s &lt;head&gt; section and you will be able to style the new HTML5 elements without fear.</p>
<p>001 <em>&lt;!&#8211;[if lt IE 9]&gt; </em><br />
002 <em>&lt;script src=”http://html5shiv.googlecode.com/svn/trunk/html5.js”&gt;&lt;/script&gt;</em><br />
003 <em>&lt;![endif]&#8211;&gt;</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesignermag.co.uk/tutorials/create-a-basic-html5-page/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Working with sitemaps for Google and Bing</title>
		<link>http://www.webdesignermag.co.uk/tutorials/working-with-sitemaps/</link>
		<comments>http://www.webdesignermag.co.uk/tutorials/working-with-sitemaps/#comments</comments>
		<pubDate>Mon, 25 Jul 2011 11:45:14 +0000</pubDate>
		<dc:creator>Mark Billen</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Bing]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[sitemaps]]></category>

		<guid isPermaLink="false">http://www.webdesignermag.co.uk/?p=6933</guid>
		<description><![CDATA[Use tools such as sitemaps to help search engines index the right sections of your sites]]></description>
			<content:encoded><![CDATA[<!--sitemapsThumb--><!--step01--><!--step02--><!--step03--><p><img class="alignnone size-full wp-image-6943" title="Working with sitemaps for Google and Bing" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/sitemapsThumb.jpg" alt="Working with sitemaps for Google and Bing" width="315" height="259" /></p>
<p><strong>Working with sitemaps for Google and Bing</strong><br />
<strong><br />
tools | tech | trends:</strong> Google account, text editor<br />
<strong>expert:</strong> Simon Bisson</p>
<p>This article originally appeared in Web Designer issue 180, you may download the cover CD project files by <a href="http://www.webdesignermag.co.uk/wp-content/uploads/2011/01/Sitemaps.zip" target="_blank">clicking here</a></p>
<p>There’s a war going on out there, one between the folk who run the big search engines and the folk who try to get sites as high up the rankings as possible. It’s one that the search engines are always going to win, as they run the robots that spider the web and they manage the indexes that feed results to our search queries. Each time the SEO gurus figure out a wrinkle in the algorithms at Google and Bing the next big update changes the rules to ensure that the most relevant results get delivered to end users. So if SEO doesn’t get your site at the top of that results page, how can you get the eyeballs you need? The answer’s simple: just follow the rules, and take advantage of the analytic tools that Google and Bing provide. They’re a powerful insight into the way users search for your site.<br />
There’s also the problem of how to get into the indexes in the first place, along with ensuring that the right pages get indexed. That’s where the sitemap standard comes in, a way of generating a guide to your site that search engine robots can find and use to index your content – and not just your HTML, but your video, images, news, and location. Throughout this tutorial we’ve included snippets of the code for each step, but the full code can be found within the project files.</p>
<p><strong>01 Sitemaps</strong></p>
<p><img class="alignnone size-full wp-image-6934" title="Working with sitemaps for Google and Bing" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/step01.jpg" alt="Working with sitemaps for Google and Bing" width="500" height="341" /></p>
<p>Sitemaps used to be graphical tools for helping users get around sites. Now they’re much more complex creatures, XML documents designed to inform the robots that feed search engines just how to index a site – and to give them additional information about the content we’re delivering. A basic sitemap looks something like this:</p>
<p>001 <em>&lt;?xml version=”1.0” encoding=”UTF-8”?&gt;</em><br />
002 <em>&lt;urlsetxmlns=”http://www.sitemaps.org/schemas/sitemap/0.9”&gt;</em><br />
003 <em>&lt;url&gt;</em><br />
004 <em>&lt;loc&gt;http://www.mysite.com/&lt;/loc&gt;</em><br />
005 <em>&lt;lastmod&gt;2011-01-01&lt;/lastmod&gt;</em><br />
006 <em>&lt;changefreq&gt;monthly&lt;/changefreq&gt;</em><br />
007 <em>&lt;priority&gt;0.5&lt;/priority&gt;</em><br />
008 <em>&lt;/url&gt;</em><br />
009 <em>&lt;/urlset&gt;</em><br />
<strong><br />
02 Defining the URL (1)</strong></p>

					<div class="adInPost">
						<script type="text/javascript">
							GA_googleFillSlot("WD_MidPage_MPU1");
						</script>
					</div><p><img class="alignnone size-full wp-image-6935" title="Working with sitemaps for Google and Bing" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/step02.jpg" alt="Working with sitemaps for Google and Bing" width="500" height="323" /></p>
<p>Each url you want to include in a sitemap needs to be defined using XML tags. The first, &lt;loc&gt;, is the location of the page or site section to be indexed. It’s a good idea to include the &lt;lastmod&gt; field, as this shows when a page was last changed. You’ll need to use the W3C’s Datetime format for this – which means you can use just the date (YYYY-MM-DD).</p>
<p>001 <em>&lt;?xml version=”1.0” encoding=”UTF-8”?&gt;</em><br />
002 <em>&lt;urlsetxmlns=”http://www.sitemaps.org/schemas/sitemap/0.9”&gt;</em><br />
003 <em>&lt;url&gt;</em><br />
004 <em>&lt;loc&gt;http://www.mysite.com/page1.html&lt;/loc&gt;</em><br />
005 <em>&lt;lastmod&gt;2011-01-01T19:20:30+01:00&lt;/lastmod&gt;</em><br />
006 <em>&lt;/url&gt;</em><br />
007 <em>&lt;url&gt;</em><br />
008 <em>&lt;loc&gt;http://www.mysite.com/page2.html&lt;/loc&gt;</em><br />
009 <em>&lt;lastmod&gt;2011-01-02&lt;/lastmod&gt;</em><br />
010 <em>&lt;/url&gt;</em><br />
011<em> &lt;url&gt;</em><br />
012    <em>&lt;loc&gt;http://www.mysite.com/page3.html&lt;/loc&gt;</em></p>
<p><strong>03 Defining the URL (2)</strong></p>
<p><img class="alignnone size-full wp-image-6936" title="Working with sitemaps for Google and Bing" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/step03.jpg" alt="Working with sitemaps for Google and Bing" width="500" height="323" /></p>
<p>Search engines like Google have a lot of processing power, but even it doesn’t have enough to index every change to the web. Sitemaps can help them prioritise their crawlers. All you need to do is use the &lt;changefreq&gt; tab to show just how often a page is updated. If it’s a dynamic page – use “always”!</p>
<p>001 <em>Valid values for &lt;changefreq&gt;:</em><br />
002 <em>always</em><br />
003 <em>hourly</em><br />
004 <em>daily</em><br />
005 <em>weekly</em><br />
006 <em>monthly</em><br />
007 <em>yearly</em><br />
008 <em>never</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesignermag.co.uk/tutorials/working-with-sitemaps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create 3D transform effects with CSS and HTML</title>
		<link>http://www.webdesignermag.co.uk/tutorials/3d-transforms-with-css/</link>
		<comments>http://www.webdesignermag.co.uk/tutorials/3d-transforms-with-css/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 11:35:37 +0000</pubDate>
		<dc:creator>Mark Billen</dc:creator>
				<category><![CDATA[Dreamweaver]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[effects]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[transforms]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.webdesignermag.co.uk/?p=6882</guid>
		<description><![CDATA[The upsurge in CSS3 and HTML5 brings us features like the 3D transform]]></description>
			<content:encoded><![CDATA[<!--Final1--><!--step1tif--><p><strong>Create 3D transform effects with CSS and HTML</strong></p>
<p><strong><img class="alignnone size-full wp-image-6895" title="Create 3D transform effects with CSS and HTML" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/Final1.jpg" alt="Create 3D transform effects with CSS and HTML" width="350" height="525" /><br />
</strong></p>
<p><strong>tools | tech | trends:</strong> A web editor, a WebKit-based browser, HTML, CSS3<br />
<strong>expert:</strong> Sam Hampton-Smith<br />
(This article originally appeared in Web Designer issue 179)</p>
<p>You can download the projects files by <a href="http://www.webdesignermag.co.uk/wp-content/uploads/2010/12/3D_Tranformations.zip" target="_blank">clicking here</a></p>
<p>Web designers have all these lovely new HTML5 tags to work with, and a whole raft of additional CSS properties to play with. The result is, or will be, a shift forward in what is possible using standard semantic and accessible markup. The limitations we’ve learnt to overcome are being swept away in a rush of exciting new possibilities<br />
One such innovation is the idea of CSS-based transformations, transitions and animations. The premise is simple – we assign and the browser interpolates between the existing state and the new state in response to an event. So, for example, when you rollover a button a transition might change the colour of the button from red to blue, but instead of flicking between the two, the browser will shift through purple to get there. There’s a stage beyond in the draft CSS3 specification, and it’s operational inside some browsers including Safari: 3D transformations. Here we’re going to create a 3D cube to hold our page content. Each face will contain information, and we’ll add buttons to move between them. The browser will handle the cube’s rotation, leaving us with an effect entirely rendered in HTML and CSS! The full code for the steps can be found in the project files.</p>
<p><strong>01 Open the start document</strong></p>

					<div class="adInPost">
						<script type="text/javascript">
							GA_googleFillSlot("WD_MidPage_MPU1");
						</script>
					</div><p><img class="alignnone size-full wp-image-6885" title="Create 3D transform effects with CSS and HTML" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/step1tif.jpg" alt="Create 3D transform effects with CSS and HTML" width="500" height="799" /></p>
<p>We’ve created a standard page which you’ll find in the project files. In our page, named start.html, we’ve got a container &lt;div&gt;, a “viewport” &lt;div&gt; and three “faces”. We’ve already added some basic styles to our three faces to make each distinct. Note that each of our divs flows one after the other.</p>
<p>001 <em>&lt;div id=”container”&gt;</em><br />
002     <em>&lt;div id=”cube”&gt;</em><br />
003         <em>&lt;div class=”face” id=”face1”&gt;…&lt;/div&gt;</em><br />
004         <em>&lt;div class=”face” id=”face2”&gt;…&lt;div&gt;</em><br />
005         <em>&lt;div&gt;</em><br />
006 <em>&lt;div&gt;</em></p>
<p><strong>02 Set up the viewport</strong><br />
Almost all the work you’ll do will be in the style sheet, so open up screen.css (found in the styles folder). If you’re going to use 3D transitions in WebKit you should define your viewpoint on the scene. We’ll used our container div as the viewport, so find the existing CSS for #container and add the code to set up the perspective and perspective origin.</p>
<p>001 <em>#container {</em><br />
002     <em>position:    relative;</em><br />
003   <em> width:        500px;</em><br />
004     <em>margin:        0;</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesignermag.co.uk/tutorials/3d-transforms-with-css/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Enhanced typography with CSS3 &amp; JavaScript</title>
		<link>http://www.webdesignermag.co.uk/tutorials/enhanced-typography-with-css3-javascript/</link>
		<comments>http://www.webdesignermag.co.uk/tutorials/enhanced-typography-with-css3-javascript/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 10:58:23 +0000</pubDate>
		<dc:creator>Mark Billen</dc:creator>
				<category><![CDATA[Dreamweaver]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Fonts]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[style]]></category>
		<category><![CDATA[Typography]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.webdesignermag.co.uk/?p=6870</guid>
		<description><![CDATA[Say goodbye to the collection of five or so fonts used by every web designer…
]]></description>
			<content:encoded><![CDATA[<!--Final--><!--Step01--><!--google-font-directory--><p><strong>Enhanced typography with CSS3 &amp; JavaScript</strong></p>
<p><strong>tools | tech | trends:</strong> Web editor, jQuery and lettering.js plug-in, Google Fonts<br />
<strong>expert:</strong> Sam Hampton-Smith<br />
(This article first appeared in Web Designer issue 180)</p>
<p>Download the project files by <a href="http://www.webdesignermag.co.uk/wp-content/uploads/2011/01/Advanced_Typography.zip" target="_blank">clicking here</a></p>
<p><img class="alignnone size-full wp-image-6871" title="Enhanced typography with CSS3 & JavaScript" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/Final.jpg" alt="Enhanced typography with CSS3 & JavaScript" width="500" height="579" /></p>
<p>For a medium that was created with text in mind, the web has long suffered from an unnecessary restriction in the fonts available for use. This has led designers, keen to avoid bland look-a-like site designs, to seek workarounds involving images and text replacement tricks. While this has allowed for some really creative solutions and happy accidents, we are finally at a point where we can start to use a richer set of fonts to help communicate our messages.<br />
In this tutorial we look at one method for presenting a passage of text in a visually exciting manner, taking advantage of just two fonts (both outside the traditional web-safe font set) and examine how we can reduce the amount of markup required to create customised typography. We’ll achieve our layout by splitting paragraphs into lines, then using a jQuery plug-in to automatically wrap &lt;span&gt; tags around our text.<br />
Along the way we’ll look at what we can do to maximise visual impact, draw attention to particular key words, and create a coherent typographical poster. We’ll also look at a little bit of jQuery, and finally we’ll take advantage of WebKit transitions to add script-free interactivity to our page. The larger portions of code used here are included in full in the project files.</p>
<p><strong>01 Starting off</strong></p>
<p><img class="alignnone size-full wp-image-6872" title="Enhanced typography with CSS3 & JavaScript" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/Step01.jpg" alt="Enhanced typography with CSS3 & JavaScript" width="500" height="255" /></p>

					<div class="adInPost">
						<script type="text/javascript">
							GA_googleFillSlot("WD_MidPage_MPU1");
						</script>
					</div><p>Open up the start.html file from the CD. We’ve supplied the initial HTML code, and a simple script tag ready for you to insert a few lines of jQuery later on. The first thing you need to do is establish the visual approach you’re going to use. For this tutorial we’ve decided to opt for a typographical poster approach, so no graphics at all – everything will be rendered in HTML and CSS only.</p>
<p><strong>02 Take inspiration</strong><br />
Have a quick browse around the web to see what excites you visually. We found a couple of great looking sites while browsing the lettering js plug-in site (which we’ll use later on). The end result is that we’ve decided to go for a 760px wide design with a graphpaper background. Add the CSS below into a new CSS file, and link to it from the head section of your page.</p>
<p>001 <em>&lt;link rel=”stylesheet” type=”text/css” href=”styles/screen.css” /&gt;</em><br />
002 <em>&#8211;</em><br />
003 <em>body {</em><br />
004 <em>background:    url(pagebg.gif) repeat top left;</em><br />
005 <em>color:    #333;</em><br />
006 <em>}<br />
</em><br />
<strong>03 Hide everything</strong></p>
<p><img class="alignnone size-full wp-image-6873" title="Enhanced typography with CSS3 & JavaScript" src="http://www.webdesignermag.co.uk/wp-content/uploads/2011/07/google-font-directory.jpg" alt="Enhanced typography with CSS3 & JavaScript" width="500" height="626" /></p>
<p>As you’re going to be working on each section, it makes sense to hide the content you haven’t styled, so comment out everything after the &lt;h1&gt; tag. With the rest of the content hidden, it’s easy to see how the text fits together. Start by choosing a nice font to act as the title font for your page. Have a look on Google Fonts (http://code.google.com/webfonts). We’ve chosen Lobster, so add the recommended code at the top of your page, before your CSS file:</p>
<p>001 <em>&lt;link rel=”stylesheet” type=”text/<br />
css” href=”http://fonts.googleapis.com/<br />
css?family=Lobster” /&gt;</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesignermag.co.uk/tutorials/enhanced-typography-with-css3-javascript/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

