<?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>Six Revisions &#187; CSS</title>
	<atom:link href="http://sixrevisions.com/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://sixrevisions.com</link>
	<description></description>
	<lastBuildDate>Wed, 01 Feb 2012 03:46:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>How to Bulletproof @font-face Web Fonts</title>
		<link>http://sixrevisions.com/css/font-face-web-fonts-issues/</link>
		<comments>http://sixrevisions.com/css/font-face-web-fonts-issues/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 10:00:50 +0000</pubDate>
		<dc:creator>Jacob Gube</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://sixrevisions.com/?p=5982</guid>
		<description><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5982&c=1094097268' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5982&c=1094097268' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br />You&#8217;re interviewing for your dream job, and you&#8217;re ready to kick some butt. A small group is gathered around a conference phone and some coding exercises, and they&#8217;re pulling up your portfolio on a projector so that everyone can review it. It looks great, except for one thing: All of your beautiful web fonts are [...]]]></description>
			<content:encoded><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5982&c=676087861' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5982&c=676087861' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br /><p><a href="http://sixrevisions.com/css/font-face-web-fonts-issues/"><img src="http://cdn.sixrevisions.com/0217-01_bulletproofing_fontface_thumbnail.jpg" width="550" height="200" alt="How to Bulletproof @font-face Web Fonts" /></a></p>
<p>You&#8217;re interviewing for your dream job, and you&#8217;re ready to kick some butt. A small group is gathered around a conference phone and some coding exercises, and they&#8217;re pulling up your portfolio on a projector so that everyone can review it.</p>
<p>It looks great, except for one thing: All of your beautiful web fonts are gone and have been replaced with&#8230; Arial.</p>
<p>No, this isn&#8217;t just a bad dream: It actually happened to me recently when I interviewed at a web design company (<a href="http://www.352media.com/" title="352 Media Group web design company">352 Media Group</a>). It was painful. I ended up getting the job anyway, but the experience made me realize that even following best practices recommended by industry-leading developers such as <a target="_blank" href="http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/" title="Bulletproof @font-face syntax - paulirish.com">Paul Irish&#8217;s Bulletproof @font-face syntax</a> and in the current situation where there&#8217;s much wider browser support for <a href="http://sixrevisions.com/css/font-face-guide/" title="The Essential Guide to @font-face">@font-face</a>, web fonts just aren&#8217;t foolproof.</p>
<p><span id="more-5982"></span></p>
<p>Getting them just right on most platforms and browsers takes work. Below, we will discuss some of the common issues with using web fonts.</p>
<h3>Web Fonts Aren&#8217;t Displaying</h3>
<p>The disappearing web font has to do with HTTP response headers.</p>
<p>Firefox and IE treat web fonts a little like JavaScript documents. For security reasons, a website on a different domain generally cannot display a web font that&#8217;s been loaded from another domain. (The Mozilla Developer Network has <a target="_blank" href="https://developer.mozilla.org/En/HTTP_access_control">more information on this policy</a> than you&#8217;d ever want to know.)</p>
<p>In cases were you want to <a target="_blank" href="http://www.w3.org/TR/cors/#access-control-allow-origin-response-hea" title="Cross-Origin Resource Sharing - w3c.org">allow cross-domain access</a> to such files, the server that hosts the files can include an <code>Access-Control-Allow-Origin</code> header in its HTTP responses. This header can specify specific domains that are allowed to access the files, or it can just list an asterisk to let everyone access the files. The <a href="http://sixrevisions.com/web_design/google-font-api-guide/" title="A Guide to Google Font API">Google Font API</a> does the latter, which makes the service available to all websites.</p>
<h4>Workaround for Web Servers that Remove Response Headers</h4>
<p>On some networks &#8212; including, apparently, that of the office where I interviewed &#8212; this header is removed before the response makes it to the web browser. Perhaps an overzealous firewall is to blame. As a result, Firefox and IE refuse to render the web fonts.</p>
<p>Chrome and Safari, on the other hand, happily display the fonts anyway.</p>
<p><img src="http://cdn.sixrevisions.com/0217-02_beauty_of_the_web.png" width="259" height="83" /></p>
<p>Unpredictable networks are a fact of life, but luckily there&#8217;s a way to address them. You can use the <a target="_blank" href="http://code.google.com/apis/webfonts/docs/webfont_loader.html">WebFont Loader</a>, a JavaScript tool that was co-developed by Google and TypeKit to fail over to fonts that are hosted elsewhere where necessary.</p>
<p>The code to fail over to local fonts goes inside your <code>&lt;head&gt;</code> tag and looks something like this:</p>
<pre>
&lt;script&gt;
WebFontConfig = {
  google: { families: ['FontOne', 'FontTwo'] },
    fontinactive: function (fontFamily, fontDescription) {
   <strong>//Something went wrong! Let's load our local fonts.</strong>
    WebFontConfig = {
      custom: { families: ['FontOne', 'FontTwo'],
      urls: ['font-one.css', 'font-two.css']
    }
  };
  loadFonts();
  }
};

function loadFonts() {
  var wf = document.createElement('script');
  wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
    '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
  wf.type = 'text/javascript';
  wf.async = 'true';
  var s = document.getElementsByTagName('script')[0];
  s.parentNode.insertBefore(wf, s);
}

(function () {
  <strong>//Once document is ready, load the fonts.
</strong>  loadFonts();
  })();
&lt;/script&gt;</pre>
<p>If the client is on a network that deletes the <code>Access-Control-Allow-Origin</code> header, her browser will load the font from Google, fail to display it, and then load your locally-hosted font.</p>
<p>This is slower than just loading fonts from Google. Newer versions of Firefox will take a solid three seconds before they give up trying to display the font from Google, but it&#8217;s better than no web fonts at all, and it won&#8217;t affect users who aren&#8217;t on such networks.</p>
<h4>Debugging Response Header Issues with Developer Tools</h4>
<p>If you ever have to troubleshoot a problem like this, the developer tools in most browsers have a Net panel where you can inspect file requests and the associated headers. For example, for Firefox you can use <a href="http://getfirebug.com/" target="_blank">Firebug</a> and for Google Chrome, there&#8217;s <a href="http://code.google.com/chrome/devtools/docs/overview.html" target="_blank">Chrome Developer Tools</a>.</p>
<p>Below is a screenshot of response headers using Firebug. As you can see, the <code>Access-Control-Allow-Origin</code> response header&#8217;s value is set to <code>*</code>, which means the document is able to be requested and rendered from other websites.</p>
<p><img src="http://cdn.sixrevisions.com/0217-03_allow_origin.png" width="550" height="302" /></p>
<h4>Troubleshooting with VPN Services</h4>
<p>VPN services such as <a target="_blank" href="http://www.tunnelbear.com/">TunnelBear</a> are also helpful in troubleshooting these sorts of problems. Because VPNs encrypt all traffic between you and the VPN provider, your local network won&#8217;t be able to mess with your headers.</p>
<p>If the site looks fine through the VPN but breaks when you connect without a VPN, it&#8217;s likely that there&#8217;s a problem with your local network.</p>
<h3>Flash of Unstyled Text (on Slow Internet Connections)</h3>
<p>A slow connection can result in a flash of unstyled text &#8212; what Paul Irish abbreviates as <a target="_blank" href="http://paulirish.com/2009/fighting-the-font-face-fout/#update2011">FOUT</a> &#8212; while your web fonts load.</p>
<p>By default, Safari, Chrome, and IE 6-8 won&#8217;t display text at all until the text&#8217;s associated web font loads.</p>
<p>IE9, on the other hand, will display text in a default font while the web font loads &#8212; even in compatibility mode.</p>
<p>Firefox 3.5 will do the same, but versions 4 and later will <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=499292">wait</a> three seconds for a font to load. If the font still hasn&#8217;t loaded at that point, only then will the browser display unstyled text. A similar &quot;waiting period&quot; is <a target="_blank" href="https://bugs.webkit.org/show_bug.cgi?id=25207">planned</a> for WebKit.</p>
<table width="550" border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="col">Browser</th>
<th scope="col">How It Handles Web Font Loading</th>
</tr>
<tr>
<td>Safari</td>
<td><strong>Won&#8217;t display any text</strong> until web font loads</td>
</tr>
<tr>
<td>Google Chrome</td>
<td><strong>Won&#8217;t display any text</strong> until web font loads</td>
</tr>
<tr>
<td>Internet Explorer 8 and below</td>
<td><strong>Won&#8217;t display any text</strong> until web font loads</td>
</tr>
<tr>
<td>Internet Explorer 9</td>
<td>Displays <strong>default/fallback font</strong> until web font loads</td>
</tr>
<tr>
<td>Firefox 3.5 and below</td>
<td>Displays <strong>default/fallback</strong> font until web font loads</td>
</tr>
<tr>
<td>Firefox 4.0 and up</td>
<td><strong>Waits 3 seconds</strong> for a font to load</td>
</tr>
</table>
<p> You might get a more noticeable FOUT in cases where you have to fail over to a locally-hosted font, but you can hide unstyled text using the WebFont loader, as we&#8217;ll discuss shortly.</p>
<p>It&#8217;s easy to miss such behavior on a fast connection. Most web designers are probably not on dial-up, after all.</p>
<p>Not everyone will have the same experience, though: According to a 2010 <a target="_blank" href="http://pewinternet.org/Reports/2010/Home-Broadband-2010.aspx">survey</a>, 50% of broadband users in the US are subscribed to their ISP&#8217;s basic service. There are still some towns that have <a target="_blank" href="http://www.broadbandmap.gov/download/reports/national-broadband-map-broadband-availability-in-rural-vs-urban-areas.pdf">limited or no broadband Internet access</a>.</p>
<p>The <a target="_blank" href="http://www.broadbandmap.gov/">National Broadband Map</a> can help you figure out whether your users fall into this group. Users outside of the U.S. may have even flakier connections, or they might have great connections but live far from your server. A recent report noted that the average luxury site takes <a target="_blank" href="http://www.webperformancetoday.com/2011/08/02/luxury-web-site-performance-page-load-china/">16.2 seconds</a> to load in China. What will your users see while this happens?</p>
<h4>Simulating a Slow Internet Connection</h4>
<p>There are a variety of tools that can simulate a slow connection so that you can see how your users might experience your site. I personally like <a target="_blank" href="http://www.dallaway.com/sloppy/index.html">Sloppy</a>, which is free, runs on all platforms, and (unlike some other tools) requires no command-line geekery.</p>
<p>A few caveats: redirections and absolute links will send you out of Sloppy&#8217;s slowed-down environment, and browsers often cache these redirections. To be sure that you&#8217;re really getting a slowed-down page, make sure your address bar displays an IP address instead of a domain, and clear your browser&#8217;s cache if you&#8217;re continually getting redirected to a web page other than the one that you specified in Sloppy.</p>
<p><img src="http://cdn.sixrevisions.com/0217-04_sloppy.png" width="437" height="389" /></p>
<p>You can make the FOUT less noticeable in the same way that you&#8217;d <a href="http://sixrevisions.com/web-development/10-ways-to-improve-your-web-page-performance/" title="10 Ways to Improve Your Web Page Performance">tackle other web performance problems</a>: Compress files using gzip, ask browsers to cache the files far into the future, only request the versions of the fonts that you really need, etc. Some delay is inevitable, though.</p>
<p>The WebFont Loader can help here, too. The script applies a CSS class called <code>wf-loading</code> to text for which web fonts haven&#8217;t loaded yet, and you can use this class to force browsers to hide or show unstyled text while web fonts load.</p>
<p>You could even get really granular. Maybe your logo uses a web font, so you don&#8217;t want it to display at all until the font has loaded, but want the content area to display in Arial while web fonts load.</p>
<p>What&#8217;s best for your site depends on how you use web fonts, how different the fonts are from system fonts, and how fast you expect your users&#8217; connections to be.</p>
<h3>Web Fonts Render Inconsistently on Different Operating Systems</h3>
<p>In addition to issues with varied connections and browsers, it&#8217;s also important to consider how fonts are rendered across operating systems.</p>
<p>Mac OS and Windows have <a target="_blank" href="http://www.joelonsoftware.com/items/2007/06/12.html">fundamentally different philosophies</a> when it comes to rendering text. Mac OS uses anti-aliasing to smooth text, while Windows Vista and 7 use a technology called ClearType to render more detailed text. (Read more about ClearType <a href="http://sixrevisions.com/web_design/a-comprehensive-guide-to-microsoft-vista-fonts-for-designers/" title="A Comprehensive Guide to Windows Vista Fonts for Designers">here</a>.)</p>
<h4>Windows Font Rendering</h4>
<p>Windows XP doesn&#8217;t do either (at least by default), and Linux might do any number of things depending on how it&#8217;s configured.</p>
<p>Windows also has two different rendering modes: the newer DirectWrite and the older GDI. The two modes can produce substantially <a target="_blank" href="http://blog.mozilla.com/nattokirai/2011/08/11/directwrite-text-rendering-in-firefox-6/">different results</a>.</p>
<p>IE9 and Firefox use DirectWrite, and they can use hardware acceleration to render pages. If hardware acceleration isn&#8217;t available or has been turned off, fonts don&#8217;t look quite as smooth in these browsers.</p>
<p><img src="http://cdn.sixrevisions.com/0217-05_no_hardware.jpg" width="540" height="282" /></p>
<p>Chrome uses GDI, and Firefox 7 is <a target="_blank" href="http://blog.mozilla.com/nattokirai/2011/08/11/directwrite-text-rendering-in-firefox-6/">slated</a> to use GDI for common fonts such as Arial.</p>
<p>Safari actually lets you switch between Windows-style rendering and Mac OS-style smoothing &#8212; see the &quot;font smoothing&quot; option in the &quot;Appearance&quot; section of the Safari preferences dialog.</p>
<p>Windows Standard uses GDI, while &quot;Light,&quot; &quot;Medium,&quot; and &quot;Strong&quot; mimic Mac OS&#8217;s font rendering. Try toggling between Windows Standard and Medium, and you&#8217;ll see that the font heights switch back and forth. The takeaway here is that the size of text can vary, so it can&#8217;t be relied on to exactly position other elements.</p>
<p>Another variable on Windows is ClearType, which takes advantage of the fact that pixels on LCD screens are comprised of red, green, and blue vertical bars. It treats these bars as narrow pixels, allowing Windows to display more detail in text.</p>
<p>At best, ClearType makes text sharper and more readable. At worst, it creates colored &quot;halos&quot; around text &#8212; including your lovely web fonts. What you see depends largely on whether you&#8217;ve used the &quot;Adjust ClearType Text&quot; tool to configure ClearType for your display. If the software isn&#8217;t configured properly, it can actually make text harder to read.</p>
<p><img src="http://cdn.sixrevisions.com/0217-06_cleartype_tuner.jpg" width="550" height="447" /></p>
<h4>Mac OS Font Rendering</h4>
<p>It&#8217;s worth noting, of course, that not everyone is wild about Apple&#8217;s font rendering either; some Windows users argue that Mac OS <a target="_blank" href="http://www.codinghorror.com/blog/2007/06/font-rendering-respecting-the-pixel-grid.html">sacrifices readability for the sake of making text prettier</a>.</p>
<h4>Test in Different Operating Systems</h4>
<p>The differences in how operating systems render fonts mean that it&#8217;s worth testing your site on two different platforms.</p>
<p>If you&#8217;re a Windows user, it&#8217;s useful to test your site on Mac OS once in a while (or at least try Safari&#8217;s font smoothing on Windows).</p>
<p>If you&#8217;re a Mac OS user, you probably already have a copy of Windows somewhere so that you can test on IE. It&#8217;s worth trying WebKit or Firefox on Windows so that you can see how different rendering modes affect your site.</p>
<p><img src="http://cdn.sixrevisions.com/0217-07_comparison.jpg" width="550" height="250" /></p>
<p>It might be tempting to sidestep this whole process and use <a target="_blank" href="http://cufon.shoqolate.com/generate/">Cufón</a> to render fonts as vector images, which are then smoothed in much the same way as text on Mac OS is.</p>
<p>It might be equally tempting to use a <a target="_blank" href="http://stackoverflow.com/questions/1031531/ie8-disable-cleartype">CSS tweak</a> to disable ClearType in older versions of IE. The problem is that doing so violates users&#8217; expectations and ignores their preferences.</p>
<p>The user may have already configured ClearType or other settings to her liking, and she likely expects text in web pages to look the same as text in a word processor or dialog box. (It&#8217;s also worth noting that web fonts are <a target="_blank" href="http://arborwebsolutions.com/2011/06/nevermind-the-cufon-here%E2%80%99s-the-font-face/">faster</a> than Cufón, particularly when you&#8217;re working with <a target="_blank" href="http://bkwld.com/blog/2009/06/cufon-speed-test/">large amounts of text</a>.)</p>
<h3>Conclusion</h3>
<p><strong>It&#8217;s difficult to completely account for all situations, when it comes to web fonts. </strong>The best we can do is make sure we implement safeguards and fallback mechanisms for the less-than-ideal web browsing scenario.</p>
<p>It&#8217;s inevitable: <strong>Fonts will look different across browsers and operating systems</strong>, and they will perform differently across various connections. This is okay (even good)!</p>
<p>With a little testing and tweaking, you can accommodate users on broadband and dial-up, Macs and PCs, corporate networks and coffee shop Wi-Fi.</p>
<h3>Related Content</h3>
<ul>
<li><a href="http://sixrevisions.com/css/css-typography-01/">CSS Typography: The Basics</a></li>
<li><a href="http://sixrevisions.com/graphics-design/comic-sans-the-font-everyone-loves-to-hate/">Comic Sans: The Font Everyone Loves to Hate</a></li>
<li><a href="http://sixrevisions.com/web_design/google-font-api-guide/">A Guide to Google Font API</a></li>
<li><em>Related categories</em>: <a href="http://sixrevisions.com/category/css/">CSS</a> and <a href="http://sixrevisions.com/category/web_design/">Web Design</a></li>
</ul>
<h3>About the Author</h3>
<p class="about-author"><img src="http://cdn.sixrevisions.com/authors/ryan_debeasi_small.jpg" alt="" width="80" height="80" /><span class="author-bio-text"><strong>Ryan DeBeasi</strong> is an interactive designer at the <a href="http://www.352media.com/">web design company</a> 352 Media Group, which offers custom web design and development for large corporations and <a target="_blank" href="http://www.352media.com/smallbusinesswebdesign/">small business web design</a>. He&#8217;s passionate about front-end development, user experience and writing. His <a target="_blank" href="http://www.ryandebeasi.com/">portfolio</a> no longer breaks on corporate networks. Follow him on Twitter: @<a target="_blank" href="http://twitter.com/ryandebeasi">RyanDeBeasi</a>.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://sixrevisions.com/css/font-face-web-fonts-issues/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Are You Using CSS3 Appropriately?</title>
		<link>http://sixrevisions.com/css/using-css3-appropriately/</link>
		<comments>http://sixrevisions.com/css/using-css3-appropriately/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 10:00:39 +0000</pubDate>
		<dc:creator>Jacob Gube</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://sixrevisions.com/?p=5970</guid>
		<description><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5970&c=1893528956' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5970&c=1893528956' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br />CSS3 is exciting. When it was introduced, it seemed like the untapped potential of Web Design was finally unlocked. It proposes speedier web page response times due to the reduction of images needed for things such as text effects and web buttons for our UIs. It cuts back our dependency on JavaScript for visual presentation [...]]]></description>
			<content:encoded><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5970&c=1012673948' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5970&c=1012673948' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br /><p><a href="http://sixrevisions.com/css/using-css3-appropriately/"><img src="http://cdn.sixrevisions.com/0215-01_using_css3_appropriately_thumbnail.jpg" width="550" height="200" alt="Are You Using CSS3 Appropriately?" /></a></p>
