<?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>Jon Rohan &#187; Tutorial</title>
	<atom:link href="http://www.dinnermint.org/category/tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dinnermint.org</link>
	<description>I&#039;m a freelance web developer living in San Francisco. This is my portfolio where I share my work, thoughts, and whatever else.</description>
	<lastBuildDate>Sat, 24 Apr 2010 17:01:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<cloud domain='www.dinnermint.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>Dead Simple Git Workflow</title>
		<link>http://www.dinnermint.org/tutorial/dead-simple-git-workflow-for-agile-teams/</link>
		<comments>http://www.dinnermint.org/tutorial/dead-simple-git-workflow-for-agile-teams/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 20:00:55 +0000</pubDate>
		<dc:creator>Jon Rohan</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[pivotaltracker]]></category>

		<guid isPermaLink="false">http://www.dinnermint.org/?p=2006</guid>
		<description><![CDATA[Recently I have had the privilege to work with a few excellent small agile teams. With each team, they have their own process, which works best for them. And there&#8217;s nothing wrong with that, a team should work in it&#8217;s most effective way. But I came across a team recently that had a workflow that [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have had the privilege to work with a few excellent small agile teams. With each team, they have their own process, which works best for them. And there&#8217;s nothing wrong with that, a team should work in it&#8217;s most effective way. But I came across a team recently that had a workflow that really impressed me. To put it simply it&#8217;s described as an extremely cool Git workflow. </p>
<p>I can&#8217;t take credit for coming up with this workflow, but I&#8217;m gonna do my best to re-describe it here so it can be shared. The basis for this post comes from reinh.com&#8217;s posts <a href="http://reinh.com/blog/2009/03/02/a-git-workflow-for-agile-teams.html">A git workflow for Agile Teams</a> and <a href="http://reinh.com/blog/2008/08/27/hack-and-and-ship.html">Hack &#038;&#038; Ship</a>. Also this workflow pulls alot from Josh Susser&#8217;s post on the <a href="http://blog.hasmanythrough.com/2008/12/18/agile-git-and-the-story-branch-pattern">story branch pattern</a>.</p>
<p>Let&#8217;s start by summarizing Josh&#8217;s post. In his post he describes a 7 step process that begins with <a href="http://www.pivotaltracker.com">Pivotal Tracker</a>. The idea being you locate a story on pivotal tracker, like a bug, or feature, or chore. Then you update your working master by pulling from the origin, and create a whole branch just for that bug. Once you&#8217;ve fixed the bug, commited it to your branch, you then merge your branch with the master and push it all back up to the origin. Then just remove the old branch and you&#8217;re done. </p>
<p>That&#8217;s the basic workflow, but there is alot of automation that can be done. The first is the creation of the branch. This isn&#8217;t terribly long command &#8216;git checkout -b&#8217; but I went ahead and created a shell alias &#8216;gcb&#8217;.</p>
<pre><code>alias gcb=&#039;git checkout -b&#039;</code></pre>
<p>So now when creating my branch for working on my bug I just type</p>
<pre><code>gcb fix_ie_bug_Story123456</code></pre>
<p>After creating my branch I would work on it normally doing &#8216;git commits&#8217; when needed. Then when I&#8217;m ready comes the cool part. Hack &#038; Ship. Hack is what it&#8217;s called when you pull the lastest code from the origin and merge it with your branch. It&#8217;s a good idea to do this often, just to keep everything up to date. To not have to type and remember the few commands for accomplishing this, I use a shell script.</p>
<p>hack.sh<br />
<pre><code>#!/bin/sh -x
# hack: Merge the latest changes from the master branch into your current branch
ref=$(git symbolic-ref HEAD 2&gt; /dev/null) || exit 0
CURRENT=&quot;${ref#refs/heads/}&quot;
git checkout master
git pull origin master
git checkout ${CURRENT}
git rebase master</code></pre></p>
<p>So during my coding, I can at anytime just type the command hack. And my branch is updated!</p>
<p>Once I&#8217;ve finished my bug and I&#8217;m ready to send it back to the origin I do one more &#8216;hack&#8217;, make sure it&#8217;s all updated. And then I ship. This will checkout the master merge my branch with it, and then push it to the origin. Once again I use a shell script for this.</p>
<p>ship.sh<br />
<pre><code>#!/bin/sh -x
# Git workflow ship script from: http://reinh.com/blog/2008/08/27/hack-and-and-ship.html
# git name-rev is fail
ref=$(git symbolic-ref HEAD 2&gt; /dev/null) || exit 0
CURRENT=&quot;${ref#refs/heads/}&quot;
git checkout master
git merge ${CURRENT}
git push origin master
git checkout ${CURRENT}</code></pre></p>
<p>Now I&#8217;m done with my bug, and there&#8217;s a script for that &#8216;dwf&#8217;. This will move me back to the master, and delete my old branch.</p>
<p>dwf.sh<br />
<pre><code>#!/bin/sh -x
# dwf, aka &quot;Done With Feature&quot; script: deletes current branch and puts you back on master
ref=$(git symbolic-ref HEAD 2&gt; /dev/null) || exit 0
CURRENT=&quot;${ref#refs/heads/}&quot;
git checkout master
git branch -d ${CURRENT}</code></pre></p>
<p>And we&#8217;re ready to repeat the whole process on a new bug/feature/chore.</p>
<p>To summarize:</p>
<p><pre><code>gcb awesome_new_feature_Story12345

develop...
commit....
hack....
[repeat]

hack
ship
dwf
</code></pre></p>
<p>You can even take this a bit farther, and create an alias for the last three commands &#8216;hsd&#8217; (hack ship done)</p>
<pre><code>alias hsd=&quot;hack &amp;&amp; ship &amp;&amp; dwf&quot;</code></pre>
<p>Which cuts our workflow to<br />
<pre><code>gcb awesome_new_feature_Story12345

develop...
commit....
hack....
[repeat]

hsd</code></pre></p>
<p>Pretty awesome! I&#8217;m sure there are hundreds of awesome workflows out there. What do you guys use on your projects?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinnermint.org/tutorial/dead-simple-git-workflow-for-agile-teams/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CSS Text Rotation Clock</title>
		<link>http://www.dinnermint.org/tutorial/css3-text-rotation-clock/</link>
		<comments>http://www.dinnermint.org/tutorial/css3-text-rotation-clock/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 22:53:31 +0000</pubDate>
		<dc:creator>Jon Rohan</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[rotate]]></category>
		<category><![CDATA[transform]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://www.dinnermint.org/?p=1874</guid>
		<description><![CDATA[I recently saw an article on CSS text rotation on the internets and decided to try my own experiement.]]></description>
			<content:encoded><![CDATA[<p>I recently saw an <a href="http://snook.ca/archives/html_and_css/css-text-rotation">article</a> on CSS text rotation on the internets and decided to try my own experiement. </p>
<p>What I wanted to make was a clock. The basis of this project is using the -webkit-transform:rotate(0deg); css property. This allows you to rotate any object 360 degrees. So I began to wonder, if I have a line, and I setup a javascript timer can I rotate it every second? </p>
<div id="clock">
<div class="ten_min"></div>
<div class="ten_min" style="-moz-transform:rotate(30deg);-webkit-transform:rotate(30deg);"></div>
<div class="ten_min" style="-moz-transform:rotate(60deg);-webkit-transform:rotate(60deg);"></div>
<div class="ten_min" style="-moz-transform:rotate(90deg);-webkit-transform:rotate(90deg);"></div>
<div class="ten_min" style="-moz-transform:rotate(120deg);-webkit-transform:rotate(120deg);"></div>
<div class="ten_min" style="-moz-transform:rotate(150deg);-webkit-transform:rotate(150deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(6deg);-webkit-transform:rotate(6deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(12deg);-webkit-transform:rotate(12deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(18deg);-webkit-transform:rotate(18deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(24deg);-webkit-transform:rotate(24deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(36deg);-webkit-transform:rotate(36deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(42deg);-webkit-transform:rotate(42deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(48deg);-webkit-transform:rotate(48deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(54deg);-webkit-transform:rotate(54deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(66deg);-webkit-transform:rotate(66deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(72deg);-webkit-transform:rotate(72deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(78deg);-webkit-transform:rotate(78deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(84deg);-webkit-transform:rotate(84deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(96deg);-webkit-transform:rotate(96deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(102deg);-webkit-transform:rotate(102deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(108deg);-webkit-transform:rotate(108deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(114deg);-webkit-transform:rotate(114deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(126deg);-webkit-transform:rotate(126deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(132deg);-webkit-transform:rotate(132deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(138deg);-webkit-transform:rotate(138deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(144deg);-webkit-transform:rotate(144deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(156deg);-webkit-transform:rotate(156deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(162deg);-webkit-transform:rotate(162deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(168deg);-webkit-transform:rotate(168deg);"></div>
<div class="min_mark" style="-moz-transform:rotate(174deg);-webkit-transform:rotate(174deg);"></div>
<div id="sec"></div>
<div id="min"></div>
<div id="hour"></div>
</div>
<div class="clearfix"></div>
<p>The design is inspired by @<a href="https://twitter.com/eston">eston</a>&#8216;s <a href="http://www.flickr.com/photos/eston/3799958463/">Sarai</a> desktop.</p>
<p>This clock won&#8217;t work in IE. There is an IE rotate property, but it only rotates at 0, 90, 180, 270. So that won&#8217;t work for this clock. Here&#8217;s the IE rotate property anyways</p>
<pre><code>filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);</code></pre>
<h3>So How did I do it?</h3>
<p>I started with an external div for the clock. Giving it a width and height of 100px and position relative (so I can position the clock hands)<br />
<pre><code>#clock {
&nbsp;&nbsp;margin: 25px;
&nbsp;&nbsp;float: left;
&nbsp;&nbsp;width: 100px;
&nbsp;&nbsp;height: 100px;
&nbsp;&nbsp;position: relative;
}</code></pre><br />
After getting the clock, I need a second hand, a minute hand and an hour hand. Originally I just used a side border on the hands, but realized that the rotate property rotates the object at it&#8217;s center, and not at it&#8217;s end. So to create the hands, I gave them a border top equal to the length of the hand, then a height to offset the border, and some margin to vertically align.<br />
<pre><code>#sec {
&nbsp;&nbsp;-moz-transform: rotate(0deg);
&nbsp;&nbsp;-webkit-transform: rotate(0deg);
&nbsp;&nbsp;border-top:50px solid #353535;
&nbsp;&nbsp;height:30px;
&nbsp;&nbsp;left: 49px;
&nbsp;&nbsp;margin:10px 0;
&nbsp;&nbsp;position:absolute;
&nbsp;&nbsp;top: 0;
&nbsp;&nbsp;width:2px;
 }

#min {
&nbsp;&nbsp;-moz-transform: rotate(45deg);
&nbsp;&nbsp;-webkit-transform: rotate(45deg);
&nbsp;&nbsp;border-top:50px solid #353535;
&nbsp;&nbsp;height:30px;
&nbsp;&nbsp;position: absolute;
&nbsp;&nbsp;left: 48px;
&nbsp;&nbsp;top: 0;
&nbsp;&nbsp;margin:10px 0;
&nbsp;&nbsp;width:4px;
 }

#hour {
&nbsp;&nbsp;-moz-transform:rotate(180deg);
&nbsp;&nbsp;-webkit-transform:rotate(180deg);
&nbsp;&nbsp;border-top:35px solid #353535;
&nbsp;&nbsp;height:25px;
&nbsp;&nbsp;left:47px;
&nbsp;&nbsp;margin:20px 0;
&nbsp;&nbsp;position:absolute;
&nbsp;&nbsp;top:0;
&nbsp;&nbsp;width:5px;
}</code></pre></p>
<p>The tick marks are also the lines, with a top and bottom border rotated 180 degrees.</p>
<p>The javascript is a simple timer which updates the degrees of each hand based on the time.</p>
<p><pre><code>(function(){
&nbsp;&nbsp;var tick = function() {
&nbsp;&nbsp;&nbsp;&nbsp;var now = new Date();
&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;#sec&quot;).css({&quot;-moz-transform&quot;:&quot;rotate(&quot; + (now.getSeconds() * 6) + &quot;deg)&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;-webkit-transform&quot;:&quot;rotate(&quot; + (now.getSeconds() * 6) + &quot;deg)&quot;});
&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;#min&quot;).css({&quot;-moz-transform&quot;:&quot;rotate(&quot; + (now.getMinutes() * 6) + &quot;deg)&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;-webkit-transform&quot;:&quot;rotate(&quot; + (now.getMinutes() * 6) + &quot;deg)&quot;});
&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;#hour&quot;).css({&quot;-moz-transform&quot;:&quot;rotate(&quot; + (now.getHours() * 30) + &quot;deg)&quot;,
&nbsp;&nbsp;&nbsp;&nbsp; &quot;-webkit-transform&quot;:&quot;rotate(&quot; + (now.getHours() * 30) + &quot;deg)&quot;});
&nbsp;&nbsp;};
&nbsp;&nbsp;setInterval(tick,1000);
})();</code></pre></p>


