<?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 Accidental Developer &#187; CSS</title>
	<atom:link href="http://osric.com/chris/accidental-developer/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://osric.com/chris/accidental-developer</link>
	<description>What if Gregor Samsa awoke a computer programmer?</description>
	<lastBuildDate>Mon, 30 Apr 2012 21:16:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>CSS Sprites and Accessibility</title>
		<link>http://osric.com/chris/accidental-developer/2011/08/css-sprites-and-accessibility/</link>
		<comments>http://osric.com/chris/accidental-developer/2011/08/css-sprites-and-accessibility/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 03:11:00 +0000</pubDate>
		<dc:creator>Chris Herdt</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[accessibility]]></category>
		<category><![CDATA[bandwidth]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[sprites]]></category>

		<guid isPermaLink="false">http://osric.com/chris/accidental-developer/?p=438</guid>
		<description><![CDATA[Yahoo&#8217;s Best Practices for Speeding Up Your Web Site lists minimizing HTTP requests as the very first recommendation. One of the ways they suggest doing that is by using CSS sprites (which I mentioned previously in Clever Ways to Save Bandwidth). I recently applied this technique to a series of social media icons. Here&#8217;s an [...]]]></description>
			<content:encoded><![CDATA[<p>Yahoo&#8217;s <a href="http://developer.yahoo.com/performance/rules.html">Best Practices for Speeding Up Your Web Site</a> lists minimizing HTTP requests as the very first recommendation. One of the ways they suggest doing that is by using CSS sprites (which I mentioned previously in <a href="http://osric.com/chris/accidental-developer/2008/03/clever-ways-to-save-bandwidth/">Clever Ways to Save Bandwidth</a>).</p>
<p>I recently applied this technique to a series of social media icons. Here&#8217;s an example:<br />
<a href="http://osric.com/chris/css-sprites-social-media-icons-example.html" title="Social media icons CSS sprites example" target="_blank">http://osric.com/chris/css-sprites-social-media-icons-example.html</a></p>
<p>The example page uses a single image to display 8 separate icons from the following single image:</p>
<p><img src="http://osric.com/chris/images/social-media-icons.png" alt="CSS sprites of social media icons" /></p>
<p>Be careful when using background images as links. <span id="more-438"></span> Since there is nothing inside the anchor element, what appears if the image fails to load, or if the user agent is a screen reader? I added descriptive text to the title attribute of the anchor element. According to Dive Into Accessibility&#8217;s <a href="http://diveintoaccessibility.org/day_14_adding_titles_to_links.html" target="_blank">Adding Titles to Links</a>, reading the title attribute is an optional feature in the JAWS screen reader that is not enabled by default. I tested it using  a recent demo version of JAWS 12, and it read the title attributes without any settings adjustments. However, in a text-based browser, or with CSS or images disabled, the links will be completely invisible.</p>
<p>Google, in the following example, uses icons in conjunction with text. The icons add to the experience, but the site is still fully functional without the images:<br />
<img src="http://osric.com/chris/accidental-developer/wp-content/uploads/2011/08/google-search-options.png" alt="Partial screenshot of Google's search options" /></p>
<p>What is the gain from this effort to speed up a site?</p>
<p>There&#8217;s the reduction in file size&#8211;from 20.3 kB to 3.98 kB in my social media icon example, just 20% of the original file size&#8211;although part of that is due to a reduction in the overall number of colors. 8-bit images can have at most 256 colors, so the 8 icons share all 256, and are consequently not as true to the originals. Using CSS sprites for logos of different shapes and sizes, or for informational icons, might be a better use since the color palette would be shared.</p>
<p>Google&#8217;s sprites are again a good example that combines both logos and informational icons:<br />
<img src="http://osric.com/chris/accidental-developer/wp-content/uploads/2011/08/google-nav_logo83.png" alt="Google's CSS sprites" /></p>
<p>In kilobytes it is still a small savings compared to the bandwidth requirements of most of today&#8217;s pages. The savings are just for the initial page load though, because the browser will use cached images on subsequent loads. The user agent still makes a call to the server with every request, thought the server will reply with a short message (<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5">304 Not Modified</a>).</p>
<p>There&#8217;s still a round-trip between client and server. How long does that take? From my high-speed connection, only a couple milliseconds. From a mobile device? I haven&#8217;t tested it, although it is worth trying. The speeds on my G4 mobile device are still excruciatingly slow, so improving speed to mobile devices would go a long way to improving the mobile experience.</p>
<p>Overall, using CSS sprites seems like a trivial savings&#8211;one that the user will not notice, one that the server can manage, one that makes the images more difficult to maintain, and one that may reduce accessibility. If your site has extremely high traffic volumes it might be worthwhile to reduce the number of requests to the server, but overall it doesn&#8217;t appear to be particularly effective. Feel free to disagree in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://osric.com/chris/accidental-developer/2011/08/css-sprites-and-accessibility/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Typography on the Web</title>
		<link>http://osric.com/chris/accidental-developer/2009/10/typography-on-the-web/</link>
		<comments>http://osric.com/chris/accidental-developer/2009/10/typography-on-the-web/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 22:08:51 +0000</pubDate>
		<dc:creator>Chris Herdt</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[font replacement]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[sifr]]></category>
		<category><![CDATA[typekit]]></category>
		<category><![CDATA[typography]]></category>

		<guid isPermaLink="false">http://osric.com/chris/accidental-developer/?p=242</guid>
		<description><![CDATA[In spite of my fondness for typography, I have always been fairly antagonistic towards web typography &#8220;solutions&#8221; like sIFR. Sure, it&#8217;s a better idea than using a GIF file for every headline, but is it really necessary? I&#8217;m skeptical. What is it buying you, and at what cost? What&#8217;s the return on investment? Is it [...]]]></description>
			<content:encoded><![CDATA[<p>In spite of my fondness for typography, I have always been fairly antagonistic towards web typography &#8220;solutions&#8221; like <a href="http://www.mikeindustries.com/blog/sifr/">sIFR</a>. Sure, it&#8217;s a better idea than using a GIF file for every headline, but is it really necessary?</p>
<p>I&#8217;m skeptical. What is it buying you, and at what cost? What&#8217;s the return on investment? Is it improving conversions, improving customer/reader loyalty?</p>
<p>To me, content is king. I&#8217;ve visited, bookmarked, and returned to many web sites that are no-frills black-text-on-a-white-background. I remember fondly the days of <a href="http://en.wikipedia.org/wiki/Gopher_%28protocol%29">Gopher</a>, shortly before the rise of the World-Wide Web: all information, and <em>no waste</em>.</p>
<p>Let&#8217;s say there are 3 kinds of people in the world:</p>
<ol>
<li>Graphic Designers</li>
<li>Computer Programmers</li>
<li>Everyone Else</li>
</ol>
<p>Let&#8217;s look at these groups from the bottom-up:<br />
<span id="more-242"></span><br />
<strong>Everyone Else</strong><br />
These people don&#8217;t really know or care about typefaces. They are likely to stick with whatever default font is selected in Microsoft Office. To Everyone Else, there are 3 fonts in the world: Serif, Sans Serif, and Illegible.</p>
<p>(There is a curious subset of Everyone Else, known as Human Resources Managers. These cheery folks recognize 2 fonts: Comic Sans and Stodgy.)</p>
<p><strong>Computer Programmers</strong><br />
These people know that there are many different font files on their computers, and that some are TrueType and some are PostScript. To Computer Programmers, there are 4 fonts in the world: Serif, Sans Serif, Monotype, and Illegible.</p>
<p><strong>Graphic Designers</strong><br />
Graphic designers love type. They are well-versed in the <a href="http://www.fontshop.com/help/glossary.php">anatomy of a typeface</a>, and speak lovingly of typeface designer Eric Gill. They can identify by sight 20,000 different fonts, and have probably designed several themselves.</p>
<p>On the web, you can be fairly certain that a given user will have Arial or Helvetica (sans serif), and some variant of Times (serif). There are a few others, but basically you tend to focus on serif and sans serif. You can adjust various type properties via CSS: font sizes, colors, leading (that&#8217;s the space between lines), and even letter-spacing. Take a look at <a href="http://www.3point7designs.com/blog/2008/06/10-examples-of-beautiful-css-typography-and-how-they-did-it/">10 Examples of Beautiful CSS Typography and how they did it</a> to see some interesting examples.</p>
<p>At the recent <a href="http://wordcampbirmingham.org/">WordCamp Birmingham</a>, I caught <a href="http://www.sara-cannon.com/">Sara Cannon&#8217;s</a> presentation on Branding WordPress. She talked about sIFR, and I thought that, perhaps for the sake of peace and brotherhood, I should go ahead and use sIFR and play around with some funky type. The sIFR text is selectable as text. It&#8217;s not as bloated as you might think&#8211;even the SWF file containing the specific fonts can be optimized to only include the characters you need&#8211;and even though it uses Flash, it is used to enhance the page on Flash-capable browsers. For everyone else, it still appears as regular HTML type.</p>
<p>Other folks at the conference (including <a href="http://www.studionashvegas.com/">Mitch Canter</a>) mentioned <a href="http://www.typekit.com/">TypeKit</a>, a web-based service, as an alternative to sIFR. I decided to try it on this blog by using a couple fonts with a little more character for the title and headings. I think the typefaces I picked might have a little too much character&#8211;they are falling into my <em>Illegible</em> category&#8211;but it works, and it&#8217;s easy.</p>
]]></content:encoded>
			<wfw:commentRss>http://osric.com/chris/accidental-developer/2009/10/typography-on-the-web/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

