<?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>dtsn &#187; CSS/HTML</title>
	<atom:link href="http://dtsn.co.uk/category/csshtml/feed/" rel="self" type="application/rss+xml" />
	<link>http://dtsn.co.uk</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Tue, 17 Aug 2010 13:18:57 +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>Styling Odd and Even Elements in CSS</title>
		<link>http://dtsn.co.uk/2010/08/17/styling-odd-and-even-elements-in-css/</link>
		<comments>http://dtsn.co.uk/2010/08/17/styling-odd-and-even-elements-in-css/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 13:13:34 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[CSS/HTML]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Selectors]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=800</guid>
		<description><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<br />
				<br />
			
		</div>
<p>A part of CSS3 are a&#8230;</p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdtsn.co.uk%2F2010%2F08%2F17%2Fstyling-odd-and-even-elements-in-css%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdtsn.co.uk%2F2010%2F08%2F17%2Fstyling-odd-and-even-elements-in-css%2F&amp;source=dtsn&amp;style=normal&amp;service=is.gd&amp;hashtags=CSS3,Selectors" height="61" width="50" /><br />
			</a>
		</div>
<p>A part of CSS3 are a fantastic new range of selectors, these include the <code>;nth-child</code> sudo class. These allow you to style the nth child of a parent element. Therefore you can easily style the odd:</p>
<pre class="css" name="code">tr:nth-child(odd)</pre>
<p>or even elements:</p>
<pre class="css" name="code">tr:nth-child(even)</pre>
<p>For example this is my table where I have styled each even row:</p>
<style type="text/css">
.example tr:nth-child(even) { background: #DCDCDC; }
</style>
<table class="example">
<tr>
<td>Example Data 1</td>
<td>Example Data 2</td>
</tr>
<tr>
<td>Example Data 3</td>
<td>Example Data 4</td>
</tr>
<tr>
<td>Example Data 5</td>
<td>Example Data 6</td>
</tr>
<tr>
<td>Example Data 7</td>
<td>Example Data 8</td>
</tr>
</table>
<p>You can find more information on this on the <a href="http://www.w3.org/TR/css3-selectors/#structural-pseudos">W3C CSS3 Selectors</a> page.</p>
]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2010/08/17/styling-odd-and-even-elements-in-css/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Link Prefetching</title>
		<link>http://dtsn.co.uk/2010/06/04/link-prefetching/</link>
		<comments>http://dtsn.co.uk/2010/06/04/link-prefetching/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 09:46:59 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[CSS/HTML]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=775</guid>
		<description><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<br />
				<br />
			
		</div>
<p>Link prefetching is a very little&#8230;</p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdtsn.co.uk%2F2010%2F06%2F04%2Flink-prefetching%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdtsn.co.uk%2F2010%2F06%2F04%2Flink-prefetching%2F&amp;source=dtsn&amp;style=normal&amp;service=is.gd" height="61" width="50" /><br />
			</a>
		</div>