<p><a href="http://sixrevisions.com/css/embracing-and-using-css3-pragmatically/" title="Embracing and Using CSS3 Pragmatically">CSS3 is exciting.</a> When it was introduced, it seemed like the untapped potential of Web Design was finally unlocked.</p>
<p>It proposes speedier <a href="http://sixrevisions.com/web-development/five-ways-to-speed-up-page-response-times/" title="Five Ways to Speed Up Page Response Times">web page response times</a> due to the reduction of images needed for things such as <a href="http://sixrevisions.com/photoshop/photoshop-text-effect-tutorials/" title="Photoshop Text Effect Tutorials">text effects</a> and web buttons for our UIs.</p>
<p>It cuts back our dependency on JavaScript for visual presentation purposes such as animation effects, not only resulting in less code (always a good thing) but also equating to even better <a href="http://sixrevisions.com/web-development/10-ways-to-improve-your-web-page-performance/" title="10 Ways to Improve Your Web Page Performance">web page performance</a>.</p>
<p>It promises less reliance on expensive graphics software like Photoshop.</p>
<p>But has anything, in the broader scheme of visual design, really changed? We&#8217;re still dealing with the same users, the same content and the same user-centered design philosophy.</p>
<p><span id="more-5970"></span></p>
<p><img src="http://cdn.sixrevisions.com/0215-02_css3_benefits.jpg" width="550" height="300" /></p>
<p>The new CSS3 capabilities should be treated just like any other web technology we work with: It should always support user-centered design and the site&#8217;s goals and purpose. And if CSS3 is applied in any other way than that, then it becomes a dispensable component within our <a href="http://sixrevisions.com/web-development/a-6-step-general-process-for-producing-a-website/" title="A 6-Step General Process for Producing a Website">website production process</a>.</p>
<h3>CSS3 Does Not Change Design</h3>
<p>In terms of design principles and visual presentation best practices, nothing has been altered by CSS3, even when we&#8217;ve been given fancy transitions, transforms and typography effects to play with. These are all superficial tools in web design, and we&#8217;ve had these things even before CSS3.</p>
<p>From the user&#8217;s perspective &#8212; which is always the most important viewpoint &#8212; these new cosmetic CSS3 properties matter even less. Most users, we must remember, won&#8217;t notice the subtle effects we put in our designs, like links changing colors smoothly instead of immediately. These are on the aesthetic level, and shouldn&#8217;t get in the way of the user experience.</p>
<p>The real paradigm shift comes in the new way of approaching and carrying out our website design process.</p>
<p>For example, with better support for media queries, we can now more easily produce flexible and <a href="http://sixrevisions.com/web_design/understanding-the-elements-of-responsive-web-design/" title="Understanding the Elements of Responsive Web Design">responsive web designs</a> that optimize the user experience depending on what browsing device they use. That&#8217;s huge, and introduces plenty of new concepts in our traditional site-building methodology.</p>
<p><img src="http://cdn.sixrevisions.com/0215-03_css3_media_queries.jpg" width="550" height="329" /></p>
<p>With the new CSS3 selectors, we now have a much better ability of targeting HTML elements and carrying out animation effects without the use of JavaScript or a web development/Ajax library like <a href="http://sixrevisions.com/javascript/getting-started-with-jquery/" title="Getting Started with jQuery">jQuery.</a></p>
<p>CSS3 isn&#8217;t about fancy text shadows and gradients; that&#8217;s only at the surface of it. It should be about enhancing the user experience and being able to produce better sites in a more efficient manner.</p>
<h3>Using CSS3 Appropriately</h3>
<p>Now that we have more tools at our disposal, we can design interactions more naturally. We can use these new features to our advantage by applying them where usability and the user experience is improved.</p>
<p>Or we can use CSS3 to our detriment, where we focus on the new superficial CSS3 features, loading up our work with extraneous text shadows, color gradients and fancy rotation effects simply because we can.</p>
<p>When we decide to use CSS3 in our work, we should always keep in mind that function is more important than form. There is an important line between <a href="http://sixrevisions.com/web_design/difference-between-design-art/">a beautiful design and a good design.</a></p>
<p>As a rule, only <strong>use CSS3 when there&#8217;s a good reason to do so.</strong> For example, you might use the <code>text-shadow</code> CSS3 property to create a good visual hierarchy, pulling greater attention to more important textual elements. But if everything has text shadows for no other reason than because it looks cool and is out of the ordinary at the expense of readability, then it is definitely not a good use this new web technology.</p>
<p><img src="http://cdn.sixrevisions.com/0215-04_lorem_ipsum_graphic.jpg" width="550" height="317" /></p>
<p>We have to put usability, accessibility and the user experience at the forefront of the design process. Everything else comes second.</p>
<p><a href="http://www.bifter.co.uk/">The Bifter</a> is an example of heavy reliance on  gratuitous CSS3. The site looks great on a CSS3/HTML5-supporting browser like Google Chrome.</p>
<p><img src="http://cdn.sixrevisions.com/0215-05_google_chrome_14_biffer_render.jpg" width="550" height="729" /></p>
<p>Unfortunately, it almost falls apart in IE7.</p>
<p><img src="http://cdn.sixrevisions.com/0215-06_ie7_biffer_render.jpg" width="550" height="764" /></p>
<p>In this instance, the experience of users with browsers that do not support CSS3 was neglected for form. The same look could&#8217;ve have been created using older web design techniques (e.g. no CSS3, no HTML5, using a PNG fix for alpha transparency, etc.) without sacrificing the user experience of IE7 (and below) web users.</p>
<p>Better yet (though it could involve additional development time), <a href="http://sixrevisions.com/web-development/progressive-enhancement/">progressive enhancement</a> can be applied so that the site appears decently on older browsers while providing a better/enhanced experience to those who choose to use CSS3/HTML5-supporting browsers.</p>
<p>Using CSS3 should:</p>
<ul>
<li>Support &#8212; and never hinder &#8212; usability, accessibility and UX</li>
<li>Improve web performance</li>
<li>Speed up website development</li>
</ul>
<p>If, however, you find yourself in a situation that doesn&#8217;t achieve any of the above, then is CSS3 really the right tool for the job?</p>
<h3>Conclusion</h3>
<p>We&#8217;ve been given a lot of power, and thankfully, we&#8217;ve been <a href="http://sixrevisions.com/css/examples-of-css3-in-the-wild/" title="Examples of CSS3 in the Wild">fairly responsible with it so far.</a> As a whole, our web designs haven&#8217;t taken a step back because of CSS3. We&#8217;re using the new features smartly, <a href="http://sixrevisions.com/css/css3-demos-experiments/" title="10 Interesting CSS3 Experiments and Demos">pushing the envelope</a> without neglecting the overarching goals of Web Design, which is to support the needs of users.</p>
<p>So long as we continue in this vein and we&#8217;re <strong>keeping it simple,</strong> I don&#8217;t think we have to worry about CSS3 being an issue in Web Design.</p>
<h3>Related Content</h3>
<ul>
<li><a href="http://sixrevisions.com/css/css-typography-01/">CSS Typography: The Basics</a></li>
<li><a href="http://sixrevisions.com/web_design/website-introductory-text-tips-examples/">Designing a Website&#8217;s Introductory Text: Tips and Examples</a></li>
<li><a href="http://sixrevisions.com/web_design/difference-between-design-art/">The Difference Between Design and Art</a></li>
<li><em>Related categories</em>: <a href="http://sixrevisions.com/category/css/">CSS</a> and <a href="http://sixrevisions.com/category/web_design/">Web Design</a></li>
</ul>
<h3>About the Author</h3>
<p class="about-author"><img src="http://cdn.sixrevisions.com/authors/delwin_campbell_small.jpg" alt="" width="80" height="80" /> <strong>Delwin Campbell</strong> is a web developer (among <a href="http://soundcloud.com/enceladus/">other</a> <a href="http://flickr.com/thecampbell/">things</a>) at <a href="http://noenemies.com/">No Enemies</a>, based in Austin, Texas. He is a crazy person with too many hobbies; right now he&#8217;s learning Swedish! Check out his <a href="http://delw.in/">personal site</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sixrevisions.com/css/using-css3-appropriately/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>A Guide to CSS Colors in Web Design</title>
		<link>http://sixrevisions.com/css/colors-webdesign/</link>
		<comments>http://sixrevisions.com/css/colors-webdesign/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 10:00:50 +0000</pubDate>
		<dc:creator>Jacob Gube</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://sixrevisions.com/?p=5502</guid>
		<description><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5502&c=467289770' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5502&c=467289770' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br />With the exceptions of typography and layout, nothing has a more profound impact on the way we design and craft websites than color &#8212; from the visuals we showcase through images and media to the simple choice of whether to use salmon pink or neon green to give a website that &#8217;90s &#34;Help, I&#8217;m going [...]]]></description>
			<content:encoded><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5502&c=77452400' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5502&c=77452400' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br /><p><a href="http://sixrevisions.com/css/colors-webdesign/"><img src="http://cdn.sixrevisions.com/0138-01_css_color_webdesign_guide_thumbnail.jpg" width="550" height="200" /></a></p>
