<?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>blog.betabong.com &#187; css</title>
	<atom:link href="http://blog.betabong.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.betabong.com</link>
	<description></description>
	<lastBuildDate>Thu, 13 May 2010 09:49:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Use GZip compression for your website</title>
		<link>http://blog.betabong.com/2010/03/25/use-gzip-compression-for-html-css-javascript-xml/</link>
		<comments>http://blog.betabong.com/2010/03/25/use-gzip-compression-for-html-css-javascript-xml/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 09:53:50 +0000</pubDate>
		<dc:creator>betabong</dc:creator>
				<category><![CDATA[Flash & more]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[Compression]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[speed]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://blog.betabong.com/?p=316</guid>
		<description><![CDATA[Most of my Flash apps or websites use XML files, either for communication or initial data. They can get quite large, reaching about 100 kb or more is not seldom. You might say: so what?! 100 kb is like nothing for a bandwidth nowadays! Well, if you&#8217;ve every used iPhone tethering in an area where [...]


Related posts:<ol><li><a href='http://blog.betabong.com/2009/03/05/javascript-canvas-3d/' rel='bookmark' title='Permanent Link: 3D Point Cloud with Javascript and Canvas'>3D Point Cloud with Javascript and Canvas</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Most of my Flash apps or websites use XML files, either for communication or initial data. They can get quite large, reaching about 100 kb or more is not seldom. You might say: so what?! 100 kb is like nothing for a bandwidth nowadays! Well, if you&#8217;ve every used iPhone tethering in an area where there is no 3g network, you start appreciating every single byte you won&#8217;t have to suck from the net. (On a side note: That&#8217;s when Opera really comes in handy.)</p>
<h3>XML files compress really well</h3>
<p>Because XML usually contains a lot of repetitive elements (noticably tags and attributes), they are like a compressor&#8217;s darling. Just zip a few of your XML files and you&#8217;ll see.</p>
<p>Now I kind of always thought that on nowadays webservers gzip compression is activated by default anyway. Which was wrong, at least for quite a bunch of servers I use.</p>
<h3>Activate GZip compression</h3>
<p>If your server installation contains the deflate module (which is the case for all of the ones I use), then you can simply add the following line to your .htaccess file:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># compress all html, plain text, xml, css and javascript:
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript</pre></div></div>

<p>AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript</p>
<div>I&#8217;ve also tried more complex constructs found on the web, but they resulted in «Internal server errors» which is why I&#8217;ll go along with this simple one for now.</div>
<div><strong><span style="font-weight: normal;">The effects are dramatic! I usually get about 70% – 80% of reduction for non-minimized files, </span></strong></div>
<div>
<h3>Examples</h3>
</div>
<div>
<table border="0" class="small">
<tbody>
<tr>
<th></th>
<th>Uncompressed</th>
<th>Compressed</th>
<th>Reduction</th>
</tr>
<tr>
<td><strong>Javascript minimized</strong><br />
<a href="http://ajax.googleapis.com/ajax/libs/mootools/1.2.4/mootools-yui-compressed.js">MooTools YUI compressed</a></td>
<td>66,867</td>
<td>20,964</td>
<td>68.6%</td>
</tr>
<tr>
<td><strong>Javascript minimized</strong><br />
<a href="http://ajax.googleapis.com/ajax/libs/mootools/1.2.4/mootools.jss">MooTools uncompressed</a></td>
<td>102,991</td>
<td>27,599</td>
<td>73.2%</td>
</tr>
<tr>
<td><strong>XML/CSS combined</strong><br />
<a href="http://www.ceylor.ch/pages/home.xml">A larger initial XML file for a Flash website of mine</a></td>
<td>84,316</td>
<td>18,229</td>
<td>78.4%</td>
</tr>
<tr>
<td><strong>XML/CSS combined</strong><br />
<a href="http://www.ceylor.ch/pages/home.xml">A larger initial XML file for a Flash website of mine</a></td>
<td>84,316</td>
<td>18,229</td>
<td>78.4%</td>
</tr>
<tr>
<td><strong>HTML</strong><br />
<a href="http://20min.ch">A swiss news website, 20 Minuten</a></td>
<td>148,587</td>
<td>29,385</td>
<td>80.2%</td>
</tr>
<tr>
<td><strong>HTML</strong><br />
<a href="http://blog.betabong.com">My blogs home page</a></td>
<td>51,638</td>
<td>12,991</td>
<td>74.8%</td>
</tr>
</tbody>
</table>
<h3>Tools</h3>
<p>If you want to test your website, these pages are very informative (first one is faster, second one more informative):</p>
<p><a href="http://www.whatsmyip.org/http_compression/">http://www.whatsmyip.org/http_compression/</a></div>
<p><a href="http://www.gidnetwork.com/tools/gzip-test.php">http://www.gidnetwork.com/tools/gzip-test.php</a></p>
<p>I also like this one, although it only gives you little info on content-encoding. But very much on top of that :-)<br />
<a href="http://www.wmtips.com/tools/info/">http://www.wmtips.com/tools/info/</a></p>
<p>This little Firefox addon will tell you wether any site you visit has GZip activated:<br />
<a href="https://addons.mozilla.org/en-US/firefox/addon/54647">https://addons.mozilla.org/en-US/firefox/addon/54647</a> (Content Encoding Detector)</p>
<h3 style="font-size: 1.17em;">Conclusion</h3>
<p>HTML websites will profit a lot from this compression, as well as Flash sites (if just for your swfobject.js) that use textual communication. And best of all: it won&#8217;t need any kungfu effort on your side! And: practically all browsers support it. (I&#8217;ve only heard of problems with IE6, but then, you know, f*** IE6)</p>
<h3>Update:</h3>
<p>A more complete solution for your .htaccess file:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;IfModule mod_deflate.c&gt;
	AddOutputFilterByType DEFLATE text/html
	AddOutputFilterByType DEFLATE text/xml
&nbsp;
	AddOutputFilterByType DEFLATE image/x-icon
&nbsp;
	AddOutputFilterByType DEFLATE text/css
&nbsp;
	AddOutputFilterByType DEFLATE text/javascript
	AddOutputFilterByType DEFLATE application/javascript
	AddOutputFilterByType DEFLATE application/x-javascript
	AddOutputFilterByType DEFLATE text/x-js
	AddOutputFilterByType DEFLATE text/ecmascript
	AddOutputFilterByType DEFLATE application/ecmascript
	AddOutputFilterByType DEFLATE text/vbscript
	AddOutputFilterByType DEFLATE text/fluffscript
&nbsp;
	AddOutputFilterByType DEFLATE image/svg+xml
	AddOutputFilterByType DEFLATE application/x-font-ttf
	AddOutputFilterByType DEFLATE application/x-font
	AddOutputFilterByType DEFLATE font/opentype
	AddOutputFilterByType DEFLATE font/otf
	AddOutputFilterByType DEFLATE font/ttf
	AddOutputFilterByType DEFLATE application/x-font-truetype
	AddOutputFilterByType DEFLATE application/x-font-opentype
	AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
	AddOutputFilterByType DEFLATE application/vnd.oasis.opendocument.formula-template
&lt;/IfModule&gt;</pre></div></div>

<p>(<a href="http://www.speedingupwebsite.com/2010/01/08/use-the-gzip-power/">Source</a>)</p>


<p>Related posts:<ol><li><a href='http://blog.betabong.com/2009/03/05/javascript-canvas-3d/' rel='bookmark' title='Permanent Link: 3D Point Cloud with Javascript and Canvas'>3D Point Cloud with Javascript and Canvas</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.betabong.com/2010/03/25/use-gzip-compression-for-html-css-javascript-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BBML Presentation at SFUG</title>
		<link>http://blog.betabong.com/2009/04/22/bbml-presentation/</link>
		<comments>http://blog.betabong.com/2009/04/22/bbml-presentation/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 08:02:14 +0000</pubDate>
		<dc:creator>betabong</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flash & more]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[bbml]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[sfug]]></category>

		<guid isPermaLink="false">http://blog.betabong.com/?p=262</guid>
		<description><![CDATA[Yesterday I had a presentation at the SFUG meeting covering some bits of my rewritten BBML framework (originated from the project laax.com). I&#8217;ve tried to share some insights into the technical concept and strategies for CSS parsing, CSS selectors and layout validation.

Picture by Marc Liyanage
It&#8217;s been surprisingly fun (I give credits to the beer sponsored [...]


Related posts:<ol><li><a href='http://blog.betabong.com/2008/08/22/flash-player-10-i-love-speed/' rel='bookmark' title='Permanent Link: Flash Player 10 – I love speed'>Flash Player 10 – I love speed</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Yesterday I had a presentation at the <a href="http://www.sfug.ch/?p=123">SFUG meeting</a> covering some bits of my rewritten BBML framework (originated from the project laax.com). I&#8217;ve tried to share some insights into the technical concept and strategies for CSS parsing, <a href="http://en.wikipedia.org/wiki/CSS_selector">CSS selectors</a> and layout validation.</p>
<p><img src="http://blog.betabong.com/wp-content/uploads/2009/04/sfug-pres.jpg" alt="Sev presenting..." title="Sev presenting..." width="520" height="390" class="alignnone size-full wp-image-266" /><br />
<small>Picture by <a href="http://www.entropy.ch/about/welcome.html">Marc Liyanage</a></small></p>
<p>It&#8217;s been surprisingly fun (I give credits to the beer sponsored by <a href="http://www.nemos.ch/">Nemos</a>). People even managed to pretend they&#8217;d be interested in what I was prosing, so credit to them too!</p>
<p><a href="http://www.flashatthelake.ch" style="float: right; display: block; margin-left: 10pt; margin-bottom: 10pt;"><img src="http://fatl.ch/banners/fatl_button3_120x60.gif" width="120" height="60" hspace="10" vspace="10" border="0" alt="Flash at the lake Swiss Flash User Group Conference." /></a> I&#8217;d also like to mention that there&#8217;ll be <strong>the</strong> swiss flash event soon: Flash at the Lake will not only pamper you with appearances of <a href="http://fatl.ch/?page_id=16">great national and international Flash enthustiacs</a>, it will also give anybody attending the pleasure to enjoy one of Zurich&#8217;s greatest locations with people who don&#8217;t think of you as a storm lightning adorer when you sit in the sun twittering Flash into the clear lake. And all that to a fantastic price. Check it out at <a href="http://fatl.ch">fatl.ch</a></p>
<p>So here we go with the presentation (<a href="http://www.apple.com/quicktime/download/">Quicktime</a> so you can enjoy the marvelous effects):</p>
<p><object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="520" height="390"><param name="src" value="/wp-content/uploads/2009/04/sfug-presentation-bbml-hq.mov" /><param name="controller" value="true" /><param name="autoplay" value="false" /><param name="scale" value="aspect" /><object type="video/quicktime" data="/wp-content/uploads/2009/04/sfug-presentation-bbml-hq.mov" width="520" height="390">
<param name="autoplay" value="false" /><param name="controller" value="true" /><param name="scale" value="aspect" /></object></object></p>


<p>Related posts:<ol><li><a href='http://blog.betabong.com/2008/08/22/flash-player-10-i-love-speed/' rel='bookmark' title='Permanent Link: Flash Player 10 – I love speed'>Flash Player 10 – I love speed</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.betabong.com/2009/04/22/bbml-presentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Alternative to Left Float</title>
		<link>http://blog.betabong.com/2009/02/25/css-alternative-to-left-float/</link>
		<comments>http://blog.betabong.com/2009/02/25/css-alternative-to-left-float/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 21:19:54 +0000</pubDate>
		<dc:creator>betabong</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://blog.betabong.com/?p=196</guid>
		<description><![CDATA[I used to use float:left a lot for my layouts. But it can be a pain in the ass for several reasons – which of them the main may be that the surrounding box doesn&#8217;t surround it (so you&#8217;d have to come up with some stupid clearfloat-hacks).
Anyway, I recently discovered somewhere a great alternative (you can [...]


Related posts:<ol><li><a href='http://blog.betabong.com/2009/04/22/bbml-presentation/' rel='bookmark' title='Permanent Link: BBML Presentation at SFUG'>BBML Presentation at SFUG</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I used to use float:left a lot for my layouts. But it can be a pain in the ass for several reasons – which of them the main may be that the surrounding box doesn&#8217;t surround it (so you&#8217;d have to come up with some stupid clearfloat-hacks).</p>
<p>Anyway, I recently discovered somewhere a great alternative (you can call it hack too, but then everything a little fancy that&#8217;s supposed to work with IE is a hack, isn&#8217;t it?).</p>
<p>So while until now I&#8217;d have something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.inlinebox</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span>  <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;"><span style="color: #cc66cc;">49</span>%</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">min-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>the new method goes like this:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.inlinebox</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> -moz-inline-stack<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">vertical-align</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
	zoom<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">*</span><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">inline</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;"><span style="color: #cc66cc;">49</span>%</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">min-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
	_height<span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>That&#8217;s looks quite more complex. And it certainly is. But it works like a charm on all browsers I&#8217;ve tested (IE7, Safari, FF3). _height, zoom and *display are some crappy IE hacks obviously. The zoom attribute by the way is quite interesting, as it activates the hidden (IE only) CSS attribute hasLayout.</p>
<p>It also has some very nice benefits, like the alignement to the bottom&#8230;</p>
<h3>Example</h3>
<p><a class="download" href='http://blog.betabong.com/wp-content/uploads/2009/02/example-inlineblock.html'  target="_blank">View Example</a></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">	&lt;style type=&quot;text/css&quot; media=&quot;screen&quot;&gt;
		.codeexample span {
			background-color: #68B6FF;
			-webkit-box-reflect: below 1px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(0.8, transparent), to(rgba(255, 255, 255, 0.8)));
			-moz-border-radius: 5px;
			-webkit-border-radius: 5px;
			margin-right: 10px;
			margin-bottom: 40px;
			width: 140px;
			padding: 10px;
		}
		.inlinebox1 {
			display: block;
			float:  left;
			min-height: 32px;
		}
&nbsp;
		.inlinebox2 {
			display: -moz-inline-stack;
			display: inline-block;
			vertical-align: bottom;
			zoom: 1;
			*display: inline;
			min-height: 32px;
			_height: 32px;
		}
&nbsp;
	&lt;/style&gt;
&nbsp;
	&lt;div class=&quot;codeexample&quot;&gt;
		&lt;h3&gt;Float: left&lt;/h3&gt;
		&lt;span class=&quot;inlinebox1&quot;&gt;Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox1&quot;&gt;Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox1&quot;&gt;Inlinebox Inlinebox Inlinebox Inlinebox Inlinebox Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox1&quot;&gt;Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox1&quot;&gt;Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox1&quot;&gt;Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox1&quot;&gt;Inlinebox&lt;/span&gt;
&nbsp;
		&lt;h3 style=&quot;clear: both;&quot;&gt;Inline Block&lt;/h3&gt;
		&lt;span class=&quot;inlinebox2&quot;&gt;Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox2&quot;&gt;Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox2&quot;&gt;Inlinebox Inlinebox Inlinebox Inlinebox Inlinebox Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox2&quot;&gt;Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox2&quot;&gt;Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox2&quot;&gt;Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox2&quot;&gt;Inlinebox&lt;/span&gt;
	&lt;/div&gt;</pre></div></div>



<p>Related posts:<ol><li><a href='http://blog.betabong.com/2009/04/22/bbml-presentation/' rel='bookmark' title='Permanent Link: BBML Presentation at SFUG'>BBML Presentation at SFUG</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.betabong.com/2009/02/25/css-alternative-to-left-float/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Blog Feature: Code Lightbox</title>
		<link>http://blog.betabong.com/2008/10/03/blog-feature-code-lightbox/</link>
		<comments>http://blog.betabong.com/2008/10/03/blog-feature-code-lightbox/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 17:07:49 +0000</pubDate>
		<dc:creator>betabong</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.betabong.com/?p=127</guid>
		<description><![CDATA[Just added a little javascript magic: now you can «zoom into» the code snippets in this blog. The javascript is not very -ehm- reusable because it contains some dirty hard coded style stuff, but hey, it does its job pretty well ;-) (btw: not tested on IE).
So now time to go to Marc&#8217;s birthday party. [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Just added a little javascript magic: now you can «zoom into» the code snippets in this blog. The javascript is not very -ehm- reusable because it contains some dirty hard coded style stuff, but hey, it does its job pretty well ;-) (btw: not tested on IE).</p>
<p>So now time to go to Marc&#8217;s birthday party. I wish <a title="Marc runs Entropy" href="http://www.entropy.ch">Marc</a>, my favorite code (and soon typo) guru and a good friend, all the best: Rock on!! :-)</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.betabong.com/2008/10/03/blog-feature-code-lightbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
