<?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>The Book and the Cover &#187; css</title>
	<atom:link href="http://benjaminsterling.com/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://benjaminsterling.com</link>
	<description>Ok, you did not judge the book by it&#039;s cover, great.  Now, read the whole thing before passing judgment.</description>
	<lastBuildDate>Tue, 24 Mar 2009 19:25:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Blog News Ticker</title>
		<link>http://benjaminsterling.com/blog-news-ticker/</link>
		<comments>http://benjaminsterling.com/blog-news-ticker/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 16:00:44 +0000</pubDate>
		<dc:creator>Benjamin Sterling</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://benjaminsterling.com/?p=118</guid>
		<description><![CDATA[Recently I had been asked to help put together a post scroller widget for a WordPress install but sadly after it was nearly completed it was agreed that it would not "fit" the site it was meant for.  And it is true, some sites, depending on who the site is meant for - the [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had been asked to help put together a post scroller widget for a WordPress install but sadly after it was nearly completed it was agreed that it would not "fit" the site it was meant for.  And it is true, some sites, depending on who the site is meant for - the targeted audience - or what the main topic of the site really don't need bells and whistles to get content in front of their users.  Since I did not want all that work go to waste I figured I'd write up a post on the code and thought processes.</p>
<h3>Ideals</h3>
<p>I firmly believe that a site should still be functional, 508 compliant and still look good when styles and JavaScript are turned off.  With this in mind we will be doing some "progressive enhancements" and since there is going to very little that won't work in all browsers I won't go into my rant about <abbr title="progressive enhancements">PE</abbr>.</p>
<h3>Structure</h3>
<p>We will be using Definition lists; why definition lists?  Because they are semantically correct for this situation.  Have a look at two really good articles from <a href="http://css-tricks.com/utilizing-the-underused-but-semantically-awesome-definition-list/">Css-tricks.com</a> and <a href="http://www.maxdesign.com.au/presentation/definition/">Maxdesign.com</a> which go into detail on why you should use definition lists.</p>
<p>Below is the structure we will be dealing with, notice that we only have the DL/DT/DD structure and now wrapping DIV or any other extra mark up:</p>
<div class="igBar"><span id="lhtml-3"><a href="#" onclick="javascript:showPlainTxt('html-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-3">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/h3.html"><span style="color: #000000; font-weight: bold;">&lt;h3&gt;</span></a></span>Our News<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h3&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/dl.html"><span style="color: #000000; font-weight: bold;">&lt;dl</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"newsScroller"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/dt.html"><span style="color: #000000; font-weight: bold;">&lt;dt&gt;</span></a></span>Title<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dt&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/dd.html"><span style="color: #000000; font-weight: bold;">&lt;dd&gt;</span></a></span>Excerpt<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dd&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/dd.html"><span style="color: #000000; font-weight: bold;">&lt;dd&gt;</span></a></span>Date<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dd&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/dd.html"><span style="color: #000000; font-weight: bold;">&lt;dd&gt;</span></a></span>Tags and comment count<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dd&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dl&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>With <abbr title="progressive enhancements">PE</abbr> in mind, we will use JavaScript to add in any additional mark up we will need to achieve the scroller look.</p>
<p><a class="example {h:400,w:600}" data="" title="example" target="_blank" href="/wp-content/files/newsScroller.htm">Current Progress</a></p>
<p>The content from our current progress is from a dump I did of my own site using WordPress' loop.</p>
<h3>Styling</h3>
<p>In our next layer of PE will are going to add in some style simple based off of the current structure minus the JavaScript.</p>
<p><a class="example {h:400,w:600}" data="" title="example" target="_blank" href="/wp-content/files/newsScroller2.htm">Current Progress</a></p>
<p>In this phase we really did not do anything special, I just styled it as I would have normally.  You can add more pop to it if you feel.  Do note however, that at line 28 I am using a selector that <abbr title="Internet Explore 6">IE6</abbr> does not support and since the extra padding for that element is a nice to have and really does not hold the user of IE6 back I felt it was ok to add that in there.</p>
<div class="igBar"><span id="lcss-4"><a href="#" onclick="javascript:showPlainTxt('css-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-4">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">dl#newsScroller dd + dd<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; padding<span style="color: #3333ff;">:<span style="color: #cc66cc;color:#800000;">0</span> </span><span style="color: #cc66cc;color:#800000;">0</span> <span style="color: #cc66cc;color:#800000;">0</span> 22px;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>JavaScript</h3>
<p>Now we start with the real fun, using JavaScript - in this instance, jQuery as our framework of choice, but you can just as easily use MooTools or DoJo - to add in some WOW factor.  Here the plan is to wrap the DL in a DIV, add some classes to some elements, set up some events, and animations.</p>
<p>What we have in the example just below is some additional styles and elements.</p>
<p><a class="example {h:400,w:600}" data="" title="example" target="_blank" href="/wp-content/files/newsScroller3.htm">Current Progress</a></p>
<p>Finally we have to set up the events and animation; what events do we need to set up and why? We need to bind the <em>mouseenter</em> and <em>mouseleave</em> event because if we want to be able to read what is being shown we need to be able to put our mouse over the content and have it stop any animations that are running so we can read it.</p>
<p>First thing we will need to do is to find out the total height of the grouped content is.  The grouped content in this case is the <em>DT/DD/DD/DD</em> combination.  We will be using the <em>outerHeight()</em> method to get the total height (padding/margin/height). To get that grouped content we will be using a combination of <em>.children()</em> and <em>.slice().</em></p>
<p><a class="example {h:400,w:600}" data="" title="example" target="_blank" href="/wp-content/files/newsScroller4.htm">Final</a></p>
<p><a class="thecode {h:400,w:600}" data="" title="example" target="_blank" href="/wp-content/files/newsScroller4.txt">Final</a></p>
<h3>Closing</h3>
<p>So with the final product we have a decent footprint to stylize to your likings.  Feel free to stylize it, add new functionality, new animation - some easin/easeout effects would look nice.  Think outside of the box, just make sure it degrades nicely.</p>
]]></content:encoded>
			<wfw:commentRss>http://benjaminsterling.com/blog-news-ticker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notices, what notices?</title>
		<link>http://benjaminsterling.com/notices-what-notices/</link>
		<comments>http://benjaminsterling.com/notices-what-notices/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 18:00:56 +0000</pubDate>
		<dc:creator>Benjamin Sterling</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://benjaminsterling.com/?p=112</guid>
		<description><![CDATA[I've been using Blueprint css framework for a bit now mainly for the typography structure it provides.  But lately I've been investigating the rest of the framework.  Just a few weeks ago I noticed some of the default classes it has for forms error, notice and success.
Although they do and look like you would expect [...]]]></description>
			<content:encoded><![CDATA[<p>I've been using Blueprint css framework for a bit now mainly for the typography structure it provides.  But lately I've been investigating the rest of the framework.  Just a few weeks ago I noticed some of the default classes it has for forms <em>error</em>, <em>notice </em>and <em>success</em>.</p>
<p>Although they do and look like you would expect I decided to add a little flare to them.</p>
<h3>The Look</h3>
<p><img class="aligncenter size-full wp-image-115" title="error_notice" src="http://benjaminsterling.com/wp-content/uploads/2008/11/error_notice.png" alt="" width="553" height="59" /></p>
<p><img class="aligncenter size-full wp-image-115" title="notice_notice" src="http://benjaminsterling.com/wp-content/uploads/2008/11/notice_notice.png" alt="" width="553" height="70" /></p>
<p><img class="aligncenter size-full wp-image-115" title="success_notice" src="http://benjaminsterling.com/wp-content/uploads/2008/11/success_notice.png" alt="" width="553" height="70" /></p>
<h3>The Code</h3>
<div class="igBar"><span id="lcss-6"><a href="#" onclick="javascript:showPlainTxt('css-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-6">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.error, .notice, <span style="color: #6666ff;">.success </span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding</span>:.8em;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin-bottom</span>:1em;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; border<span style="color: #3333ff;">:2px </span>solid #ddd;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding-left</span>:5em;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; -moz-border-radius: <span style="color: #cc66cc;color:#800000;">0</span> 10px <span style="color: #cc66cc;color:#800000;">0</span> 10px;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; -webkit-border-radius: <span style="color: #cc66cc;color:#800000;">0</span> 10px <span style="color: #cc66cc;color:#800000;">0</span> 10px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #6666ff;">.error </span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:#FBE3E4 <span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span>../img/cancel_48.png<span style="color: #66cc66;">&#41;</span> <span style="color: #993333;">no-repeat</span> 15px <span style="color: #993333;">center</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span>:#8a1f11;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-color</span>:#FBC2C4;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #6666ff;">.notice </span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:#FFF6BF <span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span>../img/warning_48.png<span style="color: #66cc66;">&#41;</span> <span style="color: #993333;">no-repeat</span> 15px <span style="color: #993333;">center</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span>:#514721;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-color</span>:#FFD324;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #6666ff;">.success </span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:#E6EFC2 <span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span>../img/accepted_48.png<span style="color: #66cc66;">&#41;</span> <span style="color: #993333;">no-repeat</span> 15px <span style="color: #993333;">center</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span>:#264409;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-color</span>:#C6D880;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>The Closing</h3>
<p>Someone once told me, when optimizing my images for the web from Photoshop or Fireworks, don't use the default values.  I think the same should be said about using any of these css frameworks that are out there.  Get into the code and 1) learn what's going on and 2) experiment with the default values.  You will be glad you did.</p>
<p><strong>Credits</strong></p>
<ul>
<li>Icons from <a href="http://wefunction.com/2008/07/function-free-icon-set/">WeFunction</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://benjaminsterling.com/notices-what-notices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using EM for Font Size: learning on the go</title>
		<link>http://benjaminsterling.com/using-em-for-font-size-learning-on-the-go/</link>
		<comments>http://benjaminsterling.com/using-em-for-font-size-learning-on-the-go/#comments</comments>
		<pubDate>Tue, 27 Nov 2007 18:00:28 +0000</pubDate>
		<dc:creator>Benjamin Sterling</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[em]]></category>
		<category><![CDATA[layout]]></category>

		<guid isPermaLink="false">http://benjaminsterling.com/2007/11/27/using-em-for-font-size-learning-on-the-go/</guid>
		<description><![CDATA[With my current design and layout I am trying to use EM for my font size so that it will expand correctly when an end user resizes their font.  The problem is, I am not using it correctly; I thought I knew, but I am sadly mistake.  As you can tell by some [...]]]></description>
			<content:encoded><![CDATA[<p>With my current design and layout I am trying to use EM for my font size so that it will expand correctly when an end user resizes their font.  The problem is, I am not using it correctly; I thought I knew, but I am sadly mistake.  As you can tell by some crazy looking fonts here and there that I am not fully grasping how to truly implement EM.  So to fix that issue I figured that I might as well do some research and fix the issue.</p>
<p>I started out by doing a search for "css em;" yes, it was that simple to get started.  The results varied from good to bad and the way I weeded out the bad was the way probably most users weed out a bad site, The Design.  After that, if I did not understand what the person was saying after the second paragraph, I moved on to the next site.  What I end up with was a few that really made it clear to me what and how to use the EM in css.   I am just going to post some quotes that I thought made things clear to me with a link to the site for you to get the full scope of the article.</p>
<p>The first site I came across what <a href="http://mondaybynoon.com/2006/03/13/effective-style-with-em/" target="_blank">Monday By Noon</a>, they themselves point to a few articles that were pretty good.  The first ten paragraphs were about why not use PX, %, or EX.  Although they were good, I was only interested in learning how to properly use EM so I only skimmed them.  The "Putting em to Use" was the most informative to me with regards to the article.</p>
<blockquote><p>...using em units for font-size is dependent on the font size of parent elements. This is the most important concept to grasp when using em to scale text, and most often confusing to early adopters.</p></blockquote>
<p>Those two sentences made the most sense and really put things into perspective.</p>
<blockquote><p>In order to keep from being confused, it is often a good idea to keep font-size declarations to a minimum. Once the font-size is defined in the body, you should only continue to define where needed due to the fact that em font-sizes are relative to parent elements.</p></blockquote>
<p>As you can tell from my current site, I am not following that advice.  When dealing with PX, I found myself giving everything a size and when moving to EM I was doing the same thing and really started frustrating me because some lines would be huge where others are the way I wanted.</p>
<p>The comments were where I really started to get some good information.  The best comment and most informative was:</p>
<blockquote><p>...em scaling is inherited from its containers, in the case you mentioned, its like saying set all the body text to .81em, then set the table cell to .75em of this, so it is the correct and logical behaviour. What you want is text 6% smaller that the body text so set the td text to .94 em.</p></blockquote>
<p>I would suggest that you do have a read of the comments, very very informative.  That site again is  <a href="http://mondaybynoon.com/2006/03/13/effective-style-with-em/" target="_blank">mondaybynoon.com.</a></p>
<p>Site number 2 that was very usefull is  <a href="http://jontangerine.com/log/2007/09/the-incredible-em-and-elastic-layouts-with-css" target="_blank">Jon Tangerine</a>; this one may be information overload, so take it piece by piece.  He goes over how to convert your PX size to Em size while taking into account the size of the parent element.  He also take using EM to the next level by using it with the complete layout of the site; margins, paddings, line height, and images are all using EM to keep their size relative when the end user resizes their text.</p>
<blockquote><p>Margin, line height, padding etc. in ems are all relative to the font size of the element they belong to.</p>
<p>Ems allow only three decimal places. More is fine in calculations but before writing CSS, round it up to three</p></blockquote>
<p>He really explains the EM thing real well, have a read at it at <a href="http://jontangerine.com/log/2007/09/the-incredible-em-and-elastic-layouts-with-css" target="_blank">http://jontangerine.com/</a></p>
<p>Last but now least, here is a site you should bookmark, <a href="http://riddle.pl/emcalc/" target="_blank">http://riddle.pl/emcalc/</a>; it will save you time when needing to figure out what 23px equates to in em.</p>
<p>I personally will be using the information found and putting it to good use, so look for some layout changes to this site as I experiment.</p>
]]></content:encoded>
			<wfw:commentRss>http://benjaminsterling.com/using-em-for-font-size-learning-on-the-go/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Accessible and Search Engine Friendly Image Rollover with CSS and Sprites</title>
		<link>http://benjaminsterling.com/accessible-and-search-engine-friendly-image-rollover-with-css-and-sprites/</link>
		<comments>http://benjaminsterling.com/accessible-and-search-engine-friendly-image-rollover-with-css-and-sprites/#comments</comments>
		<pubDate>Wed, 21 Nov 2007 04:09:09 +0000</pubDate>
		<dc:creator>Benjamin Sterling</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[accessible]]></category>
		<category><![CDATA[image replacement]]></category>
		<category><![CDATA[image rollover]]></category>
		<category><![CDATA[search engine friendly]]></category>

		<guid isPermaLink="false">http://benjaminsterling.com/2007/11/21/accessible-and-search-engine-friendly-image-rollover-with-css-and-sprites/</guid>
		<description><![CDATA[I've been using StumbleUpon  for a few weeks now and have found a ton of sites that have given me a ton of knowledge, some that have confirmed my thoughts of quite a few things and sites that just made me shake my head at.
One such site was talking about CSS Image Rollovers and [...]]]></description>
			<content:encoded><![CDATA[<p>I've been using <a href="http://emevas1977.stumbleupon.com/" rel="nofollow">StumbleUpon </a> for a few weeks now and have found a ton of sites that have given me a ton of knowledge, some that have confirmed my thoughts of quite a few things and sites that just made me shake my head at.</p>
<p>One such site was talking about CSS Image Rollovers and their examples consisted of a &lt;A&gt; tag wrapping a none breaking line space, I won't post a link because I have actually seen quite a few other sites doing the same thing and don't want to single anyone out.  But what really made me frustrated is this particular site had a least 50 comments saying how great this was.  While I don't consider myself an expert there are a few things I truly believe in: clean code and accessibility.  As it stands now, my blog is not 100% accessible, there are things I need to do to make it better, and those things are in the works.</p>
<p>So, what I would like to do is show you a way of making image rollovers while being accessible, and  search engine friendly.</p>
<p>Say we have an image sprite like below (we can cover the pros and cons of image sprites in another post, these icons can be found at <a href="http://utombox.com/my-works/" target="_blank" rel="external">http://utombox.com/my-works/</a>):</p>
<p><img src="http://lh4.google.com/sterling.benjamin/R0OjFT33SsI/AAAAAAAAAkk/urjDwTHG8yk/s400/imageRollover.png"/></p>
<p><strong>The style sheet code:</strong></p>
<div class="igBar"><span id="lcss-9"><a href="#" onclick="javascript:showPlainTxt('css-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-9">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.<span style="color: #993333;">icon</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span>:-moz-inline-box;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span>:inline-<span style="color: #993333;">block</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">overflow</span>:<span style="color: #993333;">hidden</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:<span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span>imageRollover.png<span style="color: #66cc66;">&#41;</span> <span style="color: #993333;">no-repeat</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">text-indent</span>: -3000px;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; *<span style="color: #000000; font-weight: bold;">text-indent</span>:0px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font</span>:<span style="color: #cc66cc;color:#800000;">0</span>/<span style="color: #cc66cc;color:#800000;">0</span> Arial;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span>:rgba<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">255</span>,<span style="color: #cc66cc;color:#800000;">255</span>,<span style="color: #cc66cc;color:#800000;">255</span>,<span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">vertical-align</span>:<span style="color: #000000; font-weight: bold;">bottom</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span>:100px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span>:100px;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.iconYouTube<span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">:hover.iconYouTube<span style="color: #66cc66;">&#123;</span>background-position<span style="color: #3333ff;">:-200px </span>0px;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.iconFlickr<span style="color: #66cc66;">&#123;</span>background-position<span style="color: #3333ff;">:-100px </span>0px;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">:hover.iconFlickr<span style="color: #66cc66;">&#123;</span>background-position<span style="color: #3333ff;">:-300px </span>0px;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.iconRss<span style="color: #66cc66;">&#123;</span>background-position<span style="color: #3333ff;">:0px </span>-100px;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">:hover.iconRss<span style="color: #66cc66;">&#123;</span>background-position<span style="color: #3333ff;">:-200px </span>-100px;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.iconFeedburner<span style="color: #66cc66;">&#123;</span>background-position<span style="color: #3333ff;">:0px </span>-200px;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">:hover.iconFeedburner<span style="color: #66cc66;">&#123;</span>background-position<span style="color: #3333ff;">:-200px </span>-200px;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.iconDelicious<span style="color: #66cc66;">&#123;</span>background-position<span style="color: #3333ff;">:-100px </span>-200px;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">:hover.iconDelicious<span style="color: #66cc66;">&#123;</span>background-position<span style="color: #3333ff;">:-300px </span>-200px;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.iconTechnorati<span style="color: #66cc66;">&#123;</span>background-position<span style="color: #3333ff;">:-100px </span>-100px;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">:hover.iconTechnorati<span style="color: #66cc66;">&#123;</span>background-position<span style="color: #3333ff;">:-300px </span>-100px;<span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><br/><br />
<strong>The Html code:</strong></p>
<div class="igBar"><span id="lhtml-10"><a href="#" onclick="javascript:showPlainTxt('html-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-10">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">&lt;a</span></a> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">""</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">"youtube icon"</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"icon iconYouTube"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>youtube icon<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">&lt;a</span></a> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">""</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">"flickr icon"</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"icon iconFlickr"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>flickr icon<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">&lt;a</span></a> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">""</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">"rss icon"</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"icon iconRss"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>rss icon<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">&lt;a</span></a> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">""</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">"feedburner icon"</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"icon iconFeedburner"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>feedburner icon<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">&lt;a</span></a> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">""</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">"delicious icon"</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"icon iconDelicious"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>delicious icon<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">&lt;a</span></a> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">""</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">"technorati icon"</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"icon iconTechnorati"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>technorati icon<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><br/><br />
<strong>The outcome:</strong></p>
<style>.icon{display:-moz-inline-box !important; display:inline-block !important; overflow:hidden !important; background:url(http://lh4.google.com/sterling.benjamin/R0OjFT33SsI/AAAAAAAAAkk/urjDwTHG8yk/s400/imageRollover.png) no-repeat; text-indent: -3000px; *text-indent:0px;font:0/0 Arial  !important; color:rgba(255,255,255,0) !important;vertical-align:bottom !important;width:100px !important;height:100px !important;} .iconYouTube{} :hover.iconYouTube{background-position:-200px 0px;} .iconFlickr{background-position:-100px 0px;} :hover.iconFlickr{background-position:-300px 0px;} .iconRss{background-position:0px -100px;} :hover.iconRss{background-position:-200px -100px;} .iconFeedburner{background-position:0px -200px;} :hover.iconFeedburner{background-position:-200px -200px;} .iconDelicious{background-position:-100px -200px;} :hover.iconDelicious{background-position:-300px -200px;} .iconTechnorati{background-position:-100px -100px;} :hover.iconTechnorati{background-position:-300px -100px;}</style>
<p><a href="" title="youtube icon" class="icon iconYouTube">youtube icon</a><a href="" title="flickr icon" class="icon iconFlickr">flickr icon</a><a href="" title="rss icon" class="icon iconRss">rss icon</a><a href="" title="feedburner icon" class="icon iconFeedburner">feedburner icon</a><a href="" title="delicious icon" class="icon iconDelicious">delicious icon</a><a href="" title="technorati icon" class="icon iconTechnorati">technorati icon</a></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-9213319579769471";
//between 1
google_ad_slot = "9115797393";
google_ad_width = 400;
google_ad_height = 15;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p><br/><br />
<strong>The Explanation:</strong><br />
Lets start off with the easy things to explain; in the instance above I am using an <a href="http://www.alistapart.com/articles/sprites" target="_blank" rel="nofollow">image sprite</a> which, depending on how many external elements you need to load, will speed up load time.  In the first class <strong>icon</strong> we are setting the background as the sprite and then proceeding classes we simply position the background image to get the desired image showing with both the default image and the hover.</p>
<p>The hard thing to explain, at least for me, is what everything in the <strong>icon</strong> class is doing.  I will try, but if I mess something up, call me on it.</p>
<ul>
<li>
		display</p>
<ul>
<li>-moz-inline-box: for mozilla based browsers</li>
<li>inline-block: supported by IE and all other grade-A browsers</li>
</ul>
</li>
<li>
		overflow</p>
<ul>
<li>hidden: make everything hidden if it is outside the box (ie6, you know I talking about you)</li>
</ul>
</li>
<li>
		background</p>
<ul>
<li>url: ummm... the background image</li>
</ul>
</li>
<li>
		text-indent</p>
<ul>
<li>without *: 	applies to only block-level elements, table cells and inline blocks, since we are using -moz-inline-box, firebox will not use this</li>
<li>with *: IE does not support it correctly, so we set it back to 0</li>
</ul>
</li>
<li>
		font</p>
<ul>
<li>0/0 Arial: this is to set the text to a very small size, there are some browsers that do not support this shorthand, but I can't remember which ones off hand.</li>
</ul>
</li>
<li>
		color</p>
<ul>
<li>rgba(255,255,255,0): this is a css3 spec and is only being supported by safari and firefox 3</li>
</ul>
</li>
<li>
		vertical-align</p>
<ul>
<li>bottom: this is required for block elements to keep them inline with text</li>
</ul>
</li>
</ul>
<p><script type="text/javascript"><!--
google_ad_client = "pub-9213319579769471";
//between 1
google_ad_slot = "9115797393";
google_ad_width = 400;
google_ad_height = 15;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p><br/><br />
<strong>The Small Print:</strong><br />
There are some thing to consider when doing the rollovers or image replacements in general; it is not 100% accessible, meaning, although screen readers will be able to pick it up, people that can see, but have poor vision will not be able to set the font any bigger then what you have in your image.</p>
<p>With that said, have fun with it.  Any questions comments or concerns, feel free to drop a line.</p>
<p><strong>Update 11/21/2007:</strong> Came across a really nice article about <a href="http://css-tricks.com/css-sprites-what-they-are-why-theyre-cool-and-how-to-use-them/">css sprites</a>, very good read.</p>
]]></content:encoded>
			<wfw:commentRss>http://benjaminsterling.com/accessible-and-search-engine-friendly-image-rollover-with-css-and-sprites/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