<p>With the exceptions of <a href="http://sixrevisions.com/web_design/a-basic-look-at-typography-in-web-design/">typography</a> and <a href="http://sixrevisions.com/web_design/a-guide-on-layout-types-in-web-design/">layout</a>, nothing has a more profound impact on the way we design and craft websites than color &#8212; from the visuals we showcase through images and media to the simple choice of whether to use salmon pink or neon green to give a website that <a href="http://sixrevisions.com/web_design/are-current-web-design-trends-pushing-us-back-to-1999/" title="Are Current Web Design Trends Pushing Us Back to 1999?">&#8217;90s</a> &quot;Help, I&#8217;m going blind!&quot; appeal. This simple guide will look into CSS colors. You&#8217;ll also find excellent color charts and tools to help you work with color values.</p>
<p><span id="more-5502"></span></p>
<p>Let&#8217;s set our objectives:</p>
<ul>
<li>Examine the variety of options that exist</li>
<li>Analyze basic code examples for each color type</li>
<li>Examine opacity, transparency and more</li>
<li>Explore simple color theory and psychology</li>
</ul>
<h3>Color Value Notation</h3>
<p><img src="http://cdn.sixrevisions.com/0138-02_color_methods.png" alt="" width="550" height="464" /></p>
<p>There are many types of color notation in CSS, and the lesson to take away is that you need to decide for yourself which method is best for you after taking into account cross-browser compatibility and other limitations.</p>
<p>In many ways, color is limited only by our imagination. Our choices for shades and contrasts have changed over the years with the introduction of displays that are capable of displaying many millions of colors (a far cry from the old 256-color limit).</p>
<p>When we identify that perfect shade in our code, the format we use to describe and reference it can appear as one of many color values that help the browser determine exactly what we want it to render (and where).</p>
<p><img src="http://cdn.sixrevisions.com/0138-03_hex_rgb_hsl.png" width="550" height="250" /><span class="figure-caption">For every color, there&#8217;s a hex, RGB and HSL equivalent. You just need to know the value.</span></p>
<h4>Hexadecimal Value Notation</h4>
<p>Of the many methods to describe color in CSS, the most popular is the hexadecimal value. It&#8217;s been around since the beginning and has retained maximum browser support. A hexadecimal color value starts with the hash (<code>#</code>) character, followed by three or six hexadecimal digits in  RGB notation format. For example, the hexadecimal (often unofficially abbreviated as <em>hex</em>) color value for white is <code>#FFFFFF</code>, or <code>#FFF</code> in shorthand.</p>
<p>Because hexadecimal value notation supports a wider range of colors than the equally old keyword system (e.g. <code>red</code>, <code>green</code>, <code>blue</code>, <code>black</code>), it remains highly used for its preciseness.</p>
<p>Below are simple examples of longhand and shorthand hex value notation:</p>
<pre>
a { color: <strong>#AABBCC</strong>; }
a { color: <strong>#ABC</strong>; }
</pre>
<h4>RGB Value Notation</h4>
<p>Of course, while hex codes remain highly popular in CSS, many designers don&#8217;t realize that the other convention for RGB color notation has been around just as long (and we can trace its roots back to the earliest CSS specification). Using 0 to 255 numerals for each of the red, green and blue values that comprise our RGB colors (or using percentages instead), we can present our choices in an easier-to-read format.</p>
<p>Below are simple examples of RGB representations of  colors:</p>
<pre>
a { color: <strong>rgb(170, 187, 204)</strong>; }
a { color: <strong>rgb(67%, 73%, 80%)</strong>; }
</pre>
<h4>HSL Value Notation</h4>
<p>We also have HSL, which is the new kid on the block. Built to complement the existing RGB system, HSL allows us to combine hue, saturation and brightness into a triple declaration.</p>
<p>HSL makes guessing colors easier because you are declaring shades that are either lighter or darker by increasing or decreasing other values (against the base hue).</p>
<p>Hues are declared in degrees of the color circle (a value of 0 to 360), and both saturation and brightness are declared in percentages.</p>
<p>Below is a simple example of an HSL representation of a color:</p>
<pre>a { color: <strong>hsl(210, 13.3%, 73.3%)</strong>; }
</pre>
<h4>Color Keywords and X11</h4>
<p>So far, CSS notation may seem quite difficult for beginners, especially if hexadecimal values and color calculations (using percentages, degrees of the color circle or light values from the RGB spectrum) aren&#8217;t your thing.</p>
<p>Fear not. A bunch of explicitly worded alternatives, referred to as <strong>color keywords</strong>, can help.</p>
<p>Unlike the other methods, the supported values are limited, but they do what they do well.</p>
<p>Using a color keyword is one of the simplest methods of describing color in CSS. Rather than using some weird notation that is all but alien to the average end user, simply provide one of a base set of values that describe the color by a recognizable name.</p>
<p>The color names are limited to 16 values but, as we&#8217;ll find out, can be expanded using an extended palette. Below is a simple example:</p>
<pre>a { color: <strong>green</strong>; }
</pre>
<p>Basic color keyword notation has been around for a long time, but given the limitations of the 16 base colors mentioned above, browser makers (and now the CSS3 spec, which has adopted the values from the SVG specification) have expanded the range of colors by taking advantage of the <strong>X11</strong> extended color palette (which gives us over 100 named colors).</p>
<p><img src="http://cdn.sixrevisions.com/0138-04_color_keywords.png" width="550" height="318" /><span class="figure-caption">We can describe colors using keywords (as long as they are supported by browsers).</span></p>
<p>The only potential problem with X11 is that browser support and consistency aren&#8217;t a guarantee (some color clashes can occur, for example).</p>
<p><img src="http://cdn.sixrevisions.com/0138-05_x11_palette.png" width="550" height="261" /><span class="figure-caption">The X11 palette gives us an extended, supported list of color keyword names.</span></p>
<h4>System Colors</h4>
<p>Finally, one other group of color keywords needs to be mentioned. System colors allow designers to match certain color choices to those of the operating system&#8217;s default scheme.</p>
<p>Think of the display options in Windows and how you can alter the color of system text, the background, title bars and such; the keywords ask the browser to emulate them.</p>
<p>However, system color keywords are deprecated, poorly supported and dangerous for your website&#8217;s accessibility because you leave it up to the user&#8217;s OS to decide on colors and native appearance.</p>
<p><img src="http://cdn.sixrevisions.com/0138-06_system_colors.png" width="550" height="262" /><span class="figure-caption">System colors were an attempt to make websites look and feel more like an operating system.</span></p>
<h3>Color Opacity and Transparency</h3>
<p>So far, we have outlined the basics of color value notations, and you could be forgiven for thinking that simply telling the browser what color you want is all there is to it. But with the advent of CSS3 comes an additional level of controlling colors, bringing us the ability to layer semi-transparent or opaque effects onto objects.</p>
<p><img src="http://cdn.sixrevisions.com/0138-07_opacity_transparency.png" width="550" height="252" /><span class="figure-caption">Opacity and transparency effects on websites can be subtle and quite beautiful.</span></p>
<p>As with the usual color notation, there are many ways to achieve this. Below are a few of the most common.</p>
<h4>Opacity</h4>
<p>First, let&#8217;s discuss opacity, which is perhaps the trickiest to make cross-compatible due to all of the browsers and versions that need supporting. While opacity appeared only in CSS3, it has quite a history of early browser support, especially in Internet Explorer (which used the proprietary DirectX filter property). Getting the mix exactly right is a challenge, and some people use different blends to maintain the effect.</p>
<p>Below is a solid formula that includes everything you need for bulletproof opacity:</p>
<pre>
div {
  opacity: 0.5;
  -moz-opacity: 0.5;
  -khtml-opacity: 0.5;
  -ms-filter: &quot;progid:DXImageTransform.Microsoft.Alpha(Opacity=50)&quot;;
  filter: alpha(opacity=50);
}</pre>
<h4>Transparency</h4>
<p>Transparency has also been revitalized with CSS3. No longer are you limited to image-based alpha transparency (although that&#8217;s still an option) or single-color transparency effects on images. Modern browsers take advantage of both <strong>RGBa</strong> and <strong>HSLa</strong>, which, as you can guess, use conventional RGB and HSL notation but with a percentage-based alpha transparency value attached to the end.</p>
<p>Below are simple examples of RGB and HSL with alpha-transparency of 0.5 (or 50%):</p>
<pre>
a { color: rgba(170, 187, 204, 0.5); }
a { color: rgba(67%, 73%, 80%, 0.5); }
a { Color: hsla(210, 13.3%, 73.3%, 0.5); }
</pre>
<h3>Safe Colors</h3>
<p>With something as important as color, you&#8217;d expect compatibility to be a given. But the situation in reality is far from perfect. The X11 color system isn&#8217;t supported equally across web browsers (and has only just been added to the CSS specification). HSL, HSLa and RGBa are new additions to CSS3 and so cannot be relied on in older browsers; system colors have been deprecated; and both opacity and alpha-transparency support are messy!</p>
<p><img src="http://cdn.sixrevisions.com/0138-08_really_safe.png" width="550" height="263" /><span class="figure-caption">If you think things are limited now, just think back to when colors were restrictive.</span></p>
<p>Even the base colors we depend on could potentially be a problem on older hardware, because back when displays could render only 256 colors (or even further back with 8-bit displays), compatibility issues were serious enough for us to limit the power behind color notation.</p>
<p>To ensure that all devices got a consistent and usable look and feel, three levels of safe color use were formed.</p>
<h4>Really-safe Colors</h4>
<p>This existed back when 8-bit displays were still fairly common, because on those displays, only 22 of the colors defined as &quot;web-safe&quot; displayed reliably.</p>
<h4>Web-safe Colors</h4>
<p>This is the one that most designers know (and some still use). 216 colors were available (of the 256 that included dithering), mainly for older displays.</p>
<h4>Web-smart Colors</h4>
<p>This was 4,096 colors and was produced to remove the limitations of the web-safe palette, while keeping color use reasonably compatible.</p>
<p>Even if you look beyond compatibility, web designers have a few additional complications with color use, mainly as a result of web accessibility. Color blindness affects many individuals worldwide, and the condition has varying degrees of severity, which makes the situation especially hard to deal with.</p>
<h3>Web Accessibility Considerations</h3>
<p>Some people may be deficient in a single color, others completely blind to an entire spectrum, still others able to see only in black and white (monochromes), and some have little or no vision at all.</p>
<p>Here are the various forms of color blindness:</p>
<h4>Monochromacy</h4>
<p>The inability to see colors outside of black and gray shades, or, in rarer cases, the inability to see outside of certain chroma shades like mild browns or blue variants.</p>
<h4>Dichromacy</h4>
<p>This is when one of the three basic color mechanisms fails to work and is commonly referred to as protanopia (blind to red), deuteranopia (blind to green) and tritanopia (blind to blue).</p>
<h4>Trichromacy</h4>
<p>This condition is when mechanisms are present but defective (thus causing confusion). Trichromacy includes protanomaly (reduced red), deuteranomaly (reduced green, which is common) and tritanomaly (reduced blue).</p>
<p>This combination of issues affecting web accessibility requires us to be more sensitive to how we use color (and the colors we choose), so that we make our websites easy to use, engaging and highly readable.</p>
<p>While some colors look perfectly fine to one set of eyes, certain conditions could render your work useless or invisible to less fortunate users.</p>
<p><img src="http://cdn.sixrevisions.com/0138-09_color_vision.png" width="550" height="220" /><span class="figure-caption">Color blindness is hard to emulate, but there are tools to help us out.</span></p>
<p>If you don&#8217;t currently consider color blindness in your designs, you should start right away. To help you on your way, read <a href="http://sixrevisions.com/web-standards/accessibility_testtools/">10 Tools for Evaluating Web Design Accessibility</a>.</p>
<h3>Color Associations</h3>
<p>Let&#8217;s just briefly go over some basic color associations. As you can see, there is more to color than meets the eye. Color can have a dramatic impact on how users interact with the page, and studies on the effects of color on buying habits and behavior are well known among designers and psychologists. Plenty of articles about <a href="http://sixrevisions.com/web_design/a-look-into-color-theory-in-web-design/">color theory</a> exist, so don&#8217;t shy away from pursuing the subject further, because it could benefit your decision-making process.</p>
<p>When we see certain colors, many of us subconsciously associate them with things we know from the world around us. For example, when we see the color red, we may think of love, blood or passion depending on various factors such as cultural upbringing and personal experiences. We can use these associations to impress our identity on users, just as painters use color to elicit emotion. For example, a website about vampires would be better served by a red and black palette than a yellow and green one because those are the colors traditionally associated with the genre.</p>
<p><img src="http://cdn.sixrevisions.com/0138-10_color_associations.png" width="550" height="250" /><span class="figure-caption">Many different color associations arise from culture, and some are quite obvious.</span></p>
<p>Not only does this psychological phenomenon affect our perceptions of the environment (though to what extent is still up for debate), <a href="http://sixrevisions.com/web_design/how-web-designers-can-adopt-a-global-mindset/" title="How Web Designers Can Adopt a Global Mindset">different cultures associate colors with different things</a>; we mustn&#8217;t assume that Western standards hold true worldwide.</p>
<p>Another color association is with temperature: we often associate blue with cool things and red with hot things, and this can be seen in our visuals.</p>
<p><img src="http://cdn.sixrevisions.com/0138-11_color_psychology.png" width="550" height="96" /><span class="figure-caption">Color psychology can help you better connect with your audience.</span></p>
<h3>Color Tools and Resources</h3>
<p>Below is a list of links related to color in web design that you might want to explore.</p>
<h4>Color Charts</h4>
<ul>
<li><a href="http://www.w3.org/TR/CSS21/syndata.html#color-units">CSS 2.1 specification: Colors</a></li>
<li><a href="http://www.w3.org/TR/css3-color/">CSS3 color specification</a></li>
<li><a href="http://coloria.net/bonus/colornames.htm">Color names</a></li>
<li><a href="http://www.december.com/html/spec/colorcodes.html">Color Codes</a></li>
<li><a href="http://web.archive.org/web/20001018100341/http:/hotwired.lycos.com/webmonkey/00/37/stuff2a/complete_websafe_216/reallysafe_palette.html">Really-safe colors</a></li>
<li><a href="http://www.elizabethcastro.com/html/colors/websafecolors.html">Web-safe colors</a></li>
<li><a href="http://cloford.com/resources/colours/websmart1.htm">Web-smart colors</a></li>
<li><a href="http://colorfilter.wickline.org/">Colorblind Web Page Filter</a></li>
<li><a href="http://www.sibagraphics.com/colour.php">The Meaning of Colors</a></li>
</ul>
<h4>Color Pickers</h4>
<ul>
<li><a href="http://www.colorschemer.com/products.php">ColorSchemer Studio 2</a></li>
<li><a href="http://colorcop.net/">Color Cop</a> (free)</li>
<li><a href="http://kuler.adobe.com/">Adobe Kuler</a> (web-based)</li>
<li><a href="http://www.colortoy.net/">ColorToy</a> (iOS)</li>
<li><a href="https://market.android.com/details?id=com.siyusong.android.color.picker">Magic Color Picker</a> (Android)</li>
</ul>
<h3>Conclusion</h3>
<p>Color plays a huge role in web design, and our implementation of it matters. Whether we&#8217;re playing with contrast, shades, hues, transparency and so forth, our goal is to produce websites that are aesthetically pleasing and relevant to our audience.</p>
<p>Our choices should avoid clashes and blurring, and we should choose a palette that is compatible and accessible to our users.</p>
<p>CSS has given us the groundwork to use any color we desire, and CSS3 offers additional tools, such as opacity.</p>
<p>But with great flexibility comes great responsibility. Color covers every square inch of our websites, and we should never underestimate its value to our work. Review the color system you are currently using, and be creative in your effort to build increasingly beautiful, vivid experiences. Your colors should leave a positive, lasting impression.</p>
<h3>Related Content</h3>
<ul>
<li><a href="http://sixrevisions.com/usabilityaccessibility/14-brilliant-tools-for-evaluating-your-designs-colors/">14 Brilliant Tools for Evaluating Your Design&#8217;s Colors</a></li>
<li><a href="http://sixrevisions.com/web_design/color-the-next-limited-resource/">Color: The Next Limited Resource?</a></li>
<li><a href="http://sixrevisions.com/web_design/beautiful-and-creative-examples-of-vibrant-web-designs/">Beautiful and Creative Examples of Vibrant Web Designs</a></li>
<li><em>Related categories</em>: <a href="http://sixrevisions.com/category/css/">CSS</a> and <a href="http://sixrevisions.com/category/web_design/">Web Design</a></li>
</ul>
<h3>About the Author</h3>
<p class="about-author"><img src="http://images.sixrevisions.com/authors/alexander_dawson_small.jpg" alt="" width="80" height="80" /><span class="author-bio-text"><strong>Alexander Dawson</strong> is a freelance web designer, author and recreational software developer specializing in web standards, accessibility and UX design. As well as running a business called <strong><a href="http://www.hitechy.com/">HiTechy</a></strong> and writing, he spends time on <strong><a href="http://twitter.com/AlexDawsonUK">Twitter</a></strong>, SitePoint&#8217;s forums and other places, helping those in need.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://sixrevisions.com/css/colors-webdesign/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>CSS Typography: Examples and Tools</title>
		<link>http://sixrevisions.com/css/css-typography-03/</link>
		<comments>http://sixrevisions.com/css/css-typography-03/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 10:06:51 +0000</pubDate>
		<dc:creator>Jacob Gube</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://sixrevisions.com/?p=5055</guid>
		<description><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5055&c=592968697' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5055&c=592968697' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br />In the previous part of this series, we discussed some techniques and best practices for CSS typography. Let&#8217;s now delve into the subject further by looking into some case studies, tools, as well as a showcase of excellent CSS typography on the web. This is the third part of a three-part series of guides on [...]]]></description>
			<content:encoded><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5055&c=518714182' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5055&c=518714182' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br /><p><a href="http://sixrevisions.com/css/css-typography-03/"><img src="http://cdn.sixrevisions.com/0062-01_css_typography_examples_tools.png" width="550" height="200" alt="CSS Typography: Examples and Tools" /></a></p>
<p>In the <a href="http://sixrevisions.com/css/css-typography-02/">previous part</a> of this series, we discussed some techniques and best practices for CSS typography. Let&#8217;s now delve into the subject further by looking into some case studies, tools, as well as a showcase of excellent CSS typography on the web.</p>
<p>This is the <strong>third part</strong> of a three-part series of guides on CSS typography that will cover everything from basic syntax to best practices and tools related to CSS typography.</p>
<p><span id="more-5055"></span></p>
<ul>
<li><a href="http://sixrevisions.com/css/css-typography-01/">CSS Typography: The Basics</a></li>
<li><a href="http://sixrevisions.com/css/css-typography-02/">CSS Typography: Techniques and Best Practices</a></li>
<li><strong>CSS Typography: Examples and Tools</strong></li>
</ul>
<h3>Case Studies on CSS Typography</h3>
<p>Tutorials and theories can be great, but nothing says <em>proof</em> like a case study. Here are a handful of studies that can provide you with some real-world insights regarding typography on the web.</p>
<h4><a href="http://blogs.sitepoint.com/2010/12/01/southern-savers-case-study-part-iv-typography/">Southern Savers Case Study: Typography</a></h4>
<p><a href="http://blogs.sitepoint.com/2010/12/01/southern-savers-case-study-part-iv-typography/"><img src="http://cdn.sixrevisions.com/0062-02_southernsavers.jpg" width="550" height="400" alt="Southern Savers Case Study, Part IV: Typography" /></a></p>
<h4><a href="http://blogs.sitepoint.com/2009/03/18/serif-fonts-vs-sans-serif-fonts-a-working-case-study/">Serif Fonts vs. Sans Serif Fonts: A Working Case Study</a></h4>
<p><a href="http://blogs.sitepoint.com/2009/03/18/serif-fonts-vs-sans-serif-fonts-a-working-case-study/"><img src="http://cdn.sixrevisions.com/0062-03_serifsansserif.jpg" width="550" height="400" alt="Southern Savers Case Study, Part IV: Typography" /></a></p>
<h4><a href="http://readableweb.com/fixing-web-fonts-a-case-study/">Fixing Web Fonts, A Case Study</a></h4>
<p><a href="http://readableweb.com/fixing-web-fonts-a-case-study/"><img src="http://cdn.sixrevisions.com/0062-04_betterfonts.jpg" width="550" height="400" alt="Southern Savers Case Study, Part IV: Typography" /></a></p>
<h4><a href="http://readableweb.com/ten-great-free-fonts-cross-browser-a-case-study-in-font-face/">Ten Great Free Fonts Cross-Browser: A Case Study in @Font-Face</a></h4>
<p><a href="http://readableweb.com/ten-great-free-fonts-cross-browser-a-case-study-in-font-face/"><img src="http://cdn.sixrevisions.com/0062-05_fontface.jpg" width="550" height="400" alt="Southern Savers Case Study, Part IV: Typography" /></a></p>
<h3>CSS Typography Tools</h3>
<p>Below is a collection of typography-related tools, with most being geared toward helping you work with CSS typography.</p>
<h4><a href="http://css-tricks.com/typographic-grid/">Typographic Grid</a></h4>
<p><a href="http://css-tricks.com/typographic-grid/"><img src="http://cdn.sixrevisions.com/0062-06_typographicgrid.jpg" width="550" height="400" alt="Typographic Grid" /></a></p>
<p>This premade CSS grid by Chris Coyier is composed to a vertical rhythm. It&#8217;s a great starting point for anyone working with CSS typography.</p>
<h4><a href="http://baselinecss.com/">Baseline</a></h4>
<p><a href="http://baselinecss.com/"><img src="http://cdn.sixrevisions.com/0062-07_baseline.jpg" width="550" height="400" alt="Baseline" /></a></p>
<p>Baseline is a typographic framework that adheres to a baseline grid. It features a <a href="http://sixrevisions.com/css/a-comprehensive-guide-to-css-resets/" title="A Comprehensive Guide to CSS Resets - sixrevisions.com">CSS reset</a> and basic style rules for HTML text, <a href="http://sixrevisions.com/user-interface/25-stylish-examples-of-web-forms/" title="25 Stylish Examples of Web Forms - sixrevisions.com">web forms</a>, and some of the new <a href="http://sixrevisions.com/html/the-only-html5-resources-you-need-for-getting-up-to-speed/" title="The Only HTML5 Resources You Need for Getting Up to Speed - sixrevisions.com">HTML5</a> elements.</p>
<h4><a href="http://lamb.cc/typograph/">Typograph</a></h4>
<p><a href="http://lamb.cc/typograph/"><img src="http://cdn.sixrevisions.com/0062-08_lamb.jpg" width="550" height="400" alt="Typograph" /></a></p>
<p>This tool has a drag-and-drop interface for composing typography that aligns to a <a href="http://sixrevisions.com/web_design/a-brief-look-at-grid-based-layouts-in-web-design/" title="A Brief Look at Grid-Based Layouts in Web Design - sixrevisions.com">web layout grid</a>. There are a number of features available including an automatic mathematical scale so that you don&#8217;t have to pull out your calculator while working with CSS typography.</p>
<h4><a href="http://www.typetester.org/">TypeTester</a></h4>
<p><a href="http://www.typetester.org/"><img src="http://cdn.sixrevisions.com/0062-09_typetester.jpg" width="550" height="400" alt="TypeTester" /></a></p>
<p>Choose fonts installed in your computer and then play around with its line-height, letter-spacing, and so forth. This tool will show you a preview on the fly so that you can conveniently tweak your font styles to your heart&#8217;s delight.</p>
<h4><a href="http://www.fonttester.com/">FontTester</a></h4>
<p><a href="http://www.fonttester.com/"><img src="http://cdn.sixrevisions.com/0062-10_fonttester.jpg" width="550" height="400" alt="FontTester" /></a></p>
<p>FontTester is similar in purpose to TypeTester (above). FontTester allows you to test various fonts side by side for comparing and contrasting. Test out different font combinations and styles, and then grab the CSS once you&#8217;re happy.</p>
<h4><a href="http://www.typechart.com/">Typechart</a></h4>
<p><a href="http://www.typechart.com/"><img src="http://cdn.sixrevisions.com/0062-11_typechart.jpg" width="550" height="400" alt="Typechart" /></a></p>
<p>Typechart is a showcase of different font combinations, with easy-to-grab CSS for each combination. It&#8217;s great for discovering font combinations and styles quickly. </p>
<h4><a href="http://www.jan-quickels.de/tools-web-typography/">CSS Typeset Matrix</a></h4>
<p><a href="http://www.jan-quickels.de/tools-web-typography/"><img src="http://cdn.sixrevisions.com/0062-12_typesetmatrix.jpg" width="550" height="400" alt="CSS Typeset Matrix" /></a></p>
<p>Do you think in terms of pixels? This tool will help convert your units of measurement into <code>em</code> as well as help you find margins and spacing values based on the font sizes and line-heights you specify.</p>
<h4><a href="http://csstypeset.com/">CSS Typeset</a></h4>
<p><a href="http://csstypeset.com/"><img src="http://cdn.sixrevisions.com/0062-13_csstypeset.jpg" width="550" height="400" alt="CSS Typeset" /></a></p>
<p>With this tool, you can change the line-height, word-spacing, color, style and text decoration of any text placed in the left input field. See the result of your tweaks immediately, and then copy-and-paste the code from the right input field. </p>
<h4><a href="http://typenav.fontshop.com/">Type Navigator</a></h4>
<p><a href="http://typenav.fontshop.com/"><img src="http://cdn.sixrevisions.com/0062-14_typenavigator.jpg" width="550" height="400" alt="Type Navigator" /></a></p>
<p>Have you ever come across a font on the web and wondered what it was? With this tool, you can figure out what font you&#8217;re looking at by answering a series of questions about its characteristics. Without a particular font in mind, you can use this tool to find a font based on features you like.</p>
<h4><a href="http://pxtoem.com/">PX to EM</a></h4>
<p><a href="http://pxtoem.com/"><img src="http://cdn.sixrevisions.com/0062-15_pxtoem.jpg" width="550" height="400" alt="PX to EM" /></a></p>
<p>With this tool, simply pick a desired body <code>font-size</code> in any of the four units of measurement (<code>px</code>, <code>em</code>, <code>%</code> or <code>pt</code>) and it will convert it to <code>em</code> for you.</p>
<h4><a href="http://new.myfonts.com/WhatTheFont/">What the Font</a></h4>
<p><a href="http://new.myfonts.com/WhatTheFont/"><img src="http://cdn.sixrevisions.com/0062-16_whatthefont.jpg" width="550" height="400" alt="What the Font" /></a></p>
<p>You can use this tool to learn the name of a font by uploading an image of it. </p>
<h4><a href="http://www.fontifier.com/">Fontifier</a></h4>
<p><a href="http://www.fontifier.com/"><img src="http://cdn.sixrevisions.com/0062-17_fontifier.jpg" width="550" height="400" alt="Fontifier" /></a></p>
<p>This web-based generator will create a font based on a sample of your own handwriting. The font can be used in a live site using the <a href="http://sixrevisions.com/css/font-face-guide/" title="The Essential Guide to @font-face - sixrevisions.com">@font-face rule</a> (for instance). Sampling and creating the font is free, but it costs $9 to download the font.</p>
<h4><a href="http://www.bowfinprintworks.com/SerifGuide/serifsearch.php">Serif Font Search</a></h4>
<p><a href="http://www.bowfinprintworks.com/SerifGuide/serifsearch.php"><img src="http://cdn.sixrevisions.com/0062-18_seriffontsearch.jpg" width="550" height="400" alt="Serif Font Search" /></a></p>
<p>This tool allows you to search for a serif font by its characteristics. If the font you&#8217;re looking for is found, Serif Font Search will provide you its name and as well as some information about it.</p>
<h4><a href="http://www.nogginbox.co.uk/font-picker">Font Picker</a></h4>
<p><a href="http://www.nogginbox.co.uk/font-picker"><img src="http://cdn.sixrevisions.com/0062-19_fontpicker.jpg" width="550" height="400" alt="Font Picker" /></a></p>
<p>Font Picker allows you to filter through hundreds of fonts based on the characteristic and styles that you are looking for. </p>
<h4><a href="http://typekit.com/">Typekit</a></h4>
<p><a href="http://typekit.com/"><img src="http://cdn.sixrevisions.com/0062-20_typekit.jpg" width="550" height="400" alt="Typekit" /></a></p>
<p>For a subscription fee, web designers can use premium web fonts on their website and serve them through this web service. A big benefit to using Typekit is that there&#8217;s no need to worry about licensing restrictions of fonts you decide to use &#8212; the service does all that work for you.</p>
<h3>CSS Typography Showcase</h3>
<p>For inspiration, here are a few web designs that have beautiful web typography. We&#8217;ll also briefly discuss how CSS is used to compose the web design&#8217;s typography. </p>
<h4><a href="http://www.matthamm.com/">Matt Hamm</a></h4>
<p><a href="http://www.matthamm.com/"><img src="http://cdn.sixrevisions.com/0062-21_matthamm.jpg" width="550" height="400" alt="Matt Hamm" /></a></p>
<p>Matt Hamm has created his <a href="http://sixrevisions.com/web_design/five-popular-design-portfolio-website-styles/" title="Five Popular Design Portfolio Website Styles - sixrevisions.com">portfolio website</a> around beautiful typography. The web design&#8217;s vertical rhythm is executed well and premium web fonts are served through Typekit. Notice how the web design has variations in capitalization, font size, and other font styles to create excellent <a href="http://sixrevisions.com/web_design/using-power-structure-and-gestalt-for-visual-hierarchy/" title="Using Power Structure and Gestalt for Visual Hierarchy - sixrevisions.com">visual hierarchy</a>.</p>
<h4><a href="http://kilianmuster.com/">Kilian Muster</a></h4>
<p><a href="http://kilianmuster.com/"><img src="http://cdn.sixrevisions.com/0062-22_kilianmuster.jpg" width="550" height="400" alt="Kilian Muster" /></a></p>
<p>This website uses a few different <a href="http://sixrevisions.com/css/css-typography-02/" title="CSS Typography: Techniques and Best Practices - sixrevisions.com">CSS typography techniques</a>. The website name and tagline leverages CSS3 <code>text-shadow</code> to create a subtle <a href="http://sixrevisions.com/css/how-to-create-inset-typography-with-css3/" title="How to Create Inset Typography with CSS3 - sixrevisions.com">CSS3 inset text effect</a>.</p>
<h4><a href="http://designinformer.com/grid-based-web-design-simplified/">Grid Based Web Design</a></h4>
<p><a href="http://designinformer.com/grid-based-web-design-simplified/"><img src="http://cdn.sixrevisions.com/0062-23_gridbasedwebdesign.jpg" width="550" height="400" alt="Grid Based Web Design" /></a></p>
<p>Design Informer&#8217;s custom blog post is a great example of <a href="http://sixrevisions.com/web_design/20-websites-with-beautiful-typography/" title="20 Websites with Beautiful Typography - sixrevisions.com">beautiful typography in web design</a>. The typography on this page adheres to a baseline grid and font sizes and styles between different textual elements create great visual hierarchy.</p>
<h4><a href="http://www.brizk.com/">Brizk</a></h4>
<p><a href="http://www.brizk.com/"><img src="http://cdn.sixrevisions.com/0062-24_brizk.jpg" width="550" height="400" alt="Brizk" /></a></p>
<p>This web design is another example of how to use custom web fonts effectively. The same font is used in headings and in various text blocks throughout the <a href="http://sixrevisions.com/web_design/a-guide-on-layout-types-in-web-design/" title="A Guide on Layout Types in Web Design - sixrevisions.com">website layout.</a> Note how the first paragraph and heading on each web page is in a bigger font size &#8212; a practical use of the CSS <code>:first-child</code> pseudo-element discussed in the <a href="http://sixrevisions.com/css/css-typography-02/">second part of this series</a>.</p>
<h4><a href="http://www.andyrutledge.com/">Design View</a></h4>
<p><a href="http://www.andyrutledge.com/"><img src="http://cdn.sixrevisions.com/0062-25_designview.jpg" width="550" height="400" alt="Design View" /></a></p>
<p>The variations in font sizes are what make this design so smart in terms of typography. Font sizes and typography spacing uses the <code>em</code> unit of measurement.</p>
<h4><a href="http://www.alistapart.com/">A List Apart</a></h4>
<p><a href="http://www.alistapart.com/"><img src="http://cdn.sixrevisions.com/0062-26_alistapart.jpg" width="550" height="400" alt="A List Apart" /></a></p>
<p>A List Apart has always been regarded as a website with excellent typography and content readability. This is because good typography is essential to a content-centered site like A List Apart, whose often-lengthy articles take center stage. The web layout features great vertical rhythm and a combination of CSS typography techniques and styles like centered text, capitalization, and an interesting hover state for <a href="http://sixrevisions.com/web_design/designing-hyperlinks-tips-and-best-practices/" title="Designing Hyperlinks: Tips and Best Practices - sixrevisions.com">hyperlinks</a> in the articles.</p>
<h4><a href="http://www.mutantlabs.com/">Mutant Labs</a></h4>
<p><a href="http://www.mutantlabs.com/"><img src="http://cdn.sixrevisions.com/0062-27_mutantlabs.jpg" width="550" height="400" alt="Mutant Labs" /></a></p>
<p>This web design has excellent font styling (in terms of colors, font choices, sizes, and spacing) that results in a great typographic composition.</p>
<h4><a href="http://jasonsantamaria.com/">Jason Santa Maria</a></h4>
<p><a href="http://jasonsantamaria.com/"><img src="http://cdn.sixrevisions.com/0062-28_jasonsantamaria.jpg" width="550" height="400" alt="Mutant Labs" /></a></p>
<p>Jason Santa Maria uses CSS <code>background-image</code> text replacement and some basic CSS typography techniques that result in excellent legibility and readability of content. Vertical rhythm in this design is wonderful.</p>
<h4><a href="http://www.darrenhoyt.com/">Darren Hoyt</a></h4>
<p><a href="http://www.darrenhoyt.com/"><img src="http://cdn.sixrevisions.com/0062-29_darrenhoyt.jpg" width="550" height="400" alt="Darren Hoyt" /></a></p>
<p>CSS drop cap (discussed in the second part of this series) is used in a main paragraph on the front page of the site.</p>
<h4><a href="http://ilovetypography.com/">I Love Typography</a></h4>
<p><a href="http://ilovetypography.com/"><img src="http://cdn.sixrevisions.com/0062-30_ilovetypography.jpg" width="550" height="400" alt="I Love Typography" /></a></p>
<p>Notice that the serif fonts in this design have been given more whitespace, and sans serif fonts have been given less. This was likely done to create visual hierarchy so that the main content is the primary focal point and the sidebar content the secondary point of interest.</p>
<h3>Further Reading and Resources on CSS Typography</h3>
<p>Finally, here is some reading material related to CSS typography for you to look into.</p>
<ul>
<li><a href="http://www.alistapart.com/articles/howtosizetextincss">How to Size Text in CSS</a></li>
<li><a href="http://clagnut.com/blog/348/">How to Size Text Using Ems</a></li>
<li><a href="http://www.maxdesign.com.au/articles/relative/">Relative Font Sizes and Inheritance</a></li>
<li><a href="http://www.maxdesign.com.au/articles/font-stacks/">CSS Font Stacks (presentation)</a></li>
<li><a href="http://articles.sitepoint.com/article/eight-definitive-font-stacks">8 Definitive Web Font Stacks</a></li>
<li><a href="http://www.smashingmagazine.com/2009/09/22/complete-guide-to-css-font-stacks/">Guide to CSS Font Stacks: Techniques and Resources</a></li>
<li><a href="http://24ways.org/2006/compose-to-a-vertical-rhythm">Compose to a Vertical Rhythm</a></li>
<li><a href="http://www.alistapart.com/articles/settingtypeontheweb">Setting Type on the Web to a Baseline Grid</a></li>
<li><a href="http://www.font-face.com/">Font-Face.com</a></li>
<li><a href="http://sixrevisions.com/css/font-face-guide/">The Essential Guide to @font-face</a></li>
<li><a href="http://www.w3schools.com/CSS/css_pseudo_elements.asp">Type Pseudo-classes</a></li>
<li><a href="http://css-tricks.com/css-content/">CSS Content</a></li>
</ul>
<h3>Conclusion</h3>
<p>Designing web typography takes a good understanding of <a href="http://sixrevisions.com/web_design/a-basic-look-at-typography-in-web-design/" title="A Basic Look at Typography in Web Design - sixrevisions.com">basic typography principles</a> and practice through real implementation. With a solid understanding of CSS font and text attributes, typography can be created with beautiful results. <a href="http://sixrevisions.com/web-development/5-good-habits-that-will-make-you-a-better-coder/" title="5 Good Habits That Will Make You a Better Coder - sixrevisions.com">Efficient and smart coding habits</a> should include knowing what CSS typography can/should and can&#8217;t/shouldn&#8217;t do.</p>
<p>This concludes our three-part guide on CSS typography. I hope it has helped you in understanding how to work with type in your web designs. </p>
<ul>
<li><a href="http://sixrevisions.com/css/css-typography-01/">CSS Typography: The Basics</a></li>
<li><a href="http://sixrevisions.com/css/css-typography-02/">CSS Typography: Techniques and Best Practices</a></li>
<li><strong>CSS Typography: Examples and Tools</strong></li>
</ul>
<h3>Related Content</h3>
<ul>
<li><a href="http://sixrevisions.com/css/30_css_techniques_examples/">30 Exceptional CSS Techniques and Examples</a></li>
<li><a href="http://sixrevisions.com/css/30-exceptional-css-navigation-techniques/">30 Exceptional CSS Navigation Techniques</a></li>
<li><a href="http://sixrevisions.com/css/innovative-and-experimental-css-examples-and-techniques/">Innovative (and Experimental) CSS Examples and Techniques</a></li>
<li><em>Related categories</em>: <a href="http://sixrevisions.com/category/css/">CSS</a> and <a href="http://sixrevisions.com/category/web_design/">Web Design</a></li>
</ul>
<h3>About the Author</h3>
<p class="about-author"><img src="http://images.sixrevisions.com/authors/kayla_knight_small.jpg" alt="" width="80" height="80" /><strong>Kayla Knight</strong> is a web designer and web developer who loves coding way too much for her own good. She does freelance design/development work and helps run the <a href="http://xhtmlshop.com/">XHTML Shop</a>. Connect with her by visiting <a href="http://kaylaknight.com/">her website</a> and following her on Twitter @ <a href="http://twitter.com/KaylaMaeKnight">KaylaMaeKnight</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sixrevisions.com/css/css-typography-03/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Embracing and Using CSS3 Pragmatically</title>
		<link>http://sixrevisions.com/css/embracing-and-using-css3-pragmatically/</link>
		<comments>http://sixrevisions.com/css/embracing-and-using-css3-pragmatically/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 10:30:47 +0000</pubDate>
		<dc:creator>Jacob Gube</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://sixrevisions.com/?p=5107</guid>
		<description><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5107&c=1514452668' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5107&c=1514452668' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br />Web design is an industry where things change very fast. Over the last year or two, CSS3 has taken web design potential to a new level. It&#8217;s not that many more features are available in this latest iteration of the CSS specifications, it&#8217;s that CSS3 makes it easier to work with things that typically involved [...]]]></description>
			<content:encoded><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5107&c=855193626' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5107&c=855193626' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br /><p><a href="http://sixrevisions.com/css/embracing-and-using-css3-pragmatically/"><img src="http://cdn.sixrevisions.com/0070-01_pragmatic_css3_thumbnail.jpg" width="550" height="200" alt="Embracing and Using CSS3 Pragmatically" /></a></p>
<p>Web design is an industry where things change very fast. Over the last year or two, <a href="http://sixrevisions.com/css/css3-techniques-you-should-know/">CSS3</a> has taken web design potential to a new level. It&#8217;s not that many more features are available in this latest iteration of the CSS specifications, it&#8217;s that CSS3 makes it easier to work with things that typically involved more work, more technologies, and more software. For example, basic animation  and dynamic image capabilities such as color gradients were previously only possible with <a href="http://sixrevisions.com/category/javascript/" title="JavaScript category on Six Revisions - sixrevisions.com">JavaScript</a>, <a href="http://sixrevisions.com/category/flashactionscript/" title="Flash/ActionScript category on Six Revisions - sixrevisions.com">Flash</a>, and image editing software like <a href="http://sixrevisions.com/category/photoshop/" title="Photoshop category on Six Revisions - sixrevisions.com">Photoshop</a>. Not anymore.</p>
<p><span id="more-5107"></span></p>
<p>There&#8217;s <a href="http://sixrevisions.com/css/3-advanced-css3-techniques-you-should-learn/" title="3 Advanced CSS3 Techniques You Should Learn - sixrevisions.com">a lot to learn about CSS3</a>, and it can be overwhelming if you&#8217;re just catching yourself up with what&#8217;s going on around you. Let&#8217;s look at how CSS3 &#8212; even though it&#8217;s not supported by all browsers (like <a href="http://sixrevisions.com/web-development/farewell-ie6/" title="Farewell IE6 - sixrevisions.com">IE6</a>) &#8212;  can be pragmatically implemented into your <a href="http://sixrevisions.com/web-development/a-6-step-general-process-for-producing-a-website/" title="A 6-Step General Process for Producing a Website - sixrevisions.com">website production process</a>.</p>
<h3>Progressive Enhancement</h3>
<p><a href="http://sixrevisions.com/web-development/progressive-enhancement/" title="Progressive Enhancement 101: Overview and Best Practices - sixrevisions.com">Progressive enhancement</a> is a key concept to apply while we are in this transitional period where not quite all of our users use browsers that have CSS3 capabilities.</p>
<p>Progressive enhancement simply means we can provide an enhanced experience to users whose browser has more features than those that use non-modern browsers.</p>
<p>You create sites focused on universal design and accessibility: Make sure that users with older browsers can use the site, but also take advantage of browser features found in modern browsers like Chrome and Opera.</p>
<p>Websites no longer need to be pixel-perfectly identical on different browsers. Here&#8217;s an example that uses progressive enhancement: <a href="https://github.com/plans">Github&#8217;s Plans &amp; Pricing</a> page.</p>
<p>Below is the page viewed in <strong>Google Chrome.</strong> Notice that  buttons and other page elements use CSS3 (<code>text-shadow</code>, <code>gradient</code> image values, <code>box-shadow</code>, <code>border-radius</code>, etc.):</p>
<p><img src="http://cdn.sixrevisions.com/0070-03_github_pe_chrome.jpg" width="550" height="392" /></p>
<p>On <strong>IE7</strong> &#8212; a browser that doesn&#8217;t have support for these CSS3 properties and values &#8212; the page looks like this:</p>
<p><img src="http://cdn.sixrevisions.com/0070-02_github_pe_ie7.jpg" width="550" height="392" /></p>
<p>The difference is subtle to most Internet users. What&#8217;s important is that the page functions as intended and is accessible to everyone.</p>
<p>The page just takes advantage of features that Chrome has that IE7 doesn&#8217;t. The web designer took advantage of IE&#8217;s proprietary <code>filter</code> CSS property to render the color gradients, but didn&#8217;t try to render the rounded corners using CSS background images and CSS/HTML markup tricks to mimic <code>text-shadow</code>.</p>
<p>Progressive enhancement is a key enabler to using CSS3 in your web designs today.</p>
<h3>Use Site Data to Make Decisions</h3>
<p><a href="http://sixrevisions.com/web_design/designing-by-numbers-data-analysis-for-web-designers/" title="Designing By Numbers: Data Analysis for Web Designers - sixrevisions.com">Web designers should use data to make sound judgments.</a> When working on a client&#8217;s site, it&#8217;s always useful to get some kind of data set about their current users.</p>
<p><a href="http://sixrevisions.com/tools/google-analytics-in-depth-goals-and-funnels/" title="Google Analytics in Depth: Goals and Funnels - sixrevisions.com">Google Analytics</a> (for example) is a completely free <a href="http://sixrevisions.com/usabilityaccessibility/unleashing-the-power-of-website-analytics/" title="Unleashing the Power of Website Analytics - sixrevisions.com">website analytics</a> tool. Even running it for a week on the client&#8217;s website can help you gain vital information. Website analytics can show you what browsers are being used to access the web property, and from there, you can then see what percentage of browsers can handle CSS3.</p>
<p>If you are seeing high percentages of Chrome and Safari (both use the WebKit layout engine) then you should rejoice because they can handle a lot of what CSS3 has to offer. A very rough approximation of a general demographic suggests that Safari and Chrome have about 7% and 10% (respectively) of the browser market. Those numbers can be a lot higher or a lot lower depending on the site and the audience it draws in. Going on those numbers, though, means that about <strong>1 in 5 people</strong> have the ability to experience CSS3.</p>
<p>Add to that the popular open source browser, Mozilla Firefox (and browsers like SeaMonkey and Flock that use the Mozilla layout engine), and the return of investment starts to look  better.</p>
<p>Then, with IE9 being released this month, it just makes sense to use more CSS3 than not. IE9 isn&#8217;t perfect &#8212; and it isn&#8217;t as feature-rich as Chrome and Firefox when it comes to CSS3 and HTML5 (and thus, we would still need progressive enhancement even if we disregard older versions of this browser line) &#8212; but <a href="http://sixrevisions.com/web-development/five-things-ie9-is-actually-doing-right/" title="Five Things IE9 is (Actually) Doing Right - sixrevisions.com">it&#8217;s a step in the right direction.</a></p>
<h3>Learn and Practice CSS3 on Your Own Site</h3>
<p>As a web designer, there&#8217;s a very big chance that you run your own <a href="http://sixrevisions.com/design-showcase-inspiration/30-visually-appealing-web-portfolio-designs/" title="30 Visually Appealing Web Portfolio Designs - sixrevisions.com">portfolio website.</a> <a href="http://sixrevisions.com/web_design/the-three-golden-rules-of-site-redesigns/" title="The Three Golden Rules of Site Redesigns - sixrevisions.com">Redesigning your site</a> with CSS3 and progressive enhancement let&#8217;s you learn through real world, practical experience.</p>
<p>Using CSS3 on your own website also gives you the opportunity to show off your newly acquired skills to prospective clients.</p>
<p>Many pioneering CSS3 techniques and experiments began on the portfolio websites of web designers and web developers. It&#8217;s a fertile environment for innovation.</p>
<h3>Summary</h3>
<p>By looking at website statistics and data, you can make decisions on what CSS3 specifications you can implement on a site-to-site basis. Leveraging progressive enhancement makes pragmatic implementation of CSS3 something you can do today, even when many Internet users are still using browsers that can&#8217;t render CSS3.</p>
<p>We are at a stage in web design where different designs between browsers is accepted &#8212; and even <em>expected</em>. If you&#8217;re still hesitant about using CSS3 in your project work, don&#8217;t be. Embrace CSS3.</p>
<h3>Related Content</h3>
<ul>
<li><a href="http://sixrevisions.com/tutorials/web-development-tutorials/psdhtml-conversion-elegant-and-simple-css3-web-layout/">PSD/HTML Conversion: Elegant and Simple CSS3 Web Layout</a></li>
<li><a href="http://sixrevisions.com/css/css3-demos-experiments/">10 Interesting CSS3 Experiments and Demos</a></li>
<li><a href="http://sixrevisions.com/css/how-to-create-inset-typography-with-css3/">How to Create Inset Typography with CSS3</a></li>
<li><em>Related categories</em>: <a href="http://sixrevisions.com/category/css/">CSS</a> and <a href="http://sixrevisions.com/category/web_design/">Web Design</a></li>
</ul>
<h3>About the Author</h3>
<p class="about-author"><img src="http://cdn.sixrevisions.com/authors/john_macpherson_small.jpg" alt="" width="80" height="80" /><strong>John Macpherson</strong> is keen photographer and works for 57 Degrees North who are <a href="http://www.57degreesnorth.co.uk/" target="_blank">web designers in Aberdeen</a>, Scotland. He can be followed on Twitter @<a href="http://twitter.com/johneemac">johneemac</a>. Visit his site: <a href="http://www.johnmacpherson.com/">johnmacpherson.com.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sixrevisions.com/css/embracing-and-using-css3-pragmatically/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>CSS Typography: Techniques and Best Practices</title>
		<link>http://sixrevisions.com/css/css-typography-02/</link>
		<comments>http://sixrevisions.com/css/css-typography-02/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 11:00:28 +0000</pubDate>
		<dc:creator>Jacob Gube</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://sixrevisions.com/?p=5033</guid>
		<description><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5033&c=1381364095' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5033&c=1381364095' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br />In the first part of this series, we discussed some fundamental concepts pertaining to CSS typography. Now we are going to cover some excellent techniques, tips, tricks and best practices for dealing with typography on websites. This is the second part of a three-part series of guides on CSS typography that will cover everything from [...]]]></description>
			<content:encoded><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5033&c=876870463' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5033&c=876870463' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br /><p><a href="http://sixrevisions.com/css/css-typography-02/"><img src="http://cdn.sixrevisions.com/0058-01_css_typography_techniques_bestpractices_thumbnail.png" width="550" height="200" alt="CSS Typography: Techniques and Best Practices" /></a></p>
<p>In the <a href="http://sixrevisions.com/css/css-typography-01/">first part</a> of this series, we discussed some fundamental concepts pertaining to CSS typography. Now we are going to cover some excellent techniques, tips, tricks and best practices for dealing with typography on websites.</p>
<p>This is the <strong>second part</strong> of a three-part series of guides on CSS typography that will cover everything from basic syntax to best practices and tools related to CSS typography.</p>
<p><span id="more-5033"></span></p>
<ul>
<li><a href="http://sixrevisions.com/css/css-typography-01/">CSS Typography: The Basics</a></li>
<li><strong>CSS Typography: Techniques and Best Practices </strong></li>
<li><a href="http://sixrevisions.com/css/css-typography-03/">CSS Typography: Examples and Tools</a></li>
</ul>
<h3>Better Web Typography with @font-face</h3>
<p>For normal text blocks, using smart font stacks (as discussed in the <a href="http://sixrevisions.com/css/css-typography-01/">first part</a>) is a good idea, but for headings and short text blocks, more interesting fonts can be used with the help of <a href="http://sixrevisions.com/css/font-face-guide/" title="The Essential Guide to @font-face - sixrevisions.com">@font-face</a>.</p>
<p>When implemented correctly, <code>@font-face</code> is compatible with a wide range of browsers &#8212; <a href="http://readableweb.com/ten-great-free-fonts-cross-browser-a-case-study-in-font-face/">yes, even IE</a>.</p>
<p>Just include a copy of the font&#8217;s file on your web server and use the <code>@font-face</code> rule in your CSS code as follows:</p>
<pre>@font-face {
  font-family: CurlzMTRegular;
  src: url(fonts/CurlzMTRegular.eot);
}</pre>
<p>Then just use the <code>font-family</code> declared above with your CSS:</p>
<pre>h1, h2, h3, h4, h5, h6 {
<strong>  /* Always use a font stack, even with custom web fonts! */</strong>
  font-family: CurlzMTRegular, Helvetica, Arial, sans-serif;
}</pre>
<p><img src="http://cdn.sixrevisions.com/0058-02_curlzmt.jpg" width="550" height="300" /></p>
<p>While IE4+ does support <code>@font-face</code>, the font does need to be in the <em>.eot</em> file format. Easy enough &#8212; just run any font of your choice through this converter first: <a href="http://ttf2eot.sebastiankippe.com/">ttf → eot Convertor</a>.</p>
<p>For more information on <code>@font-face</code>, please read the following:</p>
<ul>
<li><a href="http://sixrevisions.com/css/font-face-guide/">The Essential Guide to @font-face</a></li>
<li><a href="http://sixrevisions.com/web_design/google-font-api-guide/">A Guide to Google Font API</a></li>
</ul>
<p>For easier implementation of <code>@font-face</code>, check out Font Squirrel&#8217;s <a href="http://www.fontsquirrel.com/fontface/generator">@font-face generator</a>.</p>
<h3>Vertical Rhythm</h3>
<p>Designing web typography is all about legibility and readability.</p>
<p>A leading factor for great legibility and readability is how the text flows vertically on the page. Is the text too squished together, or is it too far apart? This is where an understanding and practical implementation of vertical rhythm can come in handy.</p>
<p><strong>Vertical rhythm</strong> is the spacing and arrangement of text as the user reads down the page.</p>
<p><img src="http://cdn.sixrevisions.com/0058-03_verticalrhythm.jpg" width="550" height="400" /><span class="figure-caption">Source: <a href="http://www.gettheeye.com/">Get The Eye</a></span></p>
<p>Vertical rhythm deals primarily with <code>font-size</code> and <code>line-height</code>, but also top/bottom margins and padding.</p>
<p>The concept of vertical rhythm is simple: Line heights, margins, and padding should all be equal or within even proportion.</p>
<p>Here&#8217;s an example:</p>
<pre>p, ol, ul, blockquote, pre, code {
  line-height: 18px;
  margin-bottom 18px;
<strong>  /* 1.5em provides good vertical spacing ( = 150% of the font-size) */</strong>
  line-height: 1.5em;
  margin-bottom: 1.5em;
}</pre>
<p>Consider top margins and padding with blocks of text (e.g. paragraphs, lists, block quotes), as well as with images and other block-level elements. Try to use the same <code>line-height</code> or use multiples of it (e.g.18px, 32px, 64px, and so on for the example above).</p>
<p>Even proportions are easy to do with a bit of math. Let&#8217;s try to figure out what the <code>line-height</code> should be in the following example.</p>
<pre>h1 {
  font-size: 2em;
  line-height: <strong>?</strong>;
}</pre>
<p>If the <code>line-height</code> for the <code>body</code> is set to <code>1.5em</code>, then we just need to divide that by our <code>font-size</code> to maintain the proportion: 1.5em/2em = 0.75em.</p>
<pre>h1 {
  font-size: 2em;
  line-height: <strong>0.75em</strong>;
}</pre>
<p>For font sizes bigger than the <code>line-height</code>, <code>line-height</code> must be decreased to match the baseline grid. For font sizes smaller than the <code>line-height</code>, we must increase the <code>line-height</code>.</p>
<p>We can determine the <code>line-height</code> for smaller font sizes with the same bit of math. Let&#8217;s try this again, but this time, our <code>font-size</code> is smaller than the <code>body</code> element&#8217;s <code>line-height</code>.</p>
<pre>h2 {
  font-size: .7em;
  line-height: <strong>?</strong>;
}</pre>
<p>If the <code>body</code>&#8216;s <code>line-height</code> is still <code>1.5em</code>, then we&#8217;ll take it and divided by our <code>font-size</code>: 1.5em/.7em = 2.14em.</p>
<pre>h2 {
  font-size: .7em;
  line-height: 2.14em;
}</pre>
<p>For more information on creating baseline or vertical rhythm in <a href="http://sixrevisions.com/web_design/a-guide-on-layout-types-in-web-design/" title="A Guide on Layout Types in Web Design - sixrevisions.com">web page layouts</a>, look through the resources listed below. There is also a handy <a href="http://drewish.com/tools/vertical-rhythm">vertical rhythm generator</a>, just in case you don&#8217;t want to do all that math.</p>
<ul>
<li><a href="http://24ways.org/2006/compose-to-a-vertical-rhythm">Compose to a Vertical Rhythm</a></li>
<li><a href="http://www.gettheeye.com/vertical-rhythm/">Get the Eye &#8211; Vertical Rhythm</a></li>
<li><a href="http://www.alistapart.com/articles/settingtypeontheweb">Setting Type on the Web to a Baseline Grid</a></li>
</ul>
<h3>Working with Text and Whitespace CSS Properties</h3>
<p><code>@font-face</code> and vertical rhythm can sometimes get overwhelming, so let&#8217;s slow things down a bit and get back to some basic techniques.</p>
<h4>Text CSS Properties</h4>
<p>The CSS text property group contains several properties for dealing with the style of text. Having a good understanding of these properties can help bring blocks of text in your designs to a more user-friendly level.</p>
<p>Here are some text CSS properties (their names are self-evident to what they&#8217;re for):</p>
<ul>
<li><code>text-align</code>: values can be <code>left</code>, <code>center</code>, <code>right</code>, or <code>justify</code></li>
<li><code>text-decoration</code>: values can be <code>overline</code>, <code>line-through</code>, or <code>underline</code> or <code>blink</code></li>
<li><code>text-transform</code>: values can be <code>uppercase</code>, <code>lowercase</code>, or <code>capitalize</code></li>
</ul>
<p>Let&#8217;s see how one of these properties works by way of an example. In the following example, we will indent the beginning of all paragraphs:</p>
<pre>p {
  text-indent: 3em;
}</pre>
<p><img src="http://cdn.sixrevisions.com/0058-04_textindent.jpg" width="550" height="300" /></p>
<h4>Text Direction</h4>
<p>You can set the direction of the text by using the <code>direction</code> property. The default direction is <code>ltr</code>, which is short for <em>left to right</em>. Suppose we wanted to reverse that, then we can set <code>direction</code> to <code>rtl</code>.</p>
<pre>p {
  direction: rtl;
}</pre>
<p><img src="http://cdn.sixrevisions.com/0058-05_direction.jpg" width="550" height="300" /></p>
<p>The <code>direction</code> property is not very popular because it has a very specialized purpose, but it can come in handy when working with other written languages. Many middle eastern languages, for example, are read right to left. </p>
<h4>White-space, Letter-spacing, and Word-Spacing</h4>
<p>These properties provide spacing between words and letters.</p>
<p>The <code>white-space</code> property controls how text wraps inside of its parent element. Values can be <code>normal</code>, <code>nowrap</code>, <code>pre</code>, <code>pre-line</code>, <code>pre-wrap</code> and <code>inherit</code>.</p>
<p>The <code>word-spacing</code> property affects the space in between words. Values can take any CSS unit of measurement (such as 0.5em or 5px).</p>
<p>The <code>letter-spacing</code> property is similar to the <code>word-spacing</code> property, however, it deals with the spacing in between individual characters instead. Values of this property can take any CSS unit of measurement.</p>
<h4>Text Shadows</h4>
<p><a href="http://sixrevisions.com/css/css3-techniques-you-should-know/" title="CSS3 Techniques You Should Know - sixrevisions.com">CSS3</a> gives us a few more CSS properties for use on web typography. One property that&#8217;s a new addition to CSS is <code>text-shadow</code>. Here&#8217;s the style rule for giving paragraphs a nice text shadow.</p>
<pre>p {
  text-shadow: 1px 1px 1px #000;
}</pre>
<p><img src="http://cdn.sixrevisions.com/0058-06_textshadow.jpg" width="550" height="300" /><span class="figure-caption">From: <a href="http://neutroncreations.com/">Neutron Creations</a></span></p>
<p>To create inset text, you can use negative values as such:</p>
<pre>h1  {
<strong>  /* Use negative offsets to create inset text. */</strong>
  text-shadow: #000 -1px -1px 0;<strong>
</strong>}</pre>
<p>To see <code>text-shadow</code> in action, check out this tutorial on <a href="http://sixrevisions.com/css/how-to-create-inset-typography-with-css3/" title="How to Create Inset Typography with CSS3 - sixrevisions.com">how to create inset typography using CSS3</a>.</p>
<h3>CSS Typography Best Practices</h3>
<p>What follows is a review of best practices that we&#8217;ve already covered, as well as a few additional ones. The key concept to keep in mind is that CSS typography is all about creating readable type that improves the user experience.</p>
<h4>Serif or Sans serif?</h4>
<p>There <a href="http://alexpoole.info/which-are-more-legible-serif-or-sans-serif-typefaces" title="Which Are More Legible: Serif or Sans Serif Typefaces? - alexpoole.info">isn&#8217;t any conclusive study</a> that indicates one group of type is more legible than the other. What affects legibility the most are the CSS properties we have discussed, such as <code>font-size</code> and <code>letter-spacing</code>.</p>
<p>For serif fonts, use more <code>line-height</code>, <code>letter-spacing</code>, and perhaps even <code>word-spacing</code> because serif fonts need some space to breathe and express their curvatures.</p>
<p>For sans serif fonts, the simpler font style can allow for tighter spacing and smaller font sizes with the least negative effect on legibility. </p>
<h4>Semantic Markup</h4>
<p>Always use proper markup. For example, use <code>&lt;strong&gt;</code> instead of <code>&lt;b&gt;</code> and <code>&lt;em&gt;</code> instead of <code>&lt;i&gt;</code>, then use CSS to style them.</p>
<p>Use headings (<code>h1-h6</code>) appropriately: to delineate sections of your content into logical groups. Using <code>&lt;h2&gt;</code> after <code>&lt;h1&gt;</code> means that the section that follows is a sub-section of <code>&lt;h1&gt;</code>. Use CSS to style them any way you want, but keep your markup semantic.</p>
<p>Use HTML tags to add value to the content of the HTML document, and use CSS to visually style them. For example, use <code>&lt;small&gt;</code> instead of <code>&lt;p class=&quot;smalltext&quot;&gt;</code>.</p>
<h4>Create Baseline Styles</h4>
<p>It&#8217;s always good practice to reduce the guessing game that browsers play when they can&#8217;t find a style rule for a particular element. Don&#8217;t forget to style basic HTML elements.</p>
<pre>h1, h2, h3, h4, h5, h6 {  }
p { }
ol, ul { }
a { }
blockquote { }
pre, code { }
small { }</pre>
<h4>Use 1.5em for Line-Height</h4>
<p>1.5em is the most common and recommended baseline <code>line-height</code>; it states that the line-height is +50% of the text&#8217;s <code>font-size</code>, giving blocks of text some vertical breathing room.</p>
<p>This isn&#8217;t to say that any other <code>line-height</code> value is bad; but when in doubt, 1.5em is a safe bet.</p>
<p>Using a relative unit of measurement for <code>line-height</code> also takes out the math involved in having to figure out the corresponding <code>line-height</code>, as shown in this example:</p>
<pre>p {
  font-size: 12px/1.5em;
}</pre>
<p>For a 12px <code>font-size</code>, an 18px <code>line-height</code> could be used to achieve the exact same result, but then you would have to recalculate what that value would be if your <code>font-size</code> changes for other elements.</p>
<h4>Use Shorthand CSS</h4>
<p>Always use shorthand wherever you can as it&#8217;s the conventional way of writing CSS nowadays.</p>
<p>Here is the shorthand structure for the <code>font</code> property: </p>
<pre>font: [font-style] [font-size]/[line-height] [font-family 1, font-family 2, ..., font-family n]</pre>
<p>For example:</p>
<pre>p {
  font: normal 12px/1.5em Arial, Helvetica, sans-serif;
}</pre>
<h3>Conclusion</h3>
<p>In this part, we covered some techniques, tricks, and best practices for CSS typography. In the <a href="http://sixrevisions.com/css/css-typography-03/">next part</a>, we will present you with some examples of great CSS typography as well as some tools that you can use to make your life easier.</p>
<ul>
<li><a href="http://sixrevisions.com/css/css-typography-01/">CSS Typography: The Basics</a></li>
<li><strong>CSS Typography: Techniques and Best Practices </strong></li>
<li><a href="http://sixrevisions.com/css/css-typography-03/">CSS Typography: Examples and Tools</a></li>
</ul>
<h3>Related Content</h3>
<ul>
<li><a href="http://sixrevisions.com/css/css3-demos-experiments/">10 Interesting CSS3 Experiments and Demos</a></li>
<li><a href="http://demos.sixrevisions.com/2010/08/26/Demo.html#spades">Playing Cards with CSS3!</a></li>
<li><a href="http://sixrevisions.com/css/3-advanced-css3-techniques-you-should-learn/">3 Advanced CSS3 Techniques You Should Learn</a></li>
<li><em>Related categories</em>: <a href="http://sixrevisions.com/category/css/">CSS</a> and <a href="http://sixrevisions.com/category/web_design/">Web Design</a></li>
</ul>
<h3>About the Author</h3>
<p class="about-author"><img src="http://images.sixrevisions.com/authors/kayla_knight_small.jpg" alt="" width="80" height="80" /><strong>Kayla Knight</strong> is a web designer and web developer who loves coding way too much for her own good. She does freelance design/development work and helps run the <a href="http://xhtmlshop.com/">XHTML Shop</a>. Connect with her by visiting <a href="http://kaylaknight.com/">her website</a> and following her on Twitter @ <a href="http://twitter.com/KaylaMaeKnight">KaylaMaeKnight</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sixrevisions.com/css/css-typography-02/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>CSS Typography: The Basics</title>
		<link>http://sixrevisions.com/css/css-typography-01/</link>
		<comments>http://sixrevisions.com/css/css-typography-01/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 11:00:04 +0000</pubDate>
		<dc:creator>Jacob Gube</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://sixrevisions.com/?p=5027</guid>
		<description><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5027&c=1489603648' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5027&c=1489603648' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br />Typography is an essential component of a website&#8217;s design. This is for good reason: good typography is not only imperative for aesthetic appeal, but also improves site usability when text legibility and readability concepts are applied. Typography is all about proportions and spacing. There are also font styles to consider. How can we use CSS [...]]]></description>
			<content:encoded><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5027&c=241464797' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5027&c=241464797' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br /><p><a href="http://sixrevisions.com/css/css-typography-01/"><img src="http://cdn.sixrevisions.com/0057-01_css_typography_basics_thumbnail.png" width="550" height="200" alt="CSS Typography: The Basics" /></a></p>
<p>Typography is an essential component of a website&#8217;s design. This is for good reason: good typography is not only imperative for aesthetic appeal, but also improves site usability when text legibility and readability concepts are applied. Typography is all about proportions and spacing. There are also font styles to consider.</p>
<p>How can we use <strong>CSS for great typography</strong> in our web designs? This is a question we&#8217;ll try to answer.</p>
<p>This is the <strong>first part</strong> of a three-part series of guides on CSS typography that will cover everything from basic syntax to best practices and tools related to CSS typography.</p>
<p><span id="more-5027"></span></p>
<ul>
<li><strong>CSS Typography: The Basics</strong></li>
<li><a href="http://sixrevisions.com/css/css-typography-02/">CSS Typography: Techniques and Best Practices</a></li>
<li><a href="http://sixrevisions.com/css/css-typography-03/">CSS Typography: Examples and Tools</a></li>
</ul>
<h3>Typography CSS Properties</h3>
<p>There are two main groups of CSS properties that control typography style: <a href="http://www.w3.org/TR/CSS21/fonts.html">font</a> and <a href="http://www.w3.org/TR/CSS21/text.html">text</a>.</p>
<p>The <strong>font</strong> CSS property group dictates general font characteristics such as <code>font-style</code> and <code>font-weight</code>. Below you&#8217;ll see the <code>p</code> element given a <code>font-style</code> and a <code>font-weight</code> property.</p>
<pre>p {
  font-style: oblique;
  font-weight: bold;
}</pre>
<p><img src="http://cdn.sixrevisions.com/0057-02_font_property.png" width="550" height="345" /></p>
<p>The <strong>text</strong> CSS property group deals with the characters, spaces, words and paragraphs. For example, the <code>text-indent</code> property indents the first line of a text block. The <code>letter-spacing</code> property controls the spaces between a text block. Below, you&#8217;ll see the <code>p</code> element given a <code>text-indent</code> and a <code>letter-spacing</code> property.</p>
<pre>p {
  text-indent: 50px;
  letter-spacing: 2px;
}</pre>
<p><img src="http://cdn.sixrevisions.com/0057-03_text_property.png" width="550" height="365" /></p>
<p>There are other CSS properties that can affect web typography outside of the fonts and text property groups. For example, the <code>color</code> property controls an HTML element&#8217;s foreground color, and can be used to change the color of text. Below, you&#8217;ll see the <code>p</code> element given a red color.</p>
<pre>p {
  color: red;
}</pre>
<p><img src="http://cdn.sixrevisions.com/0057-04_other_properties.png" width="550" height="325" /></p>
<h3>Font Sizing</h3>
<p>Browser compatibility is a major issue in web design, even more so if you are attempting to make your web designs look the same in all browsers. Beginning web designers may mess around with a font&#8217;s size until it looks just right, only to find it has completely changed among other browsers and platforms. Size fonts the correct way, and this problem can be minimized.</p>
<p>A simple use of sizing text is as follows:</p>
<pre>h6 {
  font-size: 12pt;
}</pre>
<p>The above sets the heading level-6 element to <code>12pt</code>.</p>
<p>For <code>font-size</code> values, there are 4 types of units of measurement.</p>
<h4>Absolute-size</h4>
<p>Standard keywords whose values are defined by the user agent (e.g., web browser). Values in W3C CSS 2.1 specifications are <code>xx-small</code>, <code>x-small</code>, <code>small</code>, <code>medium</code>, <code>large</code>, <code>x-large</code>, <code>xx-large</code>.</p>
<h4>Relative-size</h4>
<p>Standard keywords that size fonts based on the parent element. These are also defined by the user agent. Possible values are <code>larger</code> and <code>smaller</code>. Below you will see what a paragraph element looks like inside a parent element (<code>&lt;div&gt;</code>) that has a size  of <code>12pt</code> (in Firefox).</p>
<pre>div {
  font-size: 12pt;
}
p {
  font-size: large;
}</pre>
<p><img src="http://cdn.sixrevisions.com/0057-05_relative_font_size.png" width="550" height="353" /></p>
<p>Both keyword value groups (absolute-size and relative-size) can vary greatly between different browsers, so if your aim is to be pixel perfect, they might not be a good option, and most web designers avoid them altogether.</p>
<p>The <code>smaller</code> and <code>larger</code> keywords, however, can be great for convenient relative sizing when exact proportions don&#8217;t matter to the design. The <code>larger</code> and <code>smaller</code> values will inherit the parent element&#8217;s font-size and then relatively adjust the target element&#8217;s font-size accordingly. So, for example, if a parent element&#8217;s value is set to <code>small</code>, the <code>larger</code> keyword will make the child element larger. For most browsers, the change from exact units is around <strong>1.2 units</strong>, although that proportion is not consistent amongst all browsers.</p>
<p>As an example, if text is set to <code>12pt</code>, the <code>larger</code> keyword will resize the child element&#8217;s text to about <strong>12pt x 1.2</strong> (depending on the browser), which would equal <strong>14.4pt.</strong></p>
<h4>Absolute Lengths</h4>
<p>Absolute lengths are literal sizes. For example, <code>12px</code> is exactly 12 pixels and <code>2in</code> is exactly 2 inches. Absolute lengths are often used by web designers.</p>
<p>Possible units for absolute length units are <code>pt</code>, <code>px</code>, <code>mm</code>, <code>cm</code>, <code>in</code>, and <code>pc</code>.</p>
<p>Millimeters (<code>mm</code>), centimeters (<code>cm</code>), and inches (<code>in</code>) are more suitable to physical, real-world dimensions and are units of measurement often used in print design. They are not very suitable for screen-based measurements because of the high variance of screen resolutions.</p>
<p>Points (<code>pt</code>) and picas (<code>pc</code>) &#8212; while better than <code>mm</code>, <code>cm</code> and <code>in</code> &#8212; can also vary visually based on the browser or device&#8217;s dpi.</p>
<p>Therefore, when using absolute lengths, pixels (<code>px</code>) are the least problematic. One issue with <code>px</code>, though, is that older versions of IE cannot resize them natively. If developing for an audience that will likely resize text manually through their web browser, the <code>px</code> unit of measurement may not be a good option. Be sure when using <code>px</code> for font sizing that accessibility is not an issue.</p>
<h4>Relative Lengths</h4>
<p>The other type of length units are relative lengths. This means that their sizes are dependent on the <code>font-size</code> assigned to their parent element. Possible units are <code>em</code>, <code>%</code> and <code>ex</code>.</p>
<p>Not many web designers use <code>ex</code> &#8212; it is the height of the letter &quot;x&quot; in the current font.</p>
<p><code>em</code> and <code>%</code> values are far easier to work with. <code>em</code> and <code>%</code> act identically, and it&#8217;s just a matter of syntax:</p>
<ul>
<li><code>0.5em</code> is equal to <code>50%</code></li>
<li><code>1em</code> is equal to <code>100%</code></li>
<li><code>0.2em</code> is equal to <code>20%</code></li>
<li><code>0.73em</code> is equal to <code>73%</code></li>
<li><code>2.21em</code> is equal to <code>221%</code></li>
</ul>
<pre>html, body {
  font-size: 85%; <strong>/* = (.85em) */</strong>
}

h1 {
  font-size: 110%; <strong>/* = (1.1em) */</strong>
}</pre>
<p>The proportions are all relative to the element&#8217;s parent <code>font-size</code>. So, if the base font size (in <code>body</code> or <code>html</code>) is set to 80%, a  child with a <code>font-size</code> of <code>0.2em</code> or <code>20%</code> would be 20% in height of the original 80%.</p>
<h3>Font Stacks</h3>
<p>CSS font stacks are a list of fonts that include fonts that will work well in various operating systems and platforms, with the goal of making typography as consistent as possible.</p>
<p>Here is an example of a font stack:</p>
<pre>body {
  font-family: Georgia, Times, &quot;Times New Roman&quot;, serif;
}</pre>
<p>In the above example, the web browser will go from left to right until it finds a font in the user&#8217;s computer. For example, it will search for the Georgia font, and if it doesn&#8217;t find it, it will move on to the Times font, and so on.</p>
<p>There are many options for creating font stacks, and there are many popular premade font stacks available on blogs and in IDEs such as Dreamweaver.</p>
<p>The idea of a font stack is to provide ideal fonts that would be available on many computers, and then provide fallback fonts behind them to degrade to in case the preferred font is not available.</p>
<p>A good goal to strive for is to create beautiful typography for a wide range of users, but also account for the situation that the preferred font is not available to all users.</p>
<p>There are a few key items to keep in mind when creating custom font stacks:</p>
<ol>
<li>There should be a good amount of fallback fonts. Our above example only lists three, but it would be ideal if there were more.</li>
<li>The fonts selected should be available on a number of platforms. For example, Arial is widely used on Windows, while its near equivalent, Helvetica, is on nearly all Macs.</li>
<li>For font stacks that accomodate Linux users, check out <a href="http://sixrevisions.com/web_design/a-web-designers-guide-to-linux-fonts/">A Web Designer&#8217;s Guide to Linux Fonts</a>.</li>
</ol>
<h4>Best Practices for Developing Font Stacks</h4>
<p>All fonts in the same font stack should have the same (or similar) aspect ratios. Some fonts are wider or taller per letter than others are, giving them larger aspect ratios.</p>
<p>So, if we put Verdana (mostly Windows) with Helvetica (mostly Macs), we&#8217;ve met the above requirements. However, since Verdana is much wider than Helvetica, the text will look dramatically different on most Macs compared to most Windows computers.</p>
<p>The image below show the difference in aspect ratio among four common <a href="http://sixrevisions.com/web_design/a-comprehensive-guide-to-microsoft-vista-fonts-for-designers/" title="A Comprehensive Guide to Windows Vista Fonts for Designers - sixrevisions.com">Windows fonts</a>. As you can see, Verdana and Georgia are  wider and taller than both Arial and Times.</p>
<p><img src="http://cdn.sixrevisions.com/0057-06_aspectratio.jpg" width="550" height="300" /></p>
<p>In larger blocks of text, the difference is more apparent. If we had a font stack with Verdana to accommodate Windows and Helvetica for Macs, the image below shows the significant difference.</p>
<p><img src="http://cdn.sixrevisions.com/0057-07_differentaspectratios.jpg" width="550" height="300" /></p>
<p>So when developing font stacks:</p>
<ul>
<li>Make sure you account for the different operating systems (Windows, Mac, and Linux).</li>
<li>Make sure a font stack is all sans serif or is all serif (for consistency)</li>
<li>Make sure the fonts in the stack have similar aspect ratios.</li>
</ul>
<p>Here is a list of the most common fonts for various aspect ratio types:</p>
<ul>
<li><strong>Wide sans serif:</strong> Verdana, Geneva</li>
<li><strong>Narrow sans serif:</strong> Tahoma, Arial, Helvetica</li>
<li><strong>Wide serif:</strong> Georgia, Utopia</li>
<li><strong>Narrow serif:</strong> Times, Times New Roman</li>
<li><strong>Monospace:</strong> Courier, Courier New, Lucida Console</li>
</ul>
<p>If you need more help on font stacking, CodeStyle has created a very useful <a href="http://www.codestyle.org/servlets/FontStack">font stack builder</a> that includes all fonts between Mac, Windows, and Linux.</p>
<h3>CSS Typography Pseudo-classes and Pseudo-elements</h3>
<p>CSS pseudo-classes and pseudo-elements are great for targeting certain types of elements. Pseudo-classes start with a colon (<code>:</code>) followed by the class/element name.</p>
<p>There are several CSS pseudo-classes/pseudo-elements related to typography, such as <code>:hover</code> and <code>:first-letter</code>.</p>
<p>Let&#8217;s go over some that will help in styling our typography.</p>
<h4>Links and Dynamic Pseudo-classes</h4>
<p>The <a href="http://sixrevisions.com/web_design/designing-hyperlinks-tips-and-best-practices/" title="Designing Hyperlinks: Tips and Best Practices - sixrevisions.com">design of a website&#8217;s hyperlinks</a> is very important. Use anchor link pseudo-classes to create font styles for each link state.</p>
<p><code>:hover</code> is probably the most familiar, and it is good practice to create a separate (yet similar) style for it to provide a visual cue that a link element is interactive.</p>
<p>Here are the link pseudo-classes:</p>
<pre>a:link { color: #666666; text-decoration: none; }
a:visited { color: #333333; }
a:hover { text-decoration: underline; }
a:active { color: #000000; }</pre>
<h4>First, Last, and n-th Pseudo-elements</h4>
<p>The following pseudo-elements all relate to the position of an element relative to the HTML document and the other HTML elements in it.</p>
<p><code>:first-letter</code> allows you to target the first letter of an element. Here&#8217;s an example: </p>
<pre>p:first-letter {
  font-size: 30pt;
  display: block;
  float: left;
  margin: 0 5px 5px 0;
}</pre>
<p><img src="http://cdn.sixrevisions.com/0057-08_firstletter.jpg" width="550" height="300" /></p>
<p>As you can see, this pseudo-element can be helpful for creating <a href="http://en.wikipedia.org/wiki/Initial#Types_of_initials" title="Initial - en.wikipedia.org">drop caps</a>.</p>
<p><img src="http://cdn.sixrevisions.com/0057-09_dropcap.jpg" width="550" height="300" /></p>
<p>The <code>:first-line</code> pseudo-element allows you to select the first line of an HTML element containing text. Here&#8217;s an example for bolding the first line of text and making its letters uppercased:</p>
<pre>p:first-line {
  font-weight: bold;
  text-transform: uppercase;
}</pre>
<p><img src="http://cdn.sixrevisions.com/0057-10_firstline.jpg" width="550" height="300" /></p>
<p><code>:nth-child()</code> is a <a href="http://sixrevisions.com/css/css3-techniques-you-should-know/">CSS3</a> pseudo-element that will target that <em>n</em>th element in a page or parent element depending on the selector&#8217;s specificity. In our example below, we target the second paragraph on the page.</p>
<pre>p:nth-child(2) {
  background: #e7f0ce;
  padding: 10px;
}</pre>
<p><img src="http://cdn.sixrevisions.com/0057-11_nthchild.jpg" width="550" height="300" /></p>
<p>We could also target the second paragraph within a <code>div</code> or the second list item in a list as follows:</p>
<pre>div p:nth-child(2) {
  background: #e7f0ce;
  padding: 10px;
}

ul li:nth-child(2) {
  background: #e7f0ce;
  padding: 10px;
}</pre>
<p>Also play around with <code>:nth-child(even)</code> and <code>:nth-child(odd)</code> pseudo-classes to grab even and odd elements.</p>
<p>There is also the <code>:first-child</code> pseudo-element (CSS2) and the <code>:last-child</code> (CSS3) pseudo-element that can select the first and last element in a set.</p>
<h3>Conclusion</h3>
<p>We have covered the basics of CSS typography. With a bit of creativity, typography can go in some beautiful and interesting directions with CSS.</p>
<p>In the <a href="http://sixrevisions.com/css/css-typography-02/">next part</a>, we will discuss some CSS techniques and best practices pertaining to CSS typography.</p>
<ul>
<li><strong>CSS Typography: The Basics</strong></li>
<li><a href="http://sixrevisions.com/css/css-typography-02/">CSS Typography: Techniques and Best Practices</a></li>
<li><a href="http://sixrevisions.com/css/css-typography-03/">CSS Typography: Examples and Tools</a></li>
</ul>
<h3>Related Content</h3>
<ul>
<li><a href="http://sixrevisions.com/css/a-comprehensive-guide-to-css-resets/">A Comprehensive Guide to CSS Resets</a></li>
<li><a href="http://sixrevisions.com/css/100-exceedingly-useful-css-tips-and-tricks/">100 Exceedingly Useful CSS Tips and Tricks</a></li>
<li><a href="http://sixrevisions.com/css/10-random-css-tricks-you-might-want-to-know-about/">10 Random CSS Tricks You Might Want to Know About</a></li>
<li><em>Related categories</em>: <a href="http://sixrevisions.com/category/css/">CSS</a> and <a href="http://sixrevisions.com/category/web_design/">Web Design</a></li>
</ul>
<h3>About the Author</h3>
<p class="about-author"><img src="http://images.sixrevisions.com/authors/kayla_knight_small.jpg" alt="" width="80" height="80" /><strong>Kayla Knight</strong> is a web designer and web developer who loves coding way too much for her own good. She does freelance design/development work and helps run the <a href="http://xhtmlshop.com/">XHTML Shop</a>. Connect with her by visiting <a href="http://kaylaknight.com/">her website</a> and following her on Twitter @ <a href="http://twitter.com/KaylaMaeKnight">KaylaMaeKnight</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sixrevisions.com/css/css-typography-01/feed/</wfw:commentRss>
		<slash:comments>42</slash:comments>
		</item>
		<item>
		<title>How to Create Social Media Buttons Using CSS3</title>
		<link>http://sixrevisions.com/css/how-to-create-social-media-buttons-using-css3/</link>
		<comments>http://sixrevisions.com/css/how-to-create-social-media-buttons-using-css3/#comments</comments>
		<pubDate>Wed, 29 Dec 2010 11:00:13 +0000</pubDate>
		<dc:creator>Jacob Gube</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://sixrevisions.com/?p=4647</guid>
		<description><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4647&c=1384405683' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4647&c=1384405683' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br />CSS3 is truly amazing. It gives web designers the ability to create flexible and easily reusable design elements, and reduces our reliance on images and graphics editors. This is a guide shows you how to create stylish social media buttons using CSS3, HTML, and some freely available social media icons. View Demo 1: Inset Buttons [...]]]></description>
			<content:encoded><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4647&c=697182829' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4647&c=697182829' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br /><p><a href="http://sixrevisions.com/css/how-to-create-social-media-buttons-using-css3/"><img src="http://images.sixrevisions.com/2010/12/21-01_css3_social_media_buttons_ld_img.jpg" width="550" height="200" alt="How to Create Social Media Buttons Using CSS3" /></a></p>
<p><a href="http://sixrevisions.com/css/css3-techniques-you-should-know/" title="CSS3 Techniques You Should Know - sixrevisions.com">CSS3</a> is truly amazing. It gives web designers the ability to create flexible and easily reusable design elements, and reduces our reliance on images and graphics editors. This is a guide shows you how to create stylish social media buttons using CSS3, HTML, and some freely available social media icons.</p>
<p><span id="more-4647"></span></p>
<ul>
<li><a href="http://demos.sixrevisions.com/0002_css3_social_media_buttons/demos/inset_social_media_buttons.html">View Demo 1: Inset Buttons</a></li>
<li><a href="http://demos.sixrevisions.com/0002_css3_social_media_buttons/demos/outset_social_media_buttons.html">View Demo 2: Outset Buttons</a></li>
<li><a href="http://demos.sixrevisions.com/0002_css3_social_media_buttons/downloads/css3_social_media_buttons.zip">Download Source</a></li>
</ul>
<h3>Inspiration</h3>
<p>One day, I stumbled upon Louis Harboe&#8217;s personal website, <a href="http://graphicpeel.com/">Graphicpeel</a>, and I noticed his simple yet nicely designed social media buttons at the bottom of the site&#8217;s <a href="http://graphicpeel.com/about">About page</a>. I thought to myself, <em>these are nice but I bet I could do this using just CSS3</em>. And off I went!</p>
<p><img src="http://images.sixrevisions.com/2010/12/21-07_css3_social_media_buttons_inspiration.jpg" width="550" height="605" alt="Inspiration" /></p>
<h3>HTML</h3>
<p>First off, we will set the foundations with some simple HTML. We want to create a <code>div</code> that will contain our buttons and that has a class name of <code>inset</code>. Then we want use an unordered list (<code>&lt;ul&gt;</code>), with each button being a list item (<code>&lt;li&gt;</code>).</p>
<p>Inside each <code>&lt;li&gt;</code> tag, we will have a link (<code>&lt;a&gt;</code>). Each link will have an <code>&lt;img&gt;</code> inside it that represents the social media icon, as well as a <code>&lt;span&gt;</code> to hold the text for the button (which will be &quot;LinkedIn&quot;, &quot;Facebook&quot;, and so forth). The social media icons I used are from <a href="http://www.jankoatwarpspeed.com/post/2009/02/23/Handycons-2-another-free-hand-drawn-icon-set.aspx">Handycons 2</a> and <a href="http://webtreats.mysitemyway.com/108-free-matte-white-square-social-networking-icons/">108 Free Matte White Square Social Networking Icons.</a></p>
<p>We can give the <code>span</code> elements a class name of <code>site</code> to be able to style them later on.</p>
<p>Your HTML should look something like the following:</p>
<pre>
&lt;div <strong>class="inset"</strong>&gt;
 &lt;ul&gt;
  &lt;li&gt;
   &lt;a href="mailto:ansarob@gmail.com"&gt;
    &lt;img src="images/gmail_16.png" alt="gmail icon" /&gt;
    &lt;span <strong>class="site"</strong>&gt;E-Mail&lt;/span&gt;
   &lt;/a&gt;
  &lt;/li&gt;
  &lt;li&gt;
   &lt;a href="http://linkedin.com" title="My LinkedIn Page"&gt;
    &lt;img src="images/linkedin_16.png" alt="LinkedIn icon" /&gt;
    &lt;span <strong>class="site"</strong>&gt;LinkedIn&lt;/span&gt;
   &lt;/a&gt;
  &lt;/li&gt;
  &lt;li&gt;
   &lt;a href="http://facebook.com" title="My Facebook Page"&gt;
    &lt;img src="images/facebook_16.png" alt="Facebook icon" /&gt;
    &lt;span <strong>class="site"</strong>&gt;Facebook&lt;/span&gt;
   &lt;/a&gt;
  &lt;/li&gt;
  &lt;li&gt;
   &lt;a href="http://twitter.com" title="My Twitter Page"&gt;
    &lt;img src="images/twitter_16.png" alt="Twitter icon" /&gt;
    &lt;span <strong>class="site"</strong>&gt;Twitter&lt;/span&gt;
   &lt;/a&gt;
  &lt;/li&gt;
  &lt;li&gt;
   &lt;a href="http://flickr.com" title="My Flickr Page"&gt;
    &lt;img src="images/flickr_16.png" alt="Flickr icon" /&gt;
    &lt;span <strong>class="site"</strong>&gt;Flickr&lt;/span&gt;
   &lt;/a&gt;
  &lt;/li&gt;
 &lt;/ul&gt;
&lt;/div&gt;
</pre>
<h3>CSS</h3>
<p>The bulk of the code will be in CSS. We&#8217;ll go over the basic style rules first, and then progressively build up our buttons.</p>
<h4>Basic CSS</h4>
<p>Let us give our buttons some basic styles. The following code block simply uses CSS2 specs, which will give us a good fallback for browsers that don&#8217;t have support for CSS3 specifications (progressive enhancement).</p>
<p>The following is pretty self-explanatory: We just style the list items so that they appear to look like boxy buttons that are laid out side by side (using <code>display:block</code> and <code>float:left</code>).</p>
<pre>
.inset {
  font-family: Helvetica, Verdana, Arial, sans-serif;
  font-size: 14px;
  list-style-type: none;
  margin: 10px 0 0 10px;
}

.inset ul { list-style-type: none; display: block; }

.inset li {
  float: left;
  height: 30px;
  margin: 0 8px 7px 0;
}

.inset li a {
  background-color: gray;
  color: #424242;
  float: left;
  font-size: 16px;
  font-weight: bold;
  height: 24px;
  padding-left: 27px;
  padding-top: 6px;
  position: relative;
  text-decoration: none;
  border: 1px solid #bfc1c6;
}

.inset li a:hover {
  border: 1px solid #b4b7bb;
}

.inset li a img {
  height: 16px;
  left: 7px;
  margin-right: 7px;
  position: absolute;
  top: 7px;
  width: 16px;
    border: none;
}

.inset li a span {
  display: block;
  height: 22px;
  padding-right: 7px;
  overflow: hidden;
  <strong>/* width: 70px; Uncomment this to add a fixed width */</strong>
}

span.site { font-size: 14px; line-height: 20px; }</pre>
<p>What we have so far is pretty boring; but that&#8217;s to be expected since we haven&#8217;t used any CSS3 yet.</p>
<p><img src="http://images.sixrevisions.com/2010/12/21-02_css3_social_media_buttons_ccss2_basic.jpg" width="476" height="56" /></p>
<h4>Rounded Corners with CSS3</h4>
<p>To make these buttons look a bit more stylish, let&#8217;s give them some rounded corners using the <code>border-radius</code> property. Keep in mind that we must use vendor specific browser extensions for Mozilla (<code>-moz-</code> for browsers such as Firefox, SeaMonkey, and Flock) and WebKit (<code>-webkit-</code> for browsers such as Safari and Chrome). Other browsers such as Opera and <a href="http://sixrevisions.com/web-development/five-things-ie9-is-actually-doing-right/" title="Five Things IE9 is (Actually) Doing Right - sixrevisions.com">IE9</a> will recognize the <code>border-radius</code> property without vendor prefixes.</p>
<p>Add these properties to the <code>.inset li a</code> selector:</p>
<pre>
<strong>/* Mozilla browsers that use Gecko layout engine */</strong>
-moz-border-radius: 5px;
<strong>/* Safari and Chrome that use WebKit layout engine */</strong>
-webkit-border-radius: 5px;
<strong>/* W3C CSS Level 3.0 specifications. For Opera and IE9 */</strong>
border-radius: 5px;</pre>
<p><img src="http://images.sixrevisions.com/2010/12/21-03_css3_social_media_buttons_ccss3_rounded_corners.jpg" width="476" height="56" /></p>
<h4>Color Gradients with CSS3</h4>
<p>With CSS3 gradients, we can do some pretty cool stuff that otherwise would need to be done with CSS background images created in a graphics editor like <a href="http://sixrevisions.com/category/photoshop/">Photoshop</a>. CSS3 gradients allow us to add color gradients to any HTML element that can result in many interesting things such as <a href="http://css3wizardry.com/2010/08/19/css3-gradients-and-patterns/" title="CSS3 Gradients and Patterns - css3wizardry.com">CSS3 design patterns</a> and illustrative renderings such as <a href="http://sixrevisions.com/css/how-to-create-css3-christmas-tree-ornaments/" title="How to Create CSS3 Christmas Tree Ornaments - sixrevisions.com">Christmas baubles</a>.</p>
<p>To create the gradient on our buttons, we will use the gradient value syntax (i.e. <code>linear-gradient()</code> and <code>gradient()</code>) assigned to the <code>background</code> property.</p>
<p>The implementation for Mozilla browsers and WebKit browsers is different, so although we&#8217;re trying to do the same thing, the code will be different for each browser layout engine.</p>
<p>Notice that for Mozilla (<code>-moz-</code>), I have used percentages, whereas for WebKit (<code>-webkit-</code>) I have to use decimals; 1% in Mozilla is .01 in WebKit, 10% in Mozilla is equivalent to .10 in WebKit, and so on.</p>
<p>Add these styles to the <code>.inset li a</code> selector:</p>
<pre>
<strong>/* Mozilla browsers that use Gecko layout engine */</strong>
background: -moz-linear-gradient(#a5a7aa, #bec1c5 1%, #d8dbdf 10%, #d8dbdf);
<strong>/* Safari and Chrome that use WebKit layout engine */</strong>
background: -webkit-gradient(linear,left top,left bottom,color-stop(0, #a5a7aa),color-stop(.01, #bec1c5),color-stop(.10, #d8dbdf),color-stop(1, #d8dbdf));</pre>
<p><img src="http://images.sixrevisions.com/2010/12/21-04_css3_social_media_buttons_css3_gradients.jpg" width="476" height="56" alt="" /></p>
<h4>Styling the :hover Pseudo-class</h4>
<p>Let&#8217;s go ahead and change the way the buttons look when the user hovers over them. By changing up the gradient colors slightly when a user mouses over one of the buttons, we can give her a visual cue that it is clickable. If you wanted to make these even more visually-engaging, you may want to experiment with CSS3 <code>transform</code> functions.</p>
<p>Add these styles to the <code>.inset li a:hover</code> selector:</p>
<pre>
background: -moz-linear-gradient(#9c9fa2, #b4b7bb 1%, #cdd0d5 10%, #cdd0d5);
background: -webkit-gradient(linear,left top,left bottom,color-stop(0, #9c9fa2),color-stop(.01, #b4b7bb),color-stop(.10, #cdd0d5),color-stop(1, #cdd0d5));</pre>
<p>In the image below, I&#8217;ve hovered over the <em>E-mail</em> button. As you can see, it is slightly darker than the others.</p>
<p><img src="http://images.sixrevisions.com/2010/12/21-05_css3_social_media_buttons_hover_psuedo-class.jpg" width="476" height="56" alt="&lt;pre&gt;" /></p>
<h3>Alternative Result: &quot;Outset&quot; Buttons with Different Colors</h3>
<p>To demonstrate the flexibility that CSS3 offers, let us create a different version of the buttons using the same HTML structure.</p>
<h4>HTML</h4>
<p>In this example, we need to change the class of the containing <code>div</code> from <code>inset</code> to <code>outset-colored</code>.</p>
<p>Additionally, since each button will be a different color, we must also give them a unique class. We can assign these classes to the <code>&lt;a&gt;</code> tags; for example, Facebook will have <code>class=&quot;facebook&quot;</code>. You&#8217;re probably wondering why I chose to use the class attribute versus the ID attribute: It&#8217;s because I want to account for the situation that multiple buttons of the same class can appear on the same page.</p>
<p>Here is the HTML:</p>
<pre>
&lt;div <strong>class=&quot;outset-colored&quot;</strong>&gt;
  &lt;ul&gt;
    &lt;li&gt;
      &lt;a href=&quot;mailto:ansarob@gmail.com&quot; title=&quot;My E-Mail&quot; <strong>class=&quot;email&quot;</strong>&gt;
        &lt;img src=&quot;images/gmail_white.png&quot; alt=&quot;gmail icon&quot; /&gt;
        &lt;span class=&quot;site&quot;&gt;E-Mail&lt;/span&gt;
      &lt;/a&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;a href=&quot;http://linkedin.com&quot; title=&quot;My LinkedIn Page&quot; <strong>class=&quot;linkedin&quot;</strong>&gt;
        &lt;img src=&quot;images/linkedin_white.png&quot; alt=&quot;LinkedIn icon&quot; /&gt;
        &lt;span class=&quot;site&quot;&gt;LinkedIn&lt;/span&gt;
      &lt;/a&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;a href=&quot;http://facebook.com&quot; title=&quot;My Facebook Page&quot; <strong>class=&quot;facebook&quot;</strong>&gt;
        &lt;img src=&quot;images/facebook_white.png&quot; alt=&quot;Facebook icon&quot; /&gt;
        &lt;span class=&quot;site&quot;&gt;Facebook&lt;/span&gt;
      &lt;/a&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;a href=&quot;http://twitter.com&quot; title=&quot;My Twitter Page&quot; <strong>class=&quot;twitter&quot;</strong>&gt;
        &lt;img src=&quot;images/twitter_white.png&quot; alt=&quot;Twitter icon&quot; /&gt;
        &lt;span class=&quot;site&quot;&gt;Twitter&lt;/span&gt;
      &lt;/a&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;a href=&quot;http://flickr.com&quot; title=&quot;My Flickr Page&quot; <strong>class=&quot;flickr&quot;</strong>&gt;
        &lt;img src=&quot;images/flickr_white.png&quot; alt=&quot;Flickr icon&quot; /&gt;
        &lt;span class=&quot;site&quot;&gt;Flickr&lt;/span&gt;
      &lt;/a&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</pre>
<h4>CSS</h4>
<p>The CSS is lengthier than the original, but that&#8217;s because each button has a different color. The CSS3 used is very similar; the alternative result just has different color values for the gradients.</p>
<p>Here is the CSS for the alternative result:</p>
<pre>
<strong>/* COLORED OUTSET BUTTONS */</strong>

.outset-colored {
  font-family: Helvetica, Verdana, Arial, sans-serif;
  font-size: 14px;
  list-style-type: none;
  margin: 10px 0 0 10px;
}

.outset-colored ul { list-style-type: none; display: block; }

.outset-colored li {
  float: left;
  height: 30px;
  margin: 0 8px 7px 0;
}

.outset-colored li a {
  color: #424242;
  float: left;
  font-size: 16px;
  font-weight: bold;
  height: 24px;
  padding-left: 27px;
  padding-top: 6px;
  position: relative;
  text-decoration: none;
  border: 1px solid #bfc1c6;
  border-radius: 5px;
  background-color: #D8D9DD;
  -moz-border-radius: 5px;
  -webkit-border-radius: 5px;
}
<strong>
/* EMAIL */</strong>
.outset-colored li a.email {
  background: -moz-linear-gradient(#ff6666, #cc0000 10%, #c40202);
  background: -webkit-gradient(linear,left top,left bottom,color-stop(0, #ff6666),color-stop(.10, #cc0000),color-stop(1, #c40202));
  color: #f3f3f3;
  border: 1px solid #c40202;
}

.outset-colored li a:hover.email {
  background: -moz-linear-gradient(#c40202, #cc0000 1%, #e03434 10%, #e03434);
  background: -webkit-gradient(linear,left top,left bottom,color-stop(0, #c40202),color-stop(.01, #cc0000),color-stop(.10, #e03434),color-stop(1, #e03434));
}

<strong>/* LINKEDIN */</strong>
.outset-colored li a.linkedin {
  background: -moz-linear-gradient(#7cd0fb, #38a5dc 10%, #2c83ae);
  background: -webkit-gradient(linear,left top,left bottom,color-stop(0, #7cd0fb),color-stop(.10, #38a5dc),color-stop(1, #2c83ae));
  color: #f3f3f3;
  border: 1px solid #2c83ae;
}

.outset-colored li a:hover.linkedin {
  background: -moz-linear-gradient(#2c83ae, #38a5dc 1%, #41b9f6 10%, #41b9f6);
  background: -webkit-gradient(linear,left top,left bottom,color-stop(0, #2c83ae),color-stop(.01, #38a5dc),color-stop(.10, #41b9f6),color-stop(1, #41b9f6));
}

<strong>/* FACEBOOK */</strong>
.outset-colored li a.facebook {
  background: -moz-linear-gradient(#7aa3f7, #4c72c3 10%, #3b5998);
  background: -webkit-gradient(linear,left top,left bottom,color-stop(0, #7aa3f7),color-stop(.10, #4c72c3),color-stop(1, #3b5998));
  color: #f3f3f3;
  border: 1px solid #3b5998;
}

.outset-colored li a:hover.facebook {
  background: -moz-linear-gradient(#3b5998, #4c72c3 1%, #5c8aea 10%, #5c8aea);
  background: -webkit-gradient(linear,left top,left bottom,color-stop(0, #3b5998),color-stop(.01, #4c72c3),color-stop(.10, #5c8aea),color-stop(1, #5c8aea));
}

<strong>/* TWITTER */</strong>
.outset-colored li a.twitter {
  background: -moz-linear-gradient(#8ae0fd, #24bce6 10%, #1e9ec1);
  background: -webkit-gradient(linear,left top,left bottom,color-stop(0, #8ae0fd),color-stop(.10, #24bce6),color-stop(1, #1e9ec1));
  color: #f3f3f3;
  border: 1px solid #1e9ec1;
}

.outset-colored li a:hover.twitter {
  background: -moz-linear-gradient(#1e9ec1, #24bce6 1%, #33ccff 10%, #33ccff);
  background: -webkit-gradient(linear,left top,left bottom,color-stop(0, #24bce6),color-stop(.01, #33ccff),color-stop(.10, #33ccff),color-stop(1, #33ccff));
}

<strong>/* FLICKR */</strong>
.outset-colored li a.flickr {
  background: -moz-linear-gradient(#fc75ba, #e10374 10%, #c10263);
  background: -webkit-gradient(linear,left top,left bottom,color-stop(0, #fc75ba),color-stop(.10, #e10374),color-stop(1, #c10263));
  color: #f3f3f3;
  border: 1px solid #c10263;
}

.outset-colored li a:hover.flickr {
  background: -moz-linear-gradient(#c10263, #e10374 1%, #ff0283 10%, #ff0283);
  background: -webkit-gradient(linear,left top,left bottom,color-stop(0, #c10263),color-stop(.01, #e10374),color-stop(.10, #ff0283),color-stop(1, #ff0283));
}

.outset-colored li a img {
  height: 16px;
  left: 7px;
  margin-right: 7px;
  position: absolute;
  top: 7px;
  width: 16px;
   border: none;
}

.outset-colored li a span {
  display: block;
  height: 22px;
  padding-right: 7px;
  overflow: hidden;
  <strong>/*width: 70px; Add a width here if you want all the buttons to be the same size.*/</strong>
}

span.site { font-size: 14px; line-height: 20px; }
</pre>
<p><img src="http://images.sixrevisions.com/2010/12/21-06_css3_social_media_buttons_outset_colored.jpg" width="476" height="56" alt="" />
</p>
<h3>Related Content</h3>
<ul>
<li><a href="http://sixrevisions.com/css/create-a-css3-call-to-action-button/">Create a CSS3 Call to Action Button</a></li>
<li><a href="http://sixrevisions.com/css/semantic-css3-lightboxes/">Semantic CSS3 Lightboxes</a></li>
<li><a href="http://sixrevisions.com/css/how-to-create-css3-christmas-tree-ornaments/">How to Create CSS3 Christmas Tree Ornaments</a></li>
<li><em>Related categories</em>: <a href="http://sixrevisions.com/category/css/">CSS</a> and <a href="http://sixrevisions.com/category/web_design/">Web Design</a></li>
</ul>
<h3>About the Author</h3>
<p class="about-author"><img src="http://images.sixrevisions.com/authors/andrew_roberts_small.jpg" alt="" width="80" height="80" /><strong>Andrew Roberts</strong> is a Christian with a passion for web design and development. His web interests focus mostly on HTML/CSS, JavaScript, &amp; PHP/MySQL. When he&#8217;s not glued to the computer, he&#8217;s spending time with his girlfriend Kaitlynn, <a href="http://www.flickr.com/photos/zoonino">photographing animals</a>, or reading. His goal is to attend graduate school for Biblical Studies &amp; Ministry.</p>
]]></content:encoded>
			<wfw:commentRss>http://sixrevisions.com/css/how-to-create-social-media-buttons-using-css3/feed/</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
		<item>
		<title>Should You Reset Your CSS?</title>
		<link>http://sixrevisions.com/css/should-you-reset-your-css/</link>
		<comments>http://sixrevisions.com/css/should-you-reset-your-css/#comments</comments>
		<pubDate>Thu, 23 Dec 2010 16:30:02 +0000</pubDate>
		<dc:creator>Jacob Gube</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://sixrevisions.com/?p=4620</guid>
		<description><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4620&c=1792138515' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4620&c=1792138515' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br />This article explores the ongoing debate on whether or not web designers and web developers should reset their CSS, sharing the thoughts and opinions of several web professionals. This is a three-part series of articles on the topic of CSS resets. After discussing the rich and interesting history of CSS resets (Part 1) and going [...]]]></description>
			<content:encoded><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4620&c=1869068901' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4620&c=1869068901' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br /><p><img src="http://images.sixrevisions.com/2010/12/17-01_should_use_cssresets_ld_img.png" width="550" height="200" alt="Should You Reset Your CSS?" /></p>
<p>This article explores the ongoing debate on whether or not web designers and web developers should reset their CSS, sharing the thoughts and opinions of several web professionals.</p>
<p><span id="more-4620"></span></p>
<p>This is a three-part series of articles on the topic of CSS resets. After discussing the rich and interesting history of CSS resets (<a href="http://sixrevisions.com/css/the-history-of-css-resets/">Part 1</a>) and going over CSS reset stylesheet options (<a href="http://sixrevisions.com/css/a-comprehensive-guide-to-css-resets/">Part 2</a>), we will now discuss the pros and cons of using reset stylesheets here in Part 3.</p>
<ul>
<li><a href="http://sixrevisions.com/css/the-history-of-css-resets/">Part 1: The History of CSS Reset</a></li>
<li><a href="http://sixrevisions.com/css/a-comprehensive-guide-to-css-resets/">Part 2: A Comprehensive Guide to CSS Resets</a></li>
<li><a href="http://sixrevisions.com/css/should-you-reset-your-css/">Part 3: Should You Reset Your CSS?</a></li>
</ul>
<h3>The Benefits of Resetting Your CSS</h3>
<p>Web designer/developer and book author <a href="http://www.designisphilosophy.com/">Morten Rand-Hendriksen</a> is a huge fan of CSS resets; he has <a href="http://www.designisphilosophy.com/css/why-a-css-reset-should-be-at-the-core-of-your-stylesheet/">advised</a> everyone to use them as the foundation of their stylesheets. &quot;If you don&#8217;t define all the default CSS parameters in your style sheet, the browser will use its default parameters instead,&quot; Rand-Hendriksen said in his blog. &quot;And since different browsers have different parameters your site will end up looking different depending on what browser you use.&quot;</p>
<p>In an interview by email, <a href="http://css-tricks.com/">Chris Coyier</a>&#8211;a web developer and the founder of the web design community, CSS-Tricks&#8211;expressed support for the universal selector margin/padding reset (discussed in <a href="http://sixrevisions.com/css/the-history-of-css-resets/">Part 1</a>). He said that all he&#8217;s &quot;ever used is <code>* { margin: 0; padding: 0; }</code>.&quot;</p>
<p>Defending the &quot;hard reset&quot; method, Coyier outlined two main concerns that web designers typically have against using the universal selector.</p>
<p>The first is that it can break web browser default styles for things such as form elements, which he said was &quot;untrue&quot; unless you use a <code>border:0 </code> property in the style rule.</p>
<p>The other concern of using the universal selector to reset your styles is the <a href="http://code.google.com/speed/page-speed/docs/rendering.html#UseEfficientCSSSelectors">performance hit</a> caused by using such an unspecific selector. But Coyier argues that, while this is true technically, &quot;almost all slowdowns that occurs from it is so minuscule that I guarantee nobody will ever notice.&quot;</p>
<h3>In Support of No CSS Reset</h3>
<p>Web developer <a href="http://covertprestige.net/">Florent Verschelde</a> made a strong case for <a href="http://covertprestige.info/css/base-stylesheet/">not using CSS resets</a>, and instead, suggests that web designers should rely on well-crafted stylesheets to address cross-browser inconsistencies. Verschelde argues that &quot;browser defaults are sensible and useful.&quot;</p>
<p>Thanks to the default style rules of web browsers, &quot;your content will always be readable (though not sexy),&quot; according to Verschelde. &quot;If you take them away, you risk having content (say, user-generated content) that ends up being unstyled, raw.&quot;</p>
<p>Most designers and developers who believe that browser defaults cause most layout problems are wrong, according to Verschelde. &quot;With sufficient knowledge of CSS, you will realize that most of those things you thought were inconsistencies due to browser defaults are actually caused by poor understanding of the collapsing margins standard mechanism; <code>hasLayout</code> bugs in IE 6-7,&quot; he said.</p>
<p>Most of the actual inconsistencies crop up in the margins and padding of the <code>body</code> element, the margins and padding of lists, and heading font sizes. &quot;If you feel like those few inconsistencies justify setting everything to zero then having to specify the exact margin and padding of most elements in each situation, then do use a reset stylesheet,&quot; Verschelde said. For those looking for a different solution, he offered his &quot;no reset&quot; <a href="http://covertprestige.info/css/base-stylesheet/">base stylesheet</a> as an alternative.</p>
<p>In 2008, developer/designer Jens Meiert <a href="http://meiert.com/en/blog/20080419/reset-style-sheets-are-bad/">wrote</a>, &quot;reset style sheets are bad: A novice should not use them, an expert would not use them.&quot; Meiert justifies his contention by noting that reset stylesheets assign baseline defaults that are just overwritten later on anyway (which makes your CSS inefficient and redundant).</p>
<p>In a blog post titled <em><a href="http://snook.ca/archives/html_and_css/no_css_reset/">No CSS Reset</a></em>, developer and book author Jonathan Snook said that he&#8217;s &quot;okay if the various browsers show things slightly differently.&quot; He likes his &quot;lists to have bullets and strong elements to have bolded text.&quot;</p>
<p>Web standards and accessibility advocate, <a href="http://autisticcuckoo.net/">Tommy Olsson</a>, professes that he&#8217;s not &quot;a big fan of CSS resets&quot; in an interview via email in late 2010. He said people that use CSS resets are &quot;stuck in a print design mindset,&quot; and are continuing to believe in the myth of &quot;Pixel Perfection&quot;. He finds CSS reset stylesheets inefficient, because you &quot;provide a lot of rules that you know you&#8217;re going to override later.&quot;</p>
<h3>Main Concerns with CSS Reset Stylesheets</h3>
<p>Russ Weakley pointed out <a href="http://www.maxdesign.com.au/articles/css-reset/" title="CSS Reset - a simpler option">three major concerns with resetting your CSS</a>:</p>
<ol>
<li>Every element that is &quot;zeroed&quot; must then be redefined. This can cause an increase in CSS file size.</li>
<li>CSS reset stylesheets can present issues if you remove the default behavior for an element and then forget to restyle it.</li>
<li>Some reset stylesheets can be harmful to users who rely on keyboards for navigation.</li>
</ol>
<p>In a 2010 interview by email, Weakley said that he was surprised when he found that designers and developers used his caveats as evidence that resets should not be used at all. He said that CSS reset stylesheets should be viewed as another tool that designers could use, tweak, and modify to suit their own needs.</p>
<h3>Problems with the Universal Selector</h3>
<p>Web developer Dave Ward noted <a href="http://msdn.microsoft.com/en-us/scriptjunkie/gg257960.aspx">three problems</a> associated with using the universal selector (*).</p>
<p>First, more properties than just margins and padding need to be reset.</p>
<p>Second, the &quot;collateral damage&quot; from the use of the universal selector &quot;wreaks havoc on form styling.&quot;</p>
<p>Third, the universal selector &quot;has negative performance implications in almost every scenario, whether a CSS reset or routine CSS styling.&quot; </p>
<h3>Unloading on Eric Meyer&#8217;s Reset CSS</h3>
<p> Eric Meyer&#8217;s <a href="http://meyerweb.com/eric/tools/css/reset/index.html">Reset CSS</a>&#8211;perhaps currently the most popular CSS reset stylesheet&#8211;has come under fire in more than a few occasions.</p>
<p>It seems that many users failed to read Meyer&#8217;s discussions of Reset CSS and just dropped it into their designs without paying attention to the author&#8217;s advice that it should be used as &quot;a starting point, not a self-contained black box of no-touchiness.&quot;</p>
<h4>Dissecting Reset CSS</h4>
<p>In 2007, web developer <a href="http://gtwebdev.com/workshop/" title="html and css workshop">Gary Turner</a> dissected Meyer&#8217;s Reset CSS, in part, to argue against CSS reset stylesheets in general (read his forum post titled <em><a href="http://csscreator.com/node/34411#comment-145634">Global resets considered harmful</a></em>). He noted that Reset CSS includes deprecated items (such as <code>&lt;applet&gt;</code> and <code>&lt;center&gt;</code>) as well as unnecessary/redundant styling of elements that already have no padding or margin (such as <code>&lt;a&gt;</code> and <code>&lt;img&gt;</code>).</p>
<p>Turner is pretty vocal about his opposition to the entire concept of resets, but his opinions don&#8217;t go entirely unopposed. In a <a href="http://www.sitepoint.com/forums/showpost.php?p=4262864&amp;postcount=42" title="SitePoint forum post">SitePoint forum post</a>, web designer <a href="http://www.danschulzrip.com/" title="In memory of Dan Schulz">Dan Schulz</a> suggested that &quot;being able to kill the margins on non-form elements&quot; helps a lot.</p>
<p>&quot;It&#8217;s a lot like the way the Marine Corps trains its recruits. In order to build up a Marine, you first have to tear down the teen,&quot; he said.</p>
<h4>The Use of :focus in Reset CSS</h4>
<p>In a slideshow presentation, Weakley cited the following code as being harmful to keyboard users:</p>
<pre>:focus {outline: 0}</pre>
<p>When there is no visual representation of the active element (such as a link), it makes web page navigation difficult for keyboard users because they are unable to see which HTML element they are currently on.</p>
<p><img src="http://images.sixrevisions.com/2010/12/17-02_outline_focus_css_issue.jpg" width="550" height="517" alt=":focus in Reset CSS" /></p>
<p>In an email interview, Meyer discussed the <code>:focus</code> controversy and said that he didn&#8217;t anticipate that people would just use Reset CSS without first understanding how it worked. Regarding the <code>:focus</code> style rule, he said: &quot;Honestly, I put it in there to get people to define one. Clearly what I should have done was have outlined 3px solid red or something like that.&quot;</p>
<p>&quot;From an accessibility viewpoint the mistake was in mentioning it at all, unfortunately. But on the other hand, you can&#8217;t really get away with, &#8216;Maybe if we don&#8217;t mention this, no one will ever notice it.&#8217; They always notice it,&quot; Meyer said.</p>
<p>Meyer promised an update to Reset CSS which will probably take the rule out and replace it with a comment reminding its users to define a visible <code>:focus</code> style rule.</p>
<p>The importance of making sure that the <code>:focus</code> pseudo-class selector has a visual property is such that a website called <a href="http://www.outlinenone.com/">outlinenone.com</a> has the single mission of warning against setting the <code>outline</code> CSS property to <code>none</code> or <code>0</code> for links. To learn more about this issue, Patrick Lauke has a <a href="http://24ways.org/2009/dont-lose-your-focus">tutorial on styling the :focus pseudo-class</a>.</p>
<h3>The Voices of Moderation</h3>
<p>Naturally, there&#8217;s a middle ground to this whole thing. In November 2009, author and designer Jason Cranford Teague <a href="http://www.peachpit.com/blogs/blog.aspx?uk=To-CSS-Reset-or-Not-to-CSS-Reset">examined</a> the issues revolving around resetting CSS and came down firmly in the center. He suggests that the use of resets should be determined by the needs of the web design project.</p>
<p>He noted the same pros and cons others had discussed about the use of resets and concluded that you should keep yours as simple as possible. &quot;Keep it simple, keep it compressed, and keep it at the top,&quot; Teague advised.</p>
<p>Meyer himself is quite <a href="http://meyerweb.com/eric/thoughts/2008/04/17/crafting-ourselves/">evenhanded about the use of resets</a>. In April 2008, he wrote: &quot;They&#8217;re a starting point. If a thousand people took them and created a thousand different personalized style sheets, that would be right on the money. But there&#8217;s also nothing wrong with taking them and writing your own overrides. If that works for you, then awesome. For others, reset styles are more of an impediment. That&#8217;s only to be expected; we all work in different ways.&quot;</p>
<p>Eric Meyer says that the key is to &quot;evaluate various tools by thinking about how they relate to the ways you do what you do &#8212; and then choose what tools to use, and how, and when. That&#8217;s the mark of someone who thinks seriously about their craft and strives to do it better.&quot;</p>
<h3>Acknowledgements</h3>
<p>Thank you to the individuals that contributed to this three-part series on CSS resets.</p>
<ul>
<li><a href="http://farukat.es/" title="Faruk Ates">Faruk Ateş</a></li>
<li><a href="http://tantek.com" title="Tantek Celik">Tantek Çelik</a></li>
<li><a href="http://richclarkdesign.com/" title="Richard Clark">Richard Clark</a></li>
<li><a href="http://css-tricks.com" title="Chris Coyier">Chris Coyier</a></li>
<li><a href="http://www.hitechy.com/" title="Alex Dawson">Alex Dawson</a></li>
<li><a href="http://nate.koechley.com/" title="Nate Koechley">Nate Koechley</a></li>
<li><a href="http://leftjustified.net" title="Andrew Krespanis">Andrew Krespanis</a></li>
<li><a href="http://meyerweb.com/" title="Eric Meyer">Eric Meyer</a></li>
<li><a href="http://www.pmob.co.uk/" title="Paul O'Brien">Paul O&#8217;Brien</a></li>
<li><a href="http://www.autisticcuckoo.net/">Tommy Olsson</a></li>
<li><a href="http://www.maxdesign.com.au/" title="Russ Weakley">Russ Weakley</a></li>
<li>My friends and colleagues on the <a href="http://www.sitepoint.com/forums" title="SitePoint forums">SitePoint forums</a></li>
</ul>
<h3>CSS Reset Resources and Tools</h3>
<ul>
<li><a href="http://leftjustified.net/journal/2004/10/07/css-negotiation/">CSS Negotiation and a Sanity Saving Shortcut</a></li>
<li><a href="http://meyerweb.com/eric/tools/css/reset/">CSS Tools: Reset CSS</a></li>
<li><a href="http://web.archive.org/web/20051029075519/kurafire.net/log/archive/2005/07/26/starting-css-revisited">Starting with CSS: revisited</a></li>
<li><a href="http://html5doctor.com/html-5-reset-stylesheet/">HTML5 Reset Stylesheet</a></li>
<li><a href="http://tantek.com/log/2004/09.html#d06t2354">Undoing html.css and using debug scaffolding</a></li>
<li><a href="http://tantek.com/2010/undohtml.css">undohtml.css</a> (2010)</li>
<li><a href="http://developer.yahoo.com/yui/3/" title="YUI 3--Yahoo! User Interface Library">YUI 3 Library</a></li>
</ul>
<h3>Related Content</h3>
<ul>
<li><a href="http://sixrevisions.com/css/css-tips/css-tip-1-resetting-your-styles-with-css-reset/">Resetting Your Styles with CSS Reset</a></li>
<li><a href="http://sixrevisions.com/css/css-tips/css-tip-2-structural-naming-convention-in-css/">Structural Naming Convention in CSS</a></li>
<li><a href="http://sixrevisions.com/css/100-exceedingly-useful-css-tips-and-tricks/">100 Exceedingly Useful CSS Tips and Tricks</a></li>
<li><em>Related categories</em>: <a href="http://sixrevisions.com/category/css/">CSS</a> and <a href="http://sixrevisions.com/category/web_design/">Web Design</a></li>
</ul>
<h3>About the Author</h3>
<p class="about-author"><img src="http://images.sixrevisions.com/authors/michael_tuck_small.jpg" alt="" width="80" height="80" /><strong>Michael Tuck</strong> is an educator, writer, and freelance web designer. He serves as an advisor to the <a href="http://www.sitepoint.com/forums/forumdisplay.php?f=1" title="SitePoint Web Design Forum">Web Design forum on SitePoint</a>. When he isn&#8217;t teaching or designing sites, he is doing research for the <a href="http://www.historycommons.org" title="History Commons">History Commons</a>. You can contact him through his website, <a href="http://www.iraqtimeline.com/maxdesign/" title="Black Max Web Design">Black Max Web Design</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sixrevisions.com/css/should-you-reset-your-css/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>How to Create CSS3 Christmas Tree Ornaments</title>
		<link>http://sixrevisions.com/css/how-to-create-css3-christmas-tree-ornaments/</link>
		<comments>http://sixrevisions.com/css/how-to-create-css3-christmas-tree-ornaments/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 11:44:32 +0000</pubDate>
		<dc:creator>Jacob Gube</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://sixrevisions.com/?p=4607</guid>
		<description><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4607&c=1846301100' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4607&c=1846301100' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br />In this guide, we will display the power of CSS3 in drawing complex shapes. We will magically create Christmas tree ornaments using only CSS3 and HTML (no images). In particular, we will be drawing baubles, which are the hallmark ornamentation of Christmas trees. Note that this is merely a fun, proof-of-concept that explores the possible [...]]]></description>
			<content:encoded><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4607&c=1384991201' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4607&c=1384991201' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br /><p><img src="http://images.sixrevisions.com/2010/12/14-01_css3_christmastree_ornaments_chrome_ld_img.jpg" width="550" height="200" alt="How to Create CSS3 Christmas Tree Ornaments" /></p>
<p>In this guide, we will display the power of CSS3 in drawing complex shapes. We will magically create Christmas tree ornaments using only CSS3 and HTML (no images). In particular, we will be drawing <a href="http://en.wikipedia.org/wiki/Bauble" title="Bauble - en.wikipedia.org">baubles</a>, which are the hallmark ornamentation of Christmas trees.</p>
<p><span id="more-4607"></span></p>
<p>Note that this is merely a fun, proof-of-concept that explores the possible applications of CSS3. If you intend to use this in production, you should be aware that what we will be creating uses W3C specifications that are not yet, or will never be, supported in many browsers (such as IE6 through IE8). Also, the markup must be updated in order to avoid empty <code>div</code> elements.</p>
<ul>
<li><a href="http://demos.sixrevisions.com/0001_css3_christmas_ornaments/demos/css3_christmas_tree_ornaments.html">View Demo</a></li>
<li><a href="http://demos.sixrevisions.com/0001_css3_christmas_ornaments/downloads/css3_christmas_tree_ornaments.zip">Download Source</a></li>
</ul>
<h3>CSS Ingredients</h3>
<p>Before we get started, let&#8217;s just quickly go over what we be using.</p>
<ol>
<li><code><strong>:before</strong></code><strong> and <code>:after</code>&nbsp;<a href="http://www.w3.org/TR/CSS2/generate.html#before-after-content" target="_blank">pseudo-elements</a>:</strong> Using pseudo-elements will help us in reducing the amount of unnecessary HTML we need to use. If you have worked with rounded corners in CSS2 before, you probably know that, in order to produce flexible rounded corners that accommodate various sizes of content, you had to use a lot of empty divs and such. By using these elements, we will have minimal markup. In this case, just one empty <code>div</code> per bauble, which, if you were enterprising, you would fill with some text content. Note that these pseudo-elements are in CSS2 specs.</li>
<li><strong>CSS3 linear and radial&nbsp;<a href="http://www.red-team-design.com/css-gradients-quick-tutorial">gradients</a>:</strong> To get the metallic color fills and shines of the baubles, we will use color gradients.</li>
<li><strong>Box shadows, transformations, border radius, etc.:</strong> To create the shapes, we will be using a combination of <code>box-shadow</code>, <code>transform</code>, and <code>border-radius</code> (for rounded corners).</li>
</ol>
<h3>HTML</h3>
<p>First, let us create the markup. As you can see below, the structure is quite minimal and contains only the minimum amount of markup necessary.</p>
<p>Since the globes need to be block elements, I chose to go with <code>&lt;div&gt;</code> instead of <code>&lt;span&gt;</code>, however, if you are not comfortable with that, you can use <code>&lt;span&gt;</code> tags and then use the <code>display: block</code> CSS property/value pair.</p>
<p>I have placed them in an unordered list because I decided that they are a group of items with no particular hierarchy (e.g. <code>red-bauble</code> is not greater than <code>green-bauble</code>), and so, to me, the metaphor of unordered lists is retained.</p>
<pre>&lt;ul id=&quot;<strong>bauble-container</strong>&quot;&gt;
  &lt;li&gt;
    &lt;div class=&quot;<strong>bauble</strong> <strong>red-bauble</strong>&quot;&gt;&lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;div class=&quot;<strong>bauble</strong> <strong>blue-bauble</strong>&quot;&gt;&lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;div class=&quot;<strong>bauble</strong> <strong>yellow-bauble</strong>&quot;&gt;&lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;div class=&quot;<strong>bauble</strong> <strong>green-bauble</strong>&quot;&gt;&lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;</pre>
<h4>Explanation of the IDs/classes:</h4>
<ol>
<li><code>#bauble-container</code> is our unordered list, which will be used for targeting the list items (<code>&lt;li&gt;</code>) with greater specificity.</li>
<li><code>.bauble</code> is the main part of the ornament; the spherical shape.</li>
<li><code>.red-bauble</code>, <code>.blue-bauble</code>, <code>.yellow-bauble</code> and <code>.green-bauble</code>&nbsp;are the classes used for adding color variations. It makes our work flexible so that, if you wanted various combinations, you&#8217;re not stuck with the color combinations I chose. For example, you could have two yellow baubles or no yellow baubles&#8211;that&#8217;s why we use classes, and not IDs, for these.</li>
</ol>
<h3>CSS</h3>
<p>What follows are the style rules that will turn our boring unordered list above into a magical set of Christmas tree ornaments.</p>
<p>For discussion, I have commented the CSS below so that you can see how it works to highlight the major parts of the CSS.</p>
<p>Note that, in production, you would not want this much commenting in your stylesheet because it is over the top and because it can increase your stylesheet&#8217;s file size.</p>
<pre><strong>/* General */</strong>
html
{
	background: #f2f5f6; <strong>/* Fallback background color if gradients are not supported */</strong>
	background: -moz-linear-gradient(top, #f2f5f6, #c8d7dc);
	background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #c8d7dc),color-stop(1, #f2f5f6));
	height: 100%;
}

#bauble-container
{
  list-style: none; <strong>/* Remove bullets */</strong>
  width: 568px;
  margin: 150px auto; <strong>/* Center it */</strong>
  padding: 0; <strong>/* In production, this may not be needed if you reset your styles in your global stylesheet:
                 http://sixrevisions.com/css/css-tips/css-tip-1-resetting-your-styles-with-css-reset/ */</strong>
}

#bauble-container li
{
  margin: 0 20px; <strong>/* let's add some space */</strong>
  float: left; <strong>/* place them in line */</strong>
}

<strong>/* This is the part where the Christmas bauble string is added */</strong>
#bauble-container li:before
{
	content: "";
	background: #dadada; <strong>/* Fallback */	</strong>
	background: -moz-linear-gradient(bottom, #9c9c9c, rgba(255,255,255,0) );
	background: -webkit-gradient(linear, left bottom, right top, from(#9c9c9c), color-stop(100%, rgba(255,255,255,0)));
	height: 50px;
	width: 2px;
	display: block;
	margin: 0 auto;
}

<strong>/* Alernatively rotate them */</strong>
#bauble-container li:nth-child(odd)
{
	-moz-transform: rotate(-5deg); <strong>/* Firefox */</strong>
	-webkit-transform: rotate(-5deg); <strong>/* Chrome and Safari */</strong>
	-o-transform: rotate(-5deg); <strong>/* Opera */</strong>
	-ms-transform: rotate(-5deg); <strong>/* Surprise! IE9 with its own prefix */</strong>
}

#bauble-container li:nth-child(even)
{
	-moz-transform: rotate(5deg);
	-webkit-transform: rotate(5deg);
	-o-transform: rotate(5deg);
	-ms-transform: rotate(5deg);
}
<strong>
/* Style the bauble */</strong>
.bauble
{
	-moz-border-radius: 100px;
	border-radius: 100px;

	-moz-box-shadow: 0 0 5px #777777;
	box-shadow: 0 0 5px #777777;
	-webkit-box-shadow: 0 0 5px #777777;

	border: 1px solid rgba(0,0,0,0.3);
	position: relative;
	height: 100px;
	width: 100px;
}

<strong>/* Style the bauble head */
</strong>.bauble:before
{
	content: "";

	background: #fff; <strong>/* Fallback */</strong>
	background: -moz-linear-gradient(left, #fff, #9c9c9c, #fff, #9c9c9c );
	background: -webkit-gradient(linear, left center, right center, from(#fff), color-stop(25%, #9c9c9c), color-stop(50%, #fff), color-stop(75%, #9c9c9c)); 

	-moz-border-radius: 2px;
	border-radius: 2px;

	-moz-box-shadow: 0 1px 0 rgba(0,0,0,0.2), 0 -1px 0 rgba(255,255,255,0.3) inset;
	box-shadow: 0 1px 0 rgba(0,0,0,0.2), 0 -1px 0 rgba(255,255,255,0.3) inset;
	-webkit-box-shadow: 0 1px 0 rgba(0,0,0,0.2), 0 -1px 0 rgba(255,255,255,0.3) inset;

	border: 1px solid #dadada ;
	height: 10px;
	width: 20px;
	position: absolute;
	left: 50%;
	top: -12px;
	margin-left: -10px;
}

<strong>/* Add bauble light reflection */	</strong>
.bauble:after
{
	content: "";

	-moz-border-radius: 100px;
	border-radius: 100px;

	background: #fff; <strong>/* Fallback */</strong>
	background: -moz-linear-gradient(bottom, #fff, rgba(255,255,255,0.1) );
	background: -webkit-gradient(linear, left bottom, right top, from(#fff), color-stop(100%, rgba(255,255,255,0.1))); 

	position: absolute;
	top: 0;
	left: 50%;
	margin-left: -40px;
	opacity: 0.15;
	height: 80px;
	width: 80px;
}

<strong>/* Colorize them */</strong>
.red-bauble
{
	background: #c8171f;
	background: -moz-radial-gradient(center 45deg,circle cover, #f9d0be, #c8171f);
	background: -webkit-gradient(radial, 40% 40%, 0, 40% 40%, 50, from(#f9d0be), to(#c8171f));
}

.blue-bauble
{
	background: #00a1ee; <strong>/* Fallback */</strong>
	background: -moz-radial-gradient(center 45deg,circle cover, #cde6f9, #00a1ee);
	background: -webkit-gradient(radial, 40% 40%, 0, 40% 40%, 50, from(#cde6f9), to(#00a1ee));
}

.yellow-bauble
{
	background: #fcb83d; <strong>/* Fallback */	</strong>
	background: -moz-radial-gradient(center 45deg,circle cover, #fcf3a6, #fcb83d);
	background: -webkit-gradient(radial, 40% 40%, 0, 40% 40%, 50, from(#fcf3a6), to(#fcb83d));
}

.green-bauble
{
	background: #4d8d00; <strong>/* Fallback */</strong>
	background: -moz-radial-gradient(center 45deg,circle cover, #d1e5b2, #4d8d00);
	background: -webkit-gradient(radial, 40% 40%, 0, 40% 40%, 50, from(#d1e5b2), to(#4d8d00));
}</pre>
<h3>Comparison of How Web Browsers Render CSS3</h3>
<p>So how does our work look in various browsers? Let&#8217;s have a look, shall we?</p>
<h4>Mozilla Firefox 3.6</h4>
<p><img src="http://images.sixrevisions.com/2010/12/14-02_css3_christmastree_ornaments_mozilla.jpg" width="550" height="200" alt="Mozilla Firefox 3.6" /></p>
<h4>Google Chrome 6.0.4</h4>
<p>In Google Chrome, you may notice slightly different color tones because of the difference in the way the CSS3 gradients are rendered.</p>
<p><img src="http://images.sixrevisions.com/2010/12/14-01_css3_christmastree_ornaments_chrome_ld_img.jpg" width="550" height="200" alt="Google Chrome 6.0.4" /></p>
<h4>Safari 5.02</h4>
<p>The ornaments in Safari and Chrome are almost identical because they use the same layout engine (<a href="http://webkit.org/">WebKit</a>).</p>
<p><img src="http://images.sixrevisions.com/2010/12/14-03_css3_christmastree_ornaments_safari.jpg" width="550" height="200" alt="Safari 5.02" /></p>
<h4>Opera 10.63</h4>
<p>Although Opera browsers support most of the W3C CSS3 specs, the color gradients are missing so they degrade to the solid color we set for the <code>background</code> properties.</p>
<p><img src="http://images.sixrevisions.com/2010/12/14-04_css3_christmastree_ornaments_opera.jpg" width="550" height="200" alt="Opera 10.63" /></p>
<h4>IE9 Preview</h4>
<p>IE9 behaves similarly to Opera, but the latest news regarding this browser is that it will support 2D transformations like WebKit (with its own vendor prefix, <code>-ms-</code>).</p>
<p><img src="http://images.sixrevisions.com/2010/12/14-05_css3_christmastree_ornaments_ie9preview.jpg" width="550" height="200" alt="IE9 Preview" /></p>
<h4>IE8</h4>
<p>Even if IE8 has support for pseudo-elements like <code>:before</code> and <code>:after</code>, it totally lacks CSS3 support, so our baubles look like boxes. I included it here just for you to see how our work degrades in browsers that do not have CSS3 support. They look like <a href="http://en.wikipedia.org/wiki/Floppy_disk">floppy disks</a> (linked because our younger audience might not know what these ancient devices are), so they might be suitable for a geeky family&#8217;s Christmas tree!</p>
<p><img src="http://images.sixrevisions.com/2010/12/14-06_css3_christmastree_ornaments_ie8.jpg" width="550" height="200" alt="IE8" /></p>
<p>IE6 and IE7 couldn&#8217;t join our Christmas party for well-known reasons: they&nbsp;<a href="http://www.quirksmode.org/css/contents.html">lack</a>&nbsp;more than just CSS3 specifications support, but also the <code>:before</code> and <code>:after</code> pseudo-elements; so we would just have four squares with different colors in these two browsers.</p>
<p>I hope you were inspired to <a href="http://sixrevisions.com/css/20-useful-resources-for-learning-about-css3/" title="20 Useful Resources for Learning about CSS3 - sixrevisions.com">learn about CSS3</a> in this guide and that you have discovered a trick or two that you can use in your projects. I wish you a Merry Christmas and Happy Holidays!</p>
<h3>Related Content</h3>
<ul>
<li><a href="http://sixrevisions.com/css/100-exceedingly-useful-css-tips-and-tricks/">100 Exceedingly Useful CSS Tips and Tricks</a></li>
<li><a href="http://sixrevisions.com/css/a-comprehensive-guide-to-css-resets/">A Comprehensive Guide to CSS Resets</a></li>
<li><a href="http://sixrevisions.com/css/css3-card-trick-a-fun-css3-experiment/">CSS3 Card Trick: A Fun CSS3 Experiment</a></li>
<li><em>Related categories</em>: <a href="http://sixrevisions.com/category/css/">CSS</a> and <a href="http://sixrevisions.com/category/web_design/">Web Design</a></li>
</ul>
<h3>About the Author</h3>
<p class="about-author"><img src="http://images.sixrevisions.com/authors/catalin_rosu_small.jpg" alt="" width="80" height="80" /><strong>Catalin Rosu</strong>, a.k.a. Red, is a web designer and developer with over 5 years experience in the industry. You can find articles or tutorials on CSS tips and tricks by visiting his blog at <a href="http://www.red-team-design.com/">red-team-design.com</a>. You can connect with him on Twitter as @<a href="http://www.twitter.com/catalinred">catalinred</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sixrevisions.com/css/how-to-create-css3-christmas-tree-ornaments/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