<p>Related posts:<ol><li><a href='http://www.dinnermint.org/css/using-css3s-target-pseudo-class-to-make-a-slideshow/' rel='bookmark' title='Permanent Link: Using CSS3&#8242;s :target pseudo-class to Make a Slideshow'>Using CSS3&#8242;s :target pseudo-class to Make a Slideshow</a></li>
<li><a href='http://www.dinnermint.org/tutorial/css3-font-face/' rel='bookmark' title='Permanent Link: CSS 3 @font-face'>CSS 3 @font-face</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dinnermint.org/tutorial/css3-text-rotation-clock/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CSS Clear Fixes</title>
		<link>http://www.dinnermint.org/tutorial/css-clear-fixes/</link>
		<comments>http://www.dinnermint.org/tutorial/css-clear-fixes/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 19:18:22 +0000</pubDate>
		<dc:creator>Jon Rohan</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[clear]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.dinnermint.org/?p=1811</guid>
		<description><![CDATA[There is a common problem in front end engineering where, when you float an element it is actually removed from it&#8217;s parents&#8217; flow. This can cause the elements below the floating element to run into the floating elements. Like below. The green box is floating and it&#8217;s parent has the red border. The blue box [...]]]></description>
			<content:encoded><![CDATA[<p>There is a common problem in front end engineering where, when you float an element it is actually removed from it&#8217;s parents&#8217; flow. This can cause the elements below the floating element to run into the floating elements. Like below. The green box is floating and it&#8217;s parent has the red border. The blue box is below the red border box.</p>
<div style="border:1px solid red;">
<div style="background-color:green;float:left;width:20px;height:20px;"></div>
</div>
<div style="background-color:blue;width:50px;height:50px;"></div>
<p>There are a few solutions to this, but I have heard of a new solution that I don&#8217;t think is widely published. overflow:hidden;</p>
<p>First lets go through the other solutions. </p>
<h3>clear:both</h3>
<p>This is the most common that I&#8217;ve found, and the one I&#8217;ve used the most. The style in this code is inline, but typically you can just create a class called .clear and apply these styles.</p>
<div style="border:1px solid red;">
<div style="background-color:green;float:left;width:20px;height:20px;"></div>
<div style="clear:both;"></div>
</div>
<div style="background-color:blue;width:50px;height:50px;"></div>
<p><pre><code>&lt;div style=&quot;border:1px solid red;&quot;&gt;
&nbsp;&nbsp;&lt;div style=&quot;background-color:green;float:left;width:20px;height:20px;&quot;&gt;&lt;/div&gt;
&nbsp;&nbsp;&lt;div style=&quot;clear:both;&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color:blue;width:50px;height:50px;&quot;&gt;&lt;/div&gt;&nbsp;&nbsp; 
</code></pre></p>
<p>In this example you place another element at the end of the child elements in the red border box. This last element gets applied the style clear:both which disallows any floating elements on either side of it.</p>
<p>This can run into problems if you have multi-column layouts this can clear the content in the other columns</p>
<h3>clearfix hack</h3>
<p>This is essentially taking the previous method and adding to it. I don&#8217;t use this very often.</p>
<p><pre><code>.clearfix :after&nbsp;&nbsp;{
&nbsp;&nbsp;content :&nbsp;&nbsp;&quot;.&quot; ; 
&nbsp;&nbsp;display :&nbsp;&nbsp;block ; 
&nbsp;&nbsp;clear :&nbsp;&nbsp;both ; 
&nbsp;&nbsp;visibility :&nbsp;&nbsp;hidden ; 
&nbsp;&nbsp;line-height :&nbsp;&nbsp;0 ; 
&nbsp;&nbsp;height :&nbsp;&nbsp;0 ; 
} 
 
.clearfix&nbsp;&nbsp;{ 
&nbsp;&nbsp;display :&nbsp;&nbsp;inline-block ; 
} 
 
html[ xmlns]&nbsp;&nbsp;.clearfix&nbsp;&nbsp;{ 
&nbsp;&nbsp;display :&nbsp;&nbsp;block ; 
} 
 
*&nbsp;&nbsp;html .clearfix&nbsp;&nbsp;{ 
&nbsp;&nbsp;height :&nbsp;&nbsp;1 % ; 
}
</code></pre></p>
<div style="border:1px solid red;">
<div style="background-color:green;float:left;width:20px;height:20px;"></div>
<div class="clearfix"></div>
</div>
<div style="background-color:blue;width:50px;height:50px;"></div>
<p>This method works but it feels like a lot of overhead, and now my CSS is non-standard.</p>
<h3>overflow:hidden</h3>
<p>In this method you apply overflow:hidden to the parent element which is the red border box. And that&#8217;s it!</p>
<div style="border:1px solid red;overflow:hidden;">
<div style="background-color:green;float:left;width:20px;height:20px;"></div>
</div>
<div style="background-color:blue;width:50px;height:50px;"></div>
<p><pre><code>&lt;div style=&quot;border:1px solid red;overflow:hidden;&quot;&gt;&nbsp;&nbsp;
&nbsp;&nbsp;&lt;div style=&quot;background-color:green;float:left;width:20px;height:20px;&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color:blue;width:50px;height:50px;&quot;&gt;&lt;/div&gt; 
</code></pre></p>
<p>Pretty simple! And it doesn&#8217;t require extra div tags. I&#8217;ve tested this in IE7, Firefox, Safari, and Chrome works in all.</p>


<p>Related posts:<ol><li><a href='http://www.dinnermint.org/css/creating-triangles-in-css/' rel='bookmark' title='Permanent Link: Creating Triangles in CSS'>Creating Triangles in CSS</a></li>
<li><a href='http://www.dinnermint.org/share/wed-development-bookmarklets/' rel='bookmark' title='Permanent Link: Web Development Bookmarklets'>Web Development Bookmarklets</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dinnermint.org/tutorial/css-clear-fixes/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CSS 3 @font-face</title>
		<link>http://www.dinnermint.org/tutorial/css3-font-face/</link>
		<comments>http://www.dinnermint.org/tutorial/css3-font-face/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 01:47:54 +0000</pubDate>
		<dc:creator>Jon Rohan</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[font-face]]></category>
		<category><![CDATA[semantic]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[web standards]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://www.dinnermint.org/?p=1755</guid>
		<description><![CDATA[Surprisingly embed-able opentype fonts have been included in Internet Explorer since version 4. But with the recent release of Firefox 3.5 and Safari, you can now embed Opentype and Truetype fonts across all major browsers. It&#8217;s pretty simple and here&#8217;s how it&#8217;s done. First you must define your font, basically tell the browser where to [...]]]></description>
			<content:encoded><![CDATA[<p>Surprisingly embed-able opentype fonts have been included in Internet Explorer since version 4. But with the recent release of Firefox 3.5 and Safari, you can now embed Opentype and Truetype fonts across all major browsers. It&#8217;s pretty simple and here&#8217;s how it&#8217;s done.</p>
<p>First you must define your font, basically tell the browser where to get the font file, and what you&#8217;re going to call it.<br />
<pre><code>/* For IE */

@font-face {
font-family: &#039;Komika Display&#039;;
src: url(&#039;Komika_display.eot&#039;);
}

/* For Other Browsers */

@font-face {
font-family: &#039;Komika Display&#039;;
src: local(&#039;Komika Display Regular&#039;),
&nbsp;&nbsp;&nbsp;&nbsp; local(&#039;KomikaDisplay-Regular&#039;),
&nbsp;&nbsp;&nbsp;&nbsp; url(&#039;Komika_display.ttf&#039;) format(&#039;truetype&#039;);
}

@font-face {
font-family: &#039;Komika Display&#039;;
src: local(&#039;Komika Display Bold&#039;),
&nbsp;&nbsp;&nbsp;&nbsp; local(&#039;KomikaDisplay-Bold&#039;),
&nbsp;&nbsp;&nbsp;&nbsp; url(&#039;Komika_display_bold.ttf&#039;) format(&#039;truetype&#039;);
font-weight: bold;
}

@font-face {
font-family: &#039;Komika Display Kaps&#039;;
src: local(&#039;Komika Display Kaps Regular&#039;),
&nbsp;&nbsp;&nbsp;&nbsp; local(&#039;KomikaDisplayKaps-Regular&#039;),
&nbsp;&nbsp;&nbsp;&nbsp; url(&#039;Komika_display_kaps.ttf&#039;) format(&#039;truetype&#039;);
}

@font-face {
font-family: &#039;Komika Display Kaps&#039;;
src: local(&#039;Komika Display Kaps Bold&#039;),
&nbsp;&nbsp;&nbsp;&nbsp; local(&#039;KomikaDisplayKaps-Bold&#039;),
&nbsp;&nbsp;&nbsp;&nbsp; url(&#039;Komika_display_kaps_bold.ttf&#039;) format(&#039;truetype&#039;);
font-weight: bold;
}
</code></pre><br />
ok, now that you have defined your font, you can use it.</p>
<p><pre><code>body {
&nbsp;&nbsp;font-family: Komika Display Kaps, sans-serif;
}
</code></pre></p>
<p>And here&#8217;s what it looks like:</p>
<div class="font_face_demo">This should be the demo font face</div>
<p>The second part of this tutorial is should you use font-face?</p>
<p>This is another call to your server, which when u have a huge website, isn&#8217;t a great thing. But compared to most things on a website, this size is tiny.</p>
<p>You have to consider too, for the designers who need the exact font everywhere this is a better alternative than to cut images for every heading on the website, or for the nav. And bonus! The text is still crawl-able by search engines. </p>


<p>Related posts:<ol><li><a href='http://www.dinnermint.org/css/using-css3s-target-pseudo-class-to-make-a-slideshow/' rel='bookmark' title='Permanent Link: Using CSS3&#8242;s :target pseudo-class to Make a Slideshow'>Using CSS3&#8242;s :target pseudo-class to Make a Slideshow</a></li>
<li><a href='http://www.dinnermint.org/html/doctype-html/' rel='bookmark' title='Permanent Link: &lt;!DOCTYPE HTML&gt;'>&lt;!DOCTYPE HTML&gt;</a></li>
<li><a href='http://www.dinnermint.org/tutorial/css3-text-rotation-clock/' rel='bookmark' title='Permanent Link: CSS Text Rotation Clock'>CSS Text Rotation Clock</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dinnermint.org/tutorial/css3-font-face/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Targeting IE6 for style</title>
		<link>http://www.dinnermint.org/tutorial/targeting-ie6-with-html-css/</link>
		<comments>http://www.dinnermint.org/tutorial/targeting-ie6-with-html-css/#comments</comments>
		<pubDate>Sun, 31 May 2009 16:35:18 +0000</pubDate>
		<dc:creator>Jon Rohan</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[web standards]]></category>

		<guid isPermaLink="false">http://www.dinnermint.org/?p=1629</guid>
		<description><![CDATA[I wanted to share with you my preferred method of targeting CSS to IE6. Conditional Comments &#60;!-- This is the main stylesheet --&#62; &#60;link rel=&#34;stylesheet&#34; href=&#34;http://www.example.com/css/global.css&#34; type=&#34;text/css&#34; media=&#34;screen&#34;/&#62; &#60;!--[if IE 6]&#62; &#60;!-- This contains ie6 specific overrides --&#62; &#60;link rel=&#34;stylesheet&#34; href=&#34;http://www.example.com/css/ie6.css&#34; type=&#34;text/css&#34; media=&#34;screen&#34;/&#62; &#60;![endif]--&#62; &#60;!--[if IE 7]&#62; &#60;!-- This contains ie7 specific overrides --&#62; &#60;link [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to share with you my preferred method of targeting CSS to IE6.</p>
<p><strong>Conditional Comments</strong></p>
<p><pre><code>&lt;!-- This is the main stylesheet --&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;http://www.example.com/css/global.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot;/&gt;
&lt;!--[if IE 6]&gt;
&lt;!-- This contains ie6 specific overrides --&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;http://www.example.com/css/ie6.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot;/&gt;
&lt;![endif]--&gt;
&lt;!--[if IE 7]&gt;
&lt;!-- This contains ie7 specific overrides --&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;http://www.example.com/css/ie7.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot;/&gt;
&lt;![endif]--&gt;
&lt;!--[if IE 8]&gt;
&lt;!-- This contains ie8 specific overrides --&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;http://www.example.com/css/ie8.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot;/&gt;
&lt;![endif]--&gt;
</code></pre></p>
<p>I prefer this method because it keeps the CSS cleaner, and when the apocalypse hits and IE6 is no longer relevant it&#8217;s easy to remove code specific to IE6. </p>
<p>The idea behind this method is, you would write your code how you normally would for any standards compliant browser. Then you would go back and  in the ie6.css sheet you would add &#8220;overrides&#8221;. Because CSS (Cascading Style Sheets) is by design built so that style classes lower on the page take higher priority, this should fix your issue.</p>
<p>So you would put something like this in your global.css<br />
<pre><code>.textarea {
&nbsp;&nbsp; border: 1px solid #000;
&nbsp;&nbsp; padding: 3px 5px;
&nbsp;&nbsp; margin: 5px;
}
</code></pre></p>
<p>and you would put this in your ie6.css<br />
<pre><code>.textarea {
&nbsp;&nbsp; border: 1px solid #FF0000;
}
</code></pre></p>
<p>The margin and padding properties are inherited so all you are changing is the border color. And it only occurs in IE6 because of the Conditional Comments.</p>
<p>What is your preferred IE targeting method? Leave a comment below.</p>


<p>Related posts:<ol><li><a href='http://www.dinnermint.org/html/getting-started-with-html-5/' rel='bookmark' title='Permanent Link: Getting Started with HTML 5'>Getting Started with HTML 5</a></li>
<li><a href='http://www.dinnermint.org/css/creating-triangles-in-css/' rel='bookmark' title='Permanent Link: Creating Triangles in CSS'>Creating Triangles in CSS</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dinnermint.org/tutorial/targeting-ie6-with-html-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
