<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>SublimeOrange</title>
	
	<link>http://sublimeorange.com</link>
	<description>Hello, I'm Sean a student with a passion for &lt;br&gt;web development.</description>
	<lastBuildDate>Mon, 16 Nov 2009 10:12:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/sublimeorange" /><feedburner:info uri="sublimeorange" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Just a Quick update!</title>
		<link>http://feedproxy.google.com/~r/sublimeorange/~3/pqeYQmr06r0/</link>
		<comments>http://sublimeorange.com/general/just-a-quick-update/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 10:07:34 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[redesign]]></category>

		<guid isPermaLink="false">http://sublimeorange.com/?p=312</guid>
		<description><![CDATA[I&#8217;ve been really busy recently with two site&#8217;s for clients so haven&#8217;t had time to write any posts so hear is a quick update.
I&#8217;ve just released a new webapp. Basically when I&#8217;m developing sites I like to be able to quickly find that tab again so i made this app which you can add a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been really busy recently with two site&#8217;s for clients so haven&#8217;t had time to write any posts so hear is a quick update.</p>
<p>I&#8217;ve just released a new webapp. Basically when I&#8217;m developing sites I like to be able to quickly find that tab again so i made this app which you can add a nice favicon to you site quick and easy in a colour of your choice. If your in a good browser take a quick look up in the address bar I&#8217;m using it on this site.</p>
<p>Check it out and feel free to use it on your site: <a href="http://lnkr.it/iconapp">http://lnkr.it/iconapp</a></p>
<p>Also I&#8217;m thinking about giving this site a redesign soon to give more prominence to my portfolio and tidy up some of my code now i have learn&#8217;t more about wordpress since coding the theme.</p>
<p>So I hope to have more posts soon.</p>
<img src="http://feeds.feedburner.com/~r/sublimeorange/~4/pqeYQmr06r0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sublimeorange.com/general/just-a-quick-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://sublimeorange.com/general/just-a-quick-update/</feedburner:origLink></item>
		<item>
		<title>CSS 3 Inner Shadow</title>
		<link>http://feedproxy.google.com/~r/sublimeorange/~3/-ErC9Yt4SvM/</link>
		<comments>http://sublimeorange.com/css/css3-inner-shadow/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 20:33:27 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[box-shadow]]></category>
		<category><![CDATA[css3]]></category>

		<guid isPermaLink="false">http://sublimeorange.com/?p=254</guid>
		<description><![CDATA[I&#8217;ve seen a good few tutorials on the css3 box-shadow but none about the inner shadow attribute of it, so i thought I&#8217;d show you here.
Here&#8217;s our div with a few basic bits of styling:

.box {
width:150px;
padding:20px;
margin:20px;
}
.box p {
line-height:1em !important;
color:#000000 !important;
font-size:12px !important;
text-align:left !important;
}
.innerShadow {
box-shadow: inset 0 0 10px #000000;
-moz-box-shadow: inset 0 0 10px #000000;
}


Pellentesque habitant morbi [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve seen a good few tutorials on the css3 box-shadow but none about the inner shadow attribute of it, so i thought I&#8217;d show you here.</p>
<p>Here&#8217;s our div with a few basic bits of styling:</p>
<style type="text/css">
.box {
width:150px;
padding:20px;
margin:20px;
}
.box p {
line-height:1em !important;
color:#000000 !important;
font-size:12px !important;
text-align:left !important;
}
.innerShadow {
box-shadow: inset 0 0 10px #000000;
-moz-box-shadow: inset 0 0 10px #000000;
}
</style>
<div class="box">
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>
</div>
<p>Then when we add <code>box-shadow:inset 0 0 10px #000000;</code> to the css it becomes:</p>
<div class="box innerShadow">
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>
</div>
<p>Don&#8217;t forget that this property is only available on Firefox as far as i know but I&#8217;ve included both <code>box-shadow:inset 0 0 10px #000000;</code> and <code>-moz-box-shadow:inset 0 0 10px #000000;</code> in my css to futureproof it for when more browsers support it.</p>
<p>Here is a screen shot for people using other browser&#8217;s than Firefox.</p>
<p><img src="http://sublimeorange.com/uploads/2009/09/innershadow.png" alt="Innershadow" title="Innershadow" /></p>
<p>For more information on this property visit:<br />
<a href="http://www.w3.org/TR/css3-background/#the-box-shadow">http://www.w3.org/TR/css3-background/#the-box-shadow</a></p>
<p>Any comments? Just drop them in the box below.</p>
<img src="http://feeds.feedburner.com/~r/sublimeorange/~4/-ErC9Yt4SvM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sublimeorange.com/css/css3-inner-shadow/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		<feedburner:origLink>http://sublimeorange.com/css/css3-inner-shadow/</feedburner:origLink></item>
		<item>
		<title>CSS3 Speech Bubble</title>
		<link>http://feedproxy.google.com/~r/sublimeorange/~3/sAjIboH0yEA/</link>
		<comments>http://sublimeorange.com/uncategorized/css3-speech-bubble/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 20:58:33 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[bubble]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://sublimeorange.com/?p=233</guid>
		<description><![CDATA[Just to show the concept i decided to make a speech bubble with a little pointer out of only html and css3.

Demo

HTML:

&#60;div class=&#34;bubble&#34;&#62;
	&#60;div class=&#34;pointer&#34;&#62;
		&#60;div class=&#34;one&#34;&#62;&#60;/div&#62;
		&#60;div class=&#34;two&#34;&#62;&#60;/div&#62;
	&#60;/div&#62;
	&#60;div class=&#34;content&#34;&#62;
		&#60;p&#62;Hey do you like this bubble?&#60;/p&#62;
	&#60;/div&#62;
&#60;/div&#62;

CSS:

.bubble {
	width:400px;
	color:#efefef;
}
.bubble .pointer {
	height:15px;
	background:#393939;
}
.bubble .pointer div {
	height:100%;
	background:#ffffff;
}
.bubble .pointer .one {
	width:50%;
	-moz-border-radius-bottomright: 15px;
	-webkit-border-bottom-right-radius:15px;
	float:left;
}
.bubble .pointer .two {
	width:50%;
	float:right;
	-moz-border-radius-bottomleft: 15px;
	-webkit-border-bottom-left-radius:15px;
}
.bubble .content {
	padding:10px;
	-moz-border-radius: 10px;
	-webkit-border-radius:10px;
	background:#393939;
	text-align:center;
}

Demo
]]></description>
			<content:encoded><![CDATA[<p>Just to show the concept i decided to make a speech bubble with a little pointer out of only html and css3.</p>
<p><a href="http://labs.seanhood.co.uk/bubble.html"><img src="http://sublimeorange.com/uploads/2009/09/bubble.png" alt="Bubble"/></a></p>
<p><a href="http://labs.seanhood.co.uk/bubble.html">Demo</a></p>
<p><span id="more-233"></span></p>
<p>HTML:</p>
<p><code>
<pre>&lt;div class=&quot;bubble&quot;&gt;
	&lt;div class=&quot;pointer&quot;&gt;
		&lt;div class=&quot;one&quot;&gt;&lt;/div&gt;
		&lt;div class=&quot;two&quot;&gt;&lt;/div&gt;
	&lt;/div&gt;
	&lt;div class=&quot;content&quot;&gt;
		&lt;p&gt;Hey do you like this bubble?&lt;/p&gt;
	&lt;/div&gt;
&lt;/div&gt;</pre>
<p></code></p>
<p>CSS:</p>
<p><code>
<pre>.bubble {
	width:400px;
	color:#efefef;
}
.bubble .pointer {
	height:15px;
	background:#393939;
}
.bubble .pointer div {
	height:100%;
	background:#ffffff;
}
.bubble .pointer .one {
	width:50%;
	-moz-border-radius-bottomright: 15px;
	-webkit-border-bottom-right-radius:15px;
	float:left;
}
.bubble .pointer .two {
	width:50%;
	float:right;
	-moz-border-radius-bottomleft: 15px;
	-webkit-border-bottom-left-radius:15px;
}
.bubble .content {
	padding:10px;
	-moz-border-radius: 10px;
	-webkit-border-radius:10px;
	background:#393939;
	text-align:center;
}</pre>
<p></code></p>
<p><a href="http://labs.seanhood.co.uk/bubble.html">Demo</a></p>
<img src="http://feeds.feedburner.com/~r/sublimeorange/~4/sAjIboH0yEA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sublimeorange.com/uncategorized/css3-speech-bubble/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		<feedburner:origLink>http://sublimeorange.com/uncategorized/css3-speech-bubble/</feedburner:origLink></item>
		<item>
		<title>Magazine Layout</title>
		<link>http://feedproxy.google.com/~r/sublimeorange/~3/NYVCLWv7Txs/</link>
		<comments>http://sublimeorange.com/css/magazine-layout/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 01:41:28 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[magazine]]></category>

		<guid isPermaLink="false">http://sublimeorange.com/?p=180</guid>
		<description><![CDATA[I&#8217;ve taken this idea from an episode of from the couch (#170) and turned it into code.
Demo Download the files.

Basic HTML:
&#60;div id="wrapper"&#62;
&#60;div  class="articles"&#62;
&#60;article&#62;

&#60;!-- Large text --&#62;
&#60;header&#62;
&#60;h2&#62;Design should never say, “Look at me.”
It should always say, “Look at this.”&#60;/h2&#62;
&#60;/header&#62;

&#60;!-- Columned Paragraphs --&#62;
&#60;section&#62;
&#60;p&#62;Pellentesque habitant morbi...&#60;/p&#62;
&#60;!-- Paragraphs here --&#62;
&#60;/section&#62;

&#60;/article&#62;
&#60;/div&#62;
&#60;/div&#62;
CSS:
#wrapper {
	width: 1080px;
	margin:0 auto;
}
.articles article {
	margin:2em 0;
	color:#222222;
	clear:both;
}
.articles article header [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve taken this idea from an episode of <a href="http://www.from-the-couch.com/post.cfm/title/episode-170--magazines-css-rants">from the couch (#170)</a> and turned it into code.</p>
<p><a href="http://labs.seanhood.co.uk/magazine/">Demo</a> <a href="http://sublimeorange.com/uploads/2009/09/magazine_1.0.zip">Download the files.</a></p>
<p><a href="http://labs.seanhood.co.uk/magazine/"><img title="Magazine Layout" src="http://sublimeorange.com/uploads/2009/09/magazine_layout2-520x283.png" alt="Magazine Layout" /></a><span id="more-180"></span></p>
<p>Basic HTML:</p>
<pre><code>&lt;div id="wrapper"&gt;
&lt;div  class="articles"&gt;
&lt;article&gt;

&lt;!-- Large text --&gt;
&lt;header&gt;
&lt;h2&gt;Design should never say, “Look at me.”
It should always say, “Look at this.”&lt;/h2&gt;
&lt;/header&gt;

&lt;!-- Columned Paragraphs --&gt;
&lt;section&gt;
&lt;p&gt;Pellentesque habitant morbi...&lt;/p&gt;
&lt;!-- Paragraphs here --&gt;
&lt;/section&gt;

&lt;/article&gt;
&lt;/div&gt;
&lt;/div&gt;</code></pre>
<p>CSS:</p>
<pre><code>#wrapper {
	width: 1080px;
	margin:0 auto;
}
.articles article {
	margin:2em 0;
	color:#222222;
	clear:both;
}
.articles article header {
	width:450px;
	float:left;
}
.articles article header h2 {
	font-size: 5em;
	font-family:Georgia, "Times New Roman", Times, serif;
	text-align:right;
	letter-spacing:-5px;
}
.articles article header h2:first-line {
	font-size:1.5em;
}
.articles article .words {
	float:right;
	width:600px;
	margin:2.5em 0 0;
	line-height:1.5;
	-moz-column-count: 3;
	-moz-column-gap:1.5em;
	-webkit-column-count: 3;
	-webkit-column-gap:1.5em;
	text-align:justify;
}
.articles article .words p {
	margin-bottom:10px;
}</code></pre>
<p><a href="http://labs.seanhood.co.uk/magazine/">Demo</a> <a href="http://sublimeorange.com/uploads/2009/09/magazine_1.0.zip">Download the files.</a></p>
<img src="http://feeds.feedburner.com/~r/sublimeorange/~4/NYVCLWv7Txs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sublimeorange.com/css/magazine-layout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://sublimeorange.com/css/magazine-layout/</feedburner:origLink></item>
		<item>
		<title>Tweetify</title>
		<link>http://feedproxy.google.com/~r/sublimeorange/~3/9zVxXg-IVx4/</link>
		<comments>http://sublimeorange.com/jquery/tweetify/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 22:19:45 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://sublimeorange.com/?p=154</guid>
		<description><![CDATA[This is David Walsh&#8217;s String.Tweetify in jQuery.
$.fn.tweetify = function() {
	this.each(function() {
		$(this).html(
			$(this).html()
				.replace(/((ftp&#124;http&#124;https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/&#124;\/([\w#!:.?+=&#038;%@!\-\/]))?)/gi,'$1')
				.replace(/(^&#124;\s)#(\w+)/g,'$1#$2')
				.replace(/(^&#124;\s)@(\w+)/g,'$1@$2')
		);
	});
	return $(this);
}

$("p").tweetify();

Before:
&#60;p&#62;@seanhood have you seen this http://icanhascheezburger.com/ #lol&#60;/p&#62;

After:
&#60;p&#62;&#60;a href="http://twitter.com/seanhood"&#62;@seanhood&#60;/a&#62; have you seen this
&#60;a href="http://icanhascheezburger.com/"&#62;http://icanhascheezburger.com/&#60;/a&#62;
&#60;a href="http://search.twitter.com/search?q=%23lol"&#62;#lol&#60;/a&#62;&#60;/p&#62;

Demo
]]></description>
			<content:encoded><![CDATA[<p>This is David Walsh&#8217;s <a href="http://davidwalsh.name/tweetify">String.Tweetify</a> in jQuery.</p>
<pre><code>$.fn.tweetify = function() {
	this.each(function() {
		$(this).html(
			$(this).html()
				.replace(/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&#038;%@!\-\/]))?)/gi,'<a href="$1">$1</a>')
				.replace(/(^|\s)#(\w+)/g,'$1<a href="http://search.twitter.com/search?q=%23$2">#$2</a>')
				.replace(/(^|\s)@(\w+)/g,'$1<a href="http://twitter.com/$2">@$2</a>')
		);
	});
	return $(this);
}

$("p").tweetify();

Before:
&lt;p&gt;@seanhood have you seen this http://icanhascheezburger.com/ #lol&lt;/p&gt;

After:
&lt;p&gt;&lt;a href="http://twitter.com/seanhood"&gt;@seanhood&lt;/a&gt; have you seen this
&lt;a href="http://icanhascheezburger.com/"&gt;http://icanhascheezburger.com/&lt;/a&gt;
&lt;a href="http://search.twitter.com/search?q=%23lol"&gt;#lol&lt;/a&gt;&lt;/p&gt;
</code></pre>
<p><a href='http://sublimeorange.com/uploads/2009/09/tweetify.html'>Demo</a></p>
<img src="http://feeds.feedburner.com/~r/sublimeorange/~4/9zVxXg-IVx4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sublimeorange.com/jquery/tweetify/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://sublimeorange.com/jquery/tweetify/</feedburner:origLink></item>
		<item>
		<title>From The Couch Inspired Wallpaper’s</title>
		<link>http://feedproxy.google.com/~r/sublimeorange/~3/47mbcD7sPPU/</link>
		<comments>http://sublimeorange.com/design/from-the-couch-inspired-wallpapers/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 21:06:56 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Awesome]]></category>
		<category><![CDATA[Wallpaper]]></category>

		<guid isPermaLink="false">http://sublimeorange.com/?p=139</guid>
		<description><![CDATA[These guys are awesome so i made a wallpaper based on the colours at the start of some of their videos

1280&#215;1024
1280&#215;800
iPhone (320&#215;480)
]]></description>
			<content:encoded><![CDATA[<p>These guys are awesome so i made a wallpaper based on the colours at the start of some of their videos</p>
<p><img alt="" src="http://farm3.static.flickr.com/2442/3799143495_1a4ae5db3c.jpg" title="From The Couch" class="alignnone" width="500" height="400" /></p>
<p><a href="http://www.flickr.com/photos/sean2k8/3799143495/">1280&#215;1024</a><br />
<a href="http://www.flickr.com/photos/sean2k8/3807313504/">1280&#215;800</a><br />
<a href="http://www.flickr.com/photos/sean2k8/3800368389/">iPhone (320&#215;480)</a></p>
<img src="http://feeds.feedburner.com/~r/sublimeorange/~4/47mbcD7sPPU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sublimeorange.com/design/from-the-couch-inspired-wallpapers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://sublimeorange.com/design/from-the-couch-inspired-wallpapers/</feedburner:origLink></item>
		<item>
		<title>Split a name with PHP</title>
		<link>http://feedproxy.google.com/~r/sublimeorange/~3/xplHO6sCywc/</link>
		<comments>http://sublimeorange.com/php/split-a-name-with-php/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 23:28:09 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[split]]></category>

		<guid isPermaLink="false">http://sublimeorange.com/?p=106</guid>
		<description><![CDATA[I was recently looking for a way to clean up the sign up form for a project I&#8217;m working on. I realised I could merge the First name and Last name fields on the form but I needed a way to split the name up afterwards. So after a quick &#8220;Google&#8221; I came up with [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently looking for a way to clean up the sign up form for a project I&#8217;m working on. I realised I could merge the First name and Last name fields on the form but I needed a way to split the name up afterwards. So after a quick &#8220;Google&#8221; I came up with a way. The code below splits the name at the first space.</p>
<p><strong>Input:</strong> John S Smith<br />
<strong>Output:</strong> First Name: John Last Name: S Smith</p>
<pre><code>// PHP

$name = "John S Smith";

list($fname, $lname) = split(' ', $name,2);

echo "First Name: $fname, Last Name: $lname";
</code></pre>
<img src="http://feeds.feedburner.com/~r/sublimeorange/~4/xplHO6sCywc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sublimeorange.com/php/split-a-name-with-php/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://sublimeorange.com/php/split-a-name-with-php/</feedburner:origLink></item>
		<item>
		<title>New Snippets Category</title>
		<link>http://feedproxy.google.com/~r/sublimeorange/~3/VVORgOvMkAI/</link>
		<comments>http://sublimeorange.com/general/new-snippets-category/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 02:01:45 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[freebies]]></category>
		<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://sublimeorange.com/?p=100</guid>
		<description><![CDATA[I will soon be creating a new category that I will post snippets of code &#38; website elements that you can use in your own website&#8217;s. This will include my Accordion Lightbox gallery and the &#8220;Load More&#8221; script i ported to PHP.
]]></description>
			<content:encoded><![CDATA[<p>I will soon be creating a new category that I will post snippets of code &amp; website elements that you can use in your own website&#8217;s. This will include my <a href="http://accordion.seanhood.co.uk/">Accordion Lightbox</a> gallery and the <a href="http://dev.seanhood.co.uk/scrollLoad/">&#8220;Load More&#8221; script</a> i ported to PHP.</p>
<img src="http://feeds.feedburner.com/~r/sublimeorange/~4/VVORgOvMkAI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sublimeorange.com/general/new-snippets-category/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://sublimeorange.com/general/new-snippets-category/</feedburner:origLink></item>
		<item>
		<title>Better CSS Navigation Styling</title>
		<link>http://feedproxy.google.com/~r/sublimeorange/~3/i_fhmaCkxaM/</link>
		<comments>http://sublimeorange.com/css/better-css-navigation-styling/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 00:14:09 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://sublimeorange.com/blog/?p=49</guid>
		<description><![CDATA[When visiting other websites I quite like to have a peek in the code to see how the developers make the sites look how they look.
One of the things I&#8217;ve had trouble with in the past is horizontal navigation menus, more precisely the styling side of things and how the HTML should be for content [...]]]></description>
			<content:encoded><![CDATA[<p>When visiting other websites I quite like to have a peek in the code to see how the developers make the sites look how they look.</p>
<p>One of the things I&#8217;ve had trouble with in the past is horizontal navigation menus, more precisely the styling side of things and how the HTML should be for content and the CSS for the presentation.<br />
<span id="more-49"></span><br />
What I&#8217;m trying to get at is in these sites most of them have a header navigation like this</p>
<blockquote><p>MenuItem 1 | MenuItem 2 | MenuItem 3</p></blockquote>
<p>And these menus are normally coded like this</p>
<pre><code>&lt;ul&gt;
&lt;li&gt;&lt;a href="page_1.html"&gt;MenuItem 1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;|&lt;/li&gt;
&lt;li&gt;&lt;a href="page_2.html"&gt;MenuItem 2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;|&lt;/li&gt;
&lt;li&gt;&lt;a href="page_3.html"&gt;MenuItem 3&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</code></pre>
<p>And styled like this</p>
<pre><code>ul li {
padding: 0 5px;
}</code></pre>
<p>With a menu like this its not separating the content from the presentation, so what I came up with for this blog is to use CSS&#8217;s pseudo classes to add the &#8220;|&#8221; to the end of each menu item then remove the last one.</p>
<p>The HTML for this method keeps the code clean and the style separate</p>
<pre><code>&lt;ul&gt;
&lt;li&gt;&lt;a href="page_1.html"&gt;MenuItem 1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="page_2.html"&gt;MenuItem 2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="page_3.html"&gt;MenuItem 3&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</code></pre>
<p>The style in this method is as follows</p>
<pre><code>ul li {
list-style:none;
display:inline;
float:left;
margin:0 5px 0 0;
}

ul li:after {
content:"|";
margin:0 0 0 5px;
}

ul li:last-child:after {
content:"";
}</code></pre>
<p>The first bit <code>ul li</code> is the basic CSS to make the navigation menu horizontal, I&#8217;ll get back to the margins at the end.</p>
<p>The <code>ul li:after</code> section selects each <code>ul li</code> element and puts a &#8220;|&#8221; after it this results in a menu like this</p>
<blockquote><p>MenuItem 1 | MenuItem 2 | MenuItem 3 |</p></blockquote>
<p>Which you may have noticed there is a &#8220;|&#8221; at the end of the last menu item.</p>
<p>This is where the last part of the CSS comes in</p>
<pre><code>ul li:last-child:after {
content:"";
}</code></pre>
<p>This selects the last child <code>&lt;li&gt;&lt;a href="page_3.html"&gt;MenuItem 3&lt;/a&gt;&lt;/li&gt;</code> and removes the &#8220;|&#8221; after it, resulting in a nice horizontal navigation that separates the styling from the content.</p>
<p>Now margins, I originally had the margins like this</p>
<pre><code>ul li:after {
content:"|";
margin:0 5px 0 5px;
}</code></pre>
<p>but with them only on the <code>:after</code> pseudo element I had problems with there being no gaps between each menu item and the &#8220;|&#8221; when I tested it in IE where it doesn&#8217;t understand most pseudo elements so I had give the <code>ul li</code> a 5px right margin and the <code>ul li:after</code> element a 5px left margin to keep IE happy and for it to look the same in modern browsers.</p>
<img src="http://feeds.feedburner.com/~r/sublimeorange/~4/i_fhmaCkxaM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sublimeorange.com/css/better-css-navigation-styling/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		<feedburner:origLink>http://sublimeorange.com/css/better-css-navigation-styling/</feedburner:origLink></item>
		<item>
		<title>This blog uses HTML5</title>
		<link>http://feedproxy.google.com/~r/sublimeorange/~3/feYBMEGWnEQ/</link>
		<comments>http://sublimeorange.com/html/this-blog-uses-html5/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 23:37:43 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://sublimeorange.com/blog/?p=33</guid>
		<description><![CDATA[See for yourself
view-source:http://sublimeorange.com/
Sites that helped me:

http://www.alistapart.com/articles/previewofhtml5
 http://html5gallery.com/
http://html5doctor.com/

Update:

HTML 5 Pocket Book
HTML 5 Validator

]]></description>
			<content:encoded><![CDATA[<p>See for yourself</p>
<p><a href="view-source:http://sublimeorange.com/">view-source:http://sublimeorange.com/</a></p>
<p>Sites that helped me:</p>
<ul>
<li><a href="http://www.alistapart.com/articles/previewofhtml5">http://www.alistapart.com/articles/previewofhtml5</a></li>
<li><a href="http://html5gallery.com/"> http://html5gallery.com/</a></li>
<li><a href="http://html5doctor.com/">http://html5doctor.com/</a></li>
</ul>
<p>Update:</p>
<ul>
<li><a href="http://adactio.com/extras/pocketbooks/html5/">HTML 5 Pocket Book</a></li>
<li><a href="http://html5.validator.nu/">HTML 5 Validator</a></li>
</ul>
<img src="http://feeds.feedburner.com/~r/sublimeorange/~4/feYBMEGWnEQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sublimeorange.com/html/this-blog-uses-html5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://sublimeorange.com/html/this-blog-uses-html5/</feedburner:origLink></item>
	</channel>
</rss><!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