<p>Link prefetching is a very little known HTML 5 tag which is currently only supported by Firefox. It utilizes browser idle time to download documents that the user might visit in the near future.</p>
<p>For example:</p>
<pre class="html">&lt;link rel=&quot;prefetch&quot; href=&quot;page2.html&quot;&gt;
</pre>
<p>Once the user has loaded up that page the next page (page2.html) will being loading significantly decreasing the time it takes to visit the next page. </p>
<p>It&#8217;s a great idea really, and because it&#8217;s gracefully degregating it means that users in FF will get the benefit while everyone else wouldn&#8217;t see the difference. Refer to the <a href="https://developer.mozilla.org/en/link_prefetching_faq">Mozilla FAQ</a> for more information.</p>
<p>(via <a href="http://keyboardy.com/programming/html5-link-prefetching/">Keyboardy</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2010/06/04/link-prefetching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The 61px Standard</title>
		<link>http://dtsn.co.uk/2010/04/18/61px-standard/</link>
		<comments>http://dtsn.co.uk/2010/04/18/61px-standard/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 15:31:45 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[CSS/HTML]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[dtsn]]></category>
		<category><![CDATA[61px]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[retweet button]]></category>
		<category><![CDATA[social media]]></category>
		<category><![CDATA[tweetmeme]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=767</guid>
		<description><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<br />
				<br />
			
		</div>
<p>The TweetMeme button is one of&#8230;</p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdtsn.co.uk%2F2010%2F04%2F18%2F61px-standard%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdtsn.co.uk%2F2010%2F04%2F18%2F61px-standard%2F&amp;source=dtsn&amp;style=normal&amp;service=is.gd&amp;hashtags=61px,button,retweet+button,social+media,tweetmeme,Twitter" height="61" width="50" /><br />
			</a>
		</div>
<p>The <a href="http://tweetmeme.com">TweetMeme</a> button is one of the most successful social media buttons, it is served to millions of websites around the web. One of the more unusual points about the TweetMeme button is it’s height, 61px. This height has now been adopted by <a href="http://facebook.com">facebook </a>and <a href="http://digg.com">digg</a>.</p>
<h2>Why 61px?</h2>
<blockquote><p>“Cause everyone knows that 61 pixels is such a normal dimension in the world of social networking &#8211; I mean everything&#8217;s 61 pixels, right? Cause it&#8217;s&#8230;a prime number!”</p>
<p>- <a href="http://twittown.com/social-networks/twitter/twitter-blog/facebook-share-badge-vs-tweetmeme-retweet-badge-side-side">Twittown</a></p></blockquote>
<p>I would like to say that it was due to lots of research and investigation, but it was more of a accident. The button was originally designed to be 60px high but in the quest to fit an extra digit onto the button the font size was decreased and the button height was increased to 61px.</p>
<h2>The Standard</h2>
<p>The TweetMeme button had a massive adoption rate, and was installed on millions of sites across the web therefore it became the one to beat! Large sites have now put pressure on the other social media sites to produce their buttons to the new standard. Therefore the 61px standard (if you have a better name let me know) is now the default for all social media buttons on the internet.</p>
]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2010/04/18/61px-standard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Tips</title>
		<link>http://dtsn.co.uk/2010/01/05/css-tips/</link>
		<comments>http://dtsn.co.uk/2010/01/05/css-tips/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 12:01:00 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[CSS/HTML]]></category>
		<category><![CDATA[browser support]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[grids]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=694</guid>
		<description><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<br />
				<br />
			
		</div>
<p>I thought I’d share some of&#8230;</p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdtsn.co.uk%2F2010%2F01%2F05%2Fcss-tips%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdtsn.co.uk%2F2010%2F01%2F05%2Fcss-tips%2F&amp;source=dtsn&amp;style=normal&amp;service=is.gd&amp;hashtags=browser+support,CSS,grids,HTML,Tips,validation" height="61" width="50" /><br />
			</a>
		</div>
<p>I thought I’d share some of my CSS habits/top tips, some of my habits may be more controversial than others, but it’s always good to share.</p>
<p><span id="more-694"></span><br />
<h2>Looking Pretty</h2>
<p>Always remember to format your CSS nicely. Most CSS coders are designers, and love to make things look pretty, which also makes the CSS easier to read.</p>
<p><strong>One line CSS declarations</strong> &#8211; I always put my entire declaration onto one line, it makes declarations a lot easier to find, and even better if you keep your properties in alphabetical order.</p>
<p><strong>Use Shorthand</strong> &#8211; My rule is that if you are setting any more than one property use shorthand, here’s a clue to what I mean:</p>
<pre class="css" name="code">/* You could right */
.dummy {
   margin-top: 10px;
   margin-bottom: 10px;
}
/* but what's the point when this exists */
.dummy { margin: 10px 0px; }
/* or even */
.dummy { background: url('myimage.jpg') blue no-repeat left top; }</pre>
<p><strong>Shortcuts</strong> &#8211; When your CSS file becomes massive instead of splitting the file up into manageable chucks, which causes unnecessary hits on your server, just split the file with comments. If you use a wild card character like @ you can easily search for specific sections.</p>
<h2>Make things easy</h2>
<p>CSS is tricky, so use tools to make it easier.</p>
<p><strong>Grids</strong> &#8211; While I am still debating whether grids are appropriate for smaller scale projects, if you use a wide variety of different layout, or are having trouble with the compatibility of your current layout take a look at CSS grids, there are loads available such as <a href="http://code.google.com/p/blueprintcss/">Blueprint</a> and the <a href="http://developer.yahoo.com/yui/grids/">Yahoo UI</a>.</p>
<p><strong>Check</strong> &#8211; Always validate your code, i personally run mine through <a href="http://www.microsoft.com/expression/">Microsoft Expression Web</a> which checks for bugs, you can also use the <a href="http://jigsaw.w3.org/css-validator/">W3C Validation Checker</a>.</p>
<p><a href="http://jigsaw.w3.org/css-validator/"><img title="opps" alt="" src="http://www.dtsn.co.uk/wp-content/uploads/2008/05/opps1.jpg" /></a></p>
<p><em>W3C CSS Validation Checker</em></p>
<p><strong>Avoid using too many selectors</strong> &#8211; Just specify the minimum number of selectors needed. A td always appears within a tr which always appears within a table. If you find yourself nesting your selectors like the example below, you are probably being too verbose.</p>
<pre class="css" name="code">table tr td {...}
/* is the same as */
td {...}</pre>
<h2>Points, they all add up</h2>
<p>Don’t forget that all the different selectors have a different weighting (also known as <strong>specificity</strong>), and the ordering of your selectors will affect which one has president.</p>
<blockquote>
<p>A selector&#8217;s specificity is calculated as follows:</p>
<ul>
<li>count 1 if the declaration is from is a &#8217;style&#8217; attribute rather than a rule with a selector, 0 otherwise (= a) (In HTML, values of an element&#8217;s &quot;style&quot; attribute are style sheet rules. These rules have no selectors, so a=1, b=0, c=0, and d=0.) </li>
<li>count the number of ID attributes in the selector (= b) </li>
<li>count the number of other attributes and pseudo-classes in the selector (= c) </li>
<li>count the number of element names and pseudo-elements in the selector (= d) </li>
</ul>
<p>The specificity is based only on the form of the selector. In particular, a selector of the form &quot;[id=p33]&quot; is counted as an attribute selector (a=0, b=0, c=1, d=0), even if the id attribute is defined as an &quot;ID&quot; in the source document&#8217;s DTD. </p>
<p>Concatenating the four numbers a-b-c-d (in a number system with a large base) gives the specificity. </p>
</blockquote>
<p>- Taken from the <a href="http://www.w3.org/TR/CSS21/cascade.html">W3C specification</a></p>
<h2>Browser Support</h2>
<p>Avoid supporting anything but the most recent browsers. I don’t know anyone who use IE5 anymore do you? Also stop uses hacks for IE6, some careful rethinking and workarounds could be explored before resulting to using hacks. With the less hacks the more you can avoid having a separate style sheet for each browser. If you look at <a href="http://wikipedia.com">Wikipedia</a> in source view you will see they have a separate style sheet for IE5, IE5.5, IE6, IE7.</p>
<h2>Set things up</h2>
<p>Spending a couple of minutes at the start of the project setting up all your colours and classes could save you hours in the long run.</p>
<p><strong>Utilities</strong> &#8211; Build a set of CSS utilities which you could use everywhere. E.g.</p>
<pre class="css" name="code">.left { float:left; }
.right { float: right; }
.overflow { overflow: hidden; }
.clear { clear: both; }
.pad { padding: 10px; }</pre>
<p><strong>Define your colours</strong> &#8211; Define your commonly used colours at the start of the stylesheet then you will always know where they are for easy reference.</p>
<h2>Keep Things Simple</h2>
<p>Always go back and try and make your code simpler, and remember to comment everything. This make it easier to find changes and edit them. There is no need to get any more complicated than you need to be. For some more tips check out <a href="http://smashingmagazine.com">Smashing Magazine</a> who have a great article on <a href="http://www.smashingmagazine.com/2007/05/10/70-expert-ideas-for-better-css-coding/">CSS ideas</a>.</p>
<h2>More Resources</h2>
<p><a title="http://www.w3.org/Style/Examples/007/" href="http://www.w3.org/Style/Examples/007/">W3C Tricks &amp; Tips</a></p>
<p><a title="http://www.hongkiat.com/blog/20-useful-css-tips-for-beginners/" href="http://www.hongkiat.com/blog/20-useful-css-tips-for-beginners/">20 Useful CSS Tips for Beginners</a></p>
<p><a title="http://snook.ca/archives/html_and_css/top_css_tips/" href="http://snook.ca/archives/html_and_css/top_css_tips/">Top CSS Tips (snooka)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2010/01/05/css-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS3 Selectors :last-child</title>
		<link>http://dtsn.co.uk/2009/12/15/css3-selectors-last-child/</link>
		<comments>http://dtsn.co.uk/2009/12/15/css3-selectors-last-child/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 12:00:13 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[CSS/HTML]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[last-child]]></category>
		<category><![CDATA[Selectors]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=696</guid>
		<description><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<br />
				<br />
			
		</div>
<p>Of all the CSS3 selectors the&#8230;</p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdtsn.co.uk%2F2009%2F12%2F15%2Fcss3-selectors-last-child%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdtsn.co.uk%2F2009%2F12%2F15%2Fcss3-selectors-last-child%2F&amp;source=dtsn&amp;style=normal&amp;service=is.gd&amp;hashtags=CSS,CSS3,last-child,Selectors" height="61" width="50" /><br />
			</a>
		</div>
<p>Of all the <a href="http://web.archive.org/web/20080503011837/http://www.w3.org/TR/css3-selectors/">CSS3 selectors</a> the structural pseudo-classes have to be my favourite. In particular I love :last-child selector, the :last-child CSS selector is incredibly powerful especially when positioning elements in a row, I am currently finding it incredibly useful when doing menus. Instead of providing a last class on the very last element in the row, you can now use pure CSS to achieve the same effect.</p>
<h2>CSS 2.1</h2>
<pre class="css" name="code">/*Each Element*
.image { margin-right: 5px; height: 20px; width: 20px; float:left; background-color: red; }
/* remove the margin on the last element so it lines up
.image.last { margin-right: 0px; }</pre>
<h2>CSS 3</h2>
<pre class="css" name="code">/* parent of the image element */
.parent div:last-child { margin-right: 0px; }</pre>
<h2>The Downside</h2>
<p>Unfortunately the bad aspect of this selector is that it does not fail gracefully. Meaning that a user in a none CSS3 compliant browser, <strong>(IE)</strong>, it would fail horribly, this means that everything will be out of line.</p>
<h2>Example</h2>
<p>If you look at this in anything but a browser which supports CSS3 the last element will be on the next line.</p>
<style type="text/css">
.example { margin-right: 6px; height: 20px; width: 75px; float:left; background-color: #317b9e; }
.example-block { overflow: hidden; margin-bottom: 10px; }
.example-block div:last-child { margin-right: 0px; }</style>
<div class="example-block">
<div class="example"></div>
<div class="example"></div>
<div class="example"></div>
<div class="example"></div>
<div class="example"></div>
<div class="example"></div>
</div>
<h2>More Resources</h2>
<ol>
<li><a href="http://www.w3.org/TR/css3-selectors/">W3C Selectors Level 3</a></li>
<li><a href="http://www.css3.info/modules/selector-compat/">CSS3 Compatibility Table</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/cc351024%28VS.85%29.aspx">MSDN Compatibility Table (tells you what works in IE8)</a></li>
<li><a href="http://www.smashingmagazine.com/2009/06/15/take-your-design-to-the-next-level-with-css3/">Take Your Design To The Next Level With CSS3</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2009/12/15/css3-selectors-last-child/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How Would I Improve Twitter’s UI</title>
		<link>http://dtsn.co.uk/2009/12/03/how-would-i-improve-twitters-ui/</link>
		<comments>http://dtsn.co.uk/2009/12/03/how-would-i-improve-twitters-ui/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 10:00:00 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[CSS/HTML]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[UX]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=633</guid>
		<description><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<br />
				<br />
			
		</div>
<p>Twitter is quickly gathering pace and&#8230;</p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdtsn.co.uk%2F2009%2F12%2F03%2Fhow-would-i-improve-twitters-ui%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdtsn.co.uk%2F2009%2F12%2F03%2Fhow-would-i-improve-twitters-ui%2F&amp;source=dtsn&amp;style=normal&amp;service=is.gd&amp;hashtags=Twitter,UI,UX" height="61" width="50" /><br />
			</a>
		</div>
<p>Twitter is quickly gathering pace and is fast becoming one of the most popular social networks. I have been using Twitter for nearly 2 years, mostly through their use of 3rd part applications like <a href="http://www.tweetdeck.com">TweetDeck</a> or <a href="http://www.atebits.com/tweetie-mac/">Tweetie</a>. I thought to myself why do I, and many other ‘power’ Twitter users not use the web interface? So here are some of my suggestions on how I would improve the Twitter UI.</p>
<p><a href="http://dtsn.co.uk/wp-uploads/2009/11/twitter-home.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="twitter_-_home" border="0" alt="twitter_-_home" src="http://dtsn.co.uk/wp-uploads/2009/11/twitter-home-thumb.png" width="480" height="479" /></a></p>
<p><em>Twitter home page design at the time of writing the article, including some reference points.</em></p>
<p>I will be focusing on a number of parts of the home page, the main ‘tweet box’, the implementation of the ‘lists’ area, how the data is presented and the integration with search. This is not meant as a critique of Twitter, but more as some helpful suggestions on usability.</p>
<h2>Tweet Box</h2>
<p>For lack of a better word, the tweebox is the textarea located at the top of the twitter homepage. I would really love to see it improved in a number of really simple ways:</p>
<ul>
<li>The ability to press enter to submit a tweet. Tweets aren’t multi lined and there is nothing else to do so why not make enter submit the form instead of press the button. Twitter has this problem in a number of other area’s as well, OAuth screen! </li>
<li>Autocomplete the usernames in the textbox.</li>
<li>Auto shortening. Twitter has already partly done this for really long links, but it would be nice if you could have the option to do it on the shorter links as well. </li>
</ul>
<h2>Page improvements</h2>
<p>The live update of tweets, you know the little yellow box which tells you how many are waiting, is a fantastic addition. But I think they are missing the key points, why wouldn’t you show the tweet? I just find it really annoying.</p>
<p>The page is currently geared up to just tweeting. Users probably use the Twitter interface more to manage their tweets and accounts, maybe the front page should be geared in that direction.</p>
<h2>Other</h2>
<p>The lists nor retweets seem to be fully integrated into the UI they just appear to be something strapped onto the edge. It would be great if you could, for example, have tabs across your timeline which listed your most popular lists.</p>
<p>It would be great to hear your thoughts on how you would make twitter better, you never know maybe Twitter is reading this.</p>
<h2>Better Twitter</h2>
<p>Hopefully my recently released Firefox plugin <a href="http://dtsn.co.uk/2009/12/01/better_twitter/">Better Twitter</a> will solve most of these issues.</p>
]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2009/12/03/how-would-i-improve-twitters-ui/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JavaScript Halloween Effects</title>
		<link>http://dtsn.co.uk/2008/10/26/javascript-halloween-effects/</link>
		<comments>http://dtsn.co.uk/2008/10/26/javascript-halloween-effects/#comments</comments>
		<pubDate>Sun, 26 Oct 2008 22:40:00 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[CSS/HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Prototype]]></category>
		<category><![CDATA[Scriptaculous]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=527</guid>
		<description><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<br />
				<br />
			
		</div>
<p>Halloween is just around the corner&#8230;</p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdtsn.co.uk%2F2008%2F10%2F26%2Fjavascript-halloween-effects%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdtsn.co.uk%2F2008%2F10%2F26%2Fjavascript-halloween-effects%2F&amp;source=dtsn&amp;style=normal&amp;service=is.gd" height="61" width="50" /><br />
			</a>
		</div>
<p>Halloween is just around the corner and what better to jazz your blog up than with some Halloween related JavaScript. This tutorial will focus on making images appear and disappear on the background of your blog.</p>
<p>For this example I will be using a ghost which will appear every two seconds in a random location and disappear again. You can preview what this will look like by clicking the button below (<em>only viewable in a web browser</em>).</p>
<p>You can download the source files for this tutorial below as well as the ghost AI file.</p>
<input type="button" onclick="new Ghost();" value="Try Me" />
<p><a href="/wp-content/uploads/2008/10/Ghost.zip">Source Files</a></p>
<p>For this tutorial we are going to be using <a onclick="javascript:pageTracker._trackPageview(&#39;/outgoing/script.aculo.us/&#39;);" href="http://script.aculo.us/">Script.aculo.us</a> effects library with the <a onclick="javascript:pageTracker._trackPageview(&#39;/outgoing/ww.prototypejs.org&#39;);" href="http://ww.prototypejs.org">Prototype</a> core framework.</p>
<pre class="javascript" name="code">var Ghost = Class.create({
	initialize: function() {
	}
});</pre>
<p>First of all we need to create our Class, which is called <em>Ghost</em>. Inside the class <em>Ghost</em> we have added our initialize function. The initialize function will be called when we create a new instance of the class. Therefore we need to put in all our setup code:</p>
<pre class="javascript" name="code"> // create the element
this.ghost = new Element('div', {'class' : 'ghost'});
// hide the element
this.ghost.hide();
// add the element to the body
$(document.body).insert({top: this.ghost});
// get the size of the document
this.size = document.viewport.getDimensions();
// set up the timer
new PeriodicalExecuter(this.show.bindAsEventListener(this), 2);</pre>
<p>In this segment we create our hidden ghost element. We then store the size of the document, and load up our periodical executer to call <em>this.show</em>. The second parameter in the Periodical Executer is the time between calls, we are calling the show function once every 2 seconds.</p>
<pre class="javascript" name="code">show: function() {
	// randomly set where the ghost is going
	var x = Math.floor(Math.random()*(this.size['width']-200));
	var y = Math.floor(Math.random()*(this.size['height']-200));
	// set the style
	this.ghost.setStyle({
		'left': x + 'px',
		'top': y + 'px'
	});

	// show the object
	this.ghost.appear({
		afterFinish: function() {
			this.ghost.fade();
		}.bind(this)
	});
}</pre>
<p>The show function needs to be added to the <em>Ghost</em> class. The show function first calculates where we want our ghost to appear, so we work out random x and y co-ordinates using the document sizes we gathered in our initialize function. We then position the element and call the <a onclick="javascript:pageTracker._trackPageview(&#39;/outgoing/script.aculo.us/&#39;);" href="http://script.aculo.us/">Script.aculo.us</a> appear effect which will slowly fade in the image. After the appear effect has finish we want to hide the ghost so we call fade.</p>
<p>Ok, now we have all the code complete we need to call the class. We can do this in a number of ways, you could bind the event to a button:</p>
<pre class="html" name="code">
<div onclick="new Ghost()">BOO</div>
</pre>
<p>Or you can bind it into your document load function, which means it will start when the page loads:</p>
<pre class="javascript" name="code">document.observe("dom:loaded", function() {
	new Ghost();
});</pre>
<h3>CSS</h3>
<p>The CSS is a really simple one line.</p>
<pre class="css" name="code">.ghost { width: 100px; height: 100px; position: absolute; background: url('yourimage.png') no-repeat; }</pre>
<p>This tutorial is just a brief outline with what you can do with JavaScript this Halloween. If you have any other ideas you would like me to implement, please tell me in the comments below.</p>
]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2008/10/26/javascript-halloween-effects/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Super CSS, the power of the selector</title>
		<link>http://dtsn.co.uk/2008/10/15/super-css-the-power-of-the-selector/</link>
		<comments>http://dtsn.co.uk/2008/10/15/super-css-the-power-of-the-selector/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 21:22:57 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[CSS/HTML]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=518</guid>
		<description><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<br />
				<br />
			
		</div>
<p>We all love CSS it’s fundamental&#8230;</p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdtsn.co.uk%2F2008%2F10%2F15%2Fsuper-css-the-power-of-the-selector%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdtsn.co.uk%2F2008%2F10%2F15%2Fsuper-css-the-power-of-the-selector%2F&amp;source=dtsn&amp;style=normal&amp;service=is.gd" height="61" width="50" /><br />
			</a>
		</div>
<p><img style="border-width: 0px; margin: 0px 0px 0px 10px; float: right;" alt="super_css" src="/wp-content/uploads/2008/10/super-css-thumb.png" width="240" height="201" />We all love CSS it’s fundamental to the web. However most of us do not use the full power of CSS. A quick rummage around the W3C specification and you will see how powerful CSS can really be. I’m talking about the CSS selector, sure we all use the basic selectors, but what about the more complicated ones.</p>
<p>Well here’s my guide to the most useful not very used CSS selectors (as well as what they are currently supported in).</p>
<h3>CSS2</h3>
<table class="table" width="480" border="0">
<tbody>
<tr>
<th width="140">Pattern</th>
<th width="360">Meaning</th>
<th width="10">IE6</th>
<th width="10">IE7</th>
<th width="10">FF</th>
<th width="10">SF</th>
<th width="10">OP</th>
</tr>
<tr>
<td>E &gt; F</td>
<td>Matches any F element that is a child of an element E.</td>
<td class="center"><img style="display: inline;" title="cross" alt="cross" src="/wp-content/uploads/2008/10/cross-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
</tr>
<tr>
<td>E:first-child</td>
<td>Matches element E when E is the first child of its parent. </td>
<td class="center"><img style="display: inline;" title="cross" alt="cross" src="/wp-content/uploads/2008/10/cross-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
</tr>
<tr>
<td>E:link          <br />E:visited </td>
<td>Matches element E if E is the source anchor of a hyperlink of which the target is not yet visited (:link) or already visited (:visited). </td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
</tr>
<tr>
<td>E:active          <br />E:hover           <br />E:focus </td>
<td>Matches E during certain user actions. </td>
<td class="center">&nbsp;</td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center">&nbsp;</td>
</tr>
<tr>
<td>E + F</td>
<td>Matches any F element immediately preceded by an element E.</td>
<td class="center"><img style="display: inline;" title="cross" alt="cross" src="/wp-content/uploads/2008/10/cross-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
</tr>
<tr>
<td>E[foo]</td>
<td>Matches any E element with the &#8220;foo&#8221; attribute set (whatever the value). </td>
<td class="center"><img style="display: inline;" title="cross" alt="cross" src="/wp-content/uploads/2008/10/cross-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
</tr>
<tr>
<td>E[foo="warning"]</td>
<td>Matches any E element whose &#8220;foo&#8221; attribute value is exactly equal to &#8220;warning&#8221;. </td>
<td class="center"><img style="display: inline;" title="cross" alt="cross" src="/wp-content/uploads/2008/10/cross-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
</tr>
<tr class="last">
<td>E[foo~="warning"]</td>
<td>Matches any E element whose &#8220;foo&#8221; attribute value is a list of space-separated values, one of which is exactly equal to &#8220;warning&#8221;. </td>
<td class="center"><img style="display: inline;" title="cross" alt="cross" src="/wp-content/uploads/2008/10/cross-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
</tr>
</tbody>
</table>
<h3>CSS3</h3>
<table class="table" width="480" border="0">
<tbody>
<tr>
<th width="140">Pattern</th>
<th width="360">Meaning</th>
<th width="10">IE6</th>
<th width="10">IE7</th>
<th width="10">FF</th>
<th width="10">SF</th>
<th width="10">OP</th>
</tr>
<tr>
<td>E ~ F</td>
<td>Matches any F element preceded by an element E.</td>
<td class="center"><img style="display: inline;" title="cross" alt="cross" src="/wp-content/uploads/2008/10/cross-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="cross" alt="cross" src="/wp-content/uploads/2008/10/cross-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
</tr>
<tr>
<td>E:empty</td>
<td>Matches element E where E has no children, including text nodes</td>
<td class="center"><img style="display: inline;" title="cross" alt="cross" src="/wp-content/uploads/2008/10/cross-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center"><img style="display: inline;" title="tick" alt="tick" src="/wp-content/uploads/2008/10/tick-thumb.gif" width="16" border="0" height="16"></td>
<td class="center">&nbsp;</td>
<td class="center"><img style="display: inline;" title="cross" alt="cross" src="/wp-content/uploads/2008/10/cross-thumb.gif" width="16" border="0" height="16"></td>
</tr>
</tbody>
</table>
<p>If you need a detailed walkthrough on how these selectors work, please refer to the <a href="http://www.w3.org/TR/css3-selectors/">W3C Specification on CSS3 Selectors</a> (which includes all the CSS2 selectors).</p>
<h3>A Couple of Examples</h3>
<p>I couldn’t just give all these CSS selectors without giving you some great examples of how they can be used.</p>
<p><strong>E:first-child/E:last-child – </strong>You have a <em>ul</em> list of elements which you float horizontally. With first child and last child you can easily set the margins for the first and last child different from the remaining items:</p>
<pre class="css" name="code">
ul { list-style: none; margin: 0px; padding: 0px; }
ul li { float: left; margin: 0px 10px; }
ul li:first-child { margin: 0px 10px 0px 0px; }
ul li:last-child { margin: 0px 0px 0px 10px; }
</pre>
<p><strong>E:empty – </strong>You may have a situation where you have an empty paragraph. Paragraphs will always have a margin top and a margin bottom, which could look unsightly. So lets remove it.</p>
<pre class="css" name="code">
p:empty { display:none; }
</pre>
<p>What’s your favourite selector? Do you care that they are not always supported?</p>
]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2008/10/15/super-css-the-power-of-the-selector/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>If the web was smaller</title>
		<link>http://dtsn.co.uk/2008/07/05/if-the-web-was-smaller-idea/</link>
		<comments>http://dtsn.co.uk/2008/07/05/if-the-web-was-smaller-idea/#comments</comments>
		<pubDate>Sat, 05 Jul 2008 10:11:18 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[CSS/HTML]]></category>

		<guid isPermaLink="false">http://www.dtsn.co.uk/2008/07/05/if-the-web-was-smaller-idea/</guid>
		<description><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<br />
				<br />
			
		</div>
<p>I’ve just had this crazy idea,&#8230;</p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdtsn.co.uk%2F2008%2F07%2F05%2Fif-the-web-was-smaller-idea%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdtsn.co.uk%2F2008%2F07%2F05%2Fif-the-web-was-smaller-idea%2F&amp;source=dtsn&amp;style=normal&amp;service=is.gd" height="61" width="50" /><br />
			</a>
		</div>
<p>I’ve just had this crazy idea, what would happen if all the <em>&lt;div&gt;</em> tags in the world were converted into <em>&lt;d&gt;</em> tags. Image how much space it would save, well you don’t need to imagine I have broken out my calculator and worked it all out.</p>
<p> <span id="more-272"></span>
<p>Taking the top 5 website&#8217;s from <a href="http://www.alexa.com/site/ds/top_sites?ts_mode=global&amp;lang=none">Alexa</a>:</p>
<table cellspacing="0" cellpadding="2" width="492" border="0">
<tbody>
<tr>
<td valign="top" width="100"><strong>Website</strong></td>
<td valign="top" width="180"><strong>Number of &lt;div&gt; Elements</strong></td>
<td valign="top" width="44"><strong>Size</strong></td>
<td valign="top" width="166"><strong>Size when &lt;div&gt; = &lt;d&gt;</strong></td>
</tr>
<tr>
<td valign="top" width="99">Yahoo.com</td>
<td valign="top" width="180">85</td>
<td valign="top" width="44">153Kb</td>
<td valign="top" width="166">152Kb</td>
</tr>
<tr>
<td valign="top" width="98">Google.com</td>
<td valign="top" width="180">6</td>
<td valign="top" width="44">7.5Kb</td>
<td valign="top" width="166">7.5Kb</td>
</tr>
<tr>
<td valign="top" width="99">Youtube.com</td>
<td valign="top" width="180">377</td>
<td valign="top" width="44">76.8Kb</td>
<td valign="top" width="166">75.3Kb</td>
</tr>
<tr>
<td valign="top" width="99">Live.com</td>
<td valign="top" width="180">27</td>
<td valign="top" width="44">18.6Kb</td>
<td valign="top" width="166">18.5Kb</td>
</tr>
<tr>
<td valign="top" width="99">MSN.com</td>
<td valign="top" width="180">140</td>
<td valign="top" width="44">48.9Kb</td>
<td valign="top" width="166">48.3Kb</td>
</tr>
</tbody>
</table>
<p><a href="http://dtsn.co.uk/wp-content/uploads/2008/07/image.png"><img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="143" alt="image" src="http://dtsn.co.uk/wp-content/uploads/2008/07/image-thumb.png" width="490" border="0" /></a>     <br /><em>Approximate byte size per 2 characters.</em></p>
<p>For every element that would be converted to a <em>&lt;d&gt;,</em> on average 5.93 bytes are saved. Considering that a typically website has 127 <em>&lt;div&gt;</em> elements, taking from the average of the top 5 website&#8217;s, this will create a saving of 0.753Kb per web page. That might not seem like a lot but added together across all the website&#8217;s imagine how much time it would save.</p>
<p>Of course this is just pie in the sky, but if the W3C thought of shrinking the HTML tags we use, website&#8217;s would load faster, and every millisecond counts. Hopefully this will cause some debate on why HTML elements are longer than they need to be.</p>
<p>I am only suggesting the HTML tags div and span since they convey no semantical meaning, unlike elements like p.</p>
]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2008/07/05/if-the-web-was-smaller-idea/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>JavaScript in CSS, Ugly But Interesting</title>
		<link>http://dtsn.co.uk/2008/05/12/javascript-in-css-ugly-but-intresting/</link>
		<comments>http://dtsn.co.uk/2008/05/12/javascript-in-css-ugly-but-intresting/#comments</comments>
		<pubDate>Mon, 12 May 2008 15:14:50 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[CSS/HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.dtsn.co.uk/?p=193</guid>
		<description><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<br />
				<br />
			
		</div>
<p>There is a very little used&#8230;</p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdtsn.co.uk%2F2008%2F05%2F12%2Fjavascript-in-css-ugly-but-intresting%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdtsn.co.uk%2F2008%2F05%2F12%2Fjavascript-in-css-ugly-but-intresting%2F&amp;source=dtsn&amp;style=normal&amp;service=is.gd&amp;hashtags=CSS,JavaScript" height="61" width="50" /><br />
			</a>
		</div>
<p>There is a very little used and unknown method which allows you to utilise JavaScript within a CSS file. The CSS Expression property allows you to assign a JavaScript expression to a CSS property. For example, this allows you to set the position of an element according to the browser size.</p>
<p>[code="css"]<br />
width:expression(document.body.clientWidth > 950 ? "950px": "100%" );<br />
[/code]</p>
<p><strong>Do not use CSS Expression, they are unreliable, slow and are only supported in IE!</strong></p>
<p>CSS Expression suddenly came to me as a solution for the currently much debated feature (<a href="http://www.dave-woods.co.uk/index.php/css-variables/">here</a> and <a href="http://www.css3.info/new-features-proposed-for-css/">here</a>) of <a href="http://disruptive-innovations.com/zoo/cssvariables/">variables</a> in CSS3. This could theoretically be currently achieved through the use of CSS Expressions.</p>
<p>[code="css"]<br />
function blue() {<br />
return 'blue';<br />
}</p>
<p>body { background: expression(blue()); }<br />
[/code]</p>
<p>CSS Expressions are horrible and unsupported, so please don&#8217;t use them in development. They do, however, highlight a interesting and little known feature of CSS.</p>
]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2008/05/12/javascript-in-css-ugly-but-intresting/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
