<?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>TYPESETT &#187; CSS</title>
	<atom:link href="http://www.typesett.com/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.typesett.com</link>
	<description>Your AMUSING Resource for Useful Design, Typography and Web Dev Articles</description>
	<lastBuildDate>Thu, 25 Mar 2010 07:05:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Object Oriented CSS (OOCSS): The Lowdown</title>
		<link>http://www.typesett.com/2010/01/object-oriented-css-oocss-the-lowdown/</link>
		<comments>http://www.typesett.com/2010/01/object-oriented-css-oocss-the-lowdown/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 06:55:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.typesett.com/?p=1136</guid>
		<description><![CDATA[So I recently came across the idea of Object Oriented CSS (OOCSS) at An Event Apart San Francisco this year. The speaker was Nicole Sullivan, who is the leader in evangelizing and developing Object Oriented CSS. She makes a solid argument that best practice CSS techniques should be used and that we can build on [...]]]></description>
			<content:encoded><![CDATA[<p><strong>So I recently came across the idea of Object Oriented CSS</strong> (OOCSS) at <a href="http://aneventapart.com/2009/sanfrancisco/">An Event Apart San Francisco</a> this year. The speaker was <a href="http://www.stubbornella.org">Nicole Sullivan</a>, who is the leader in evangelizing and developing <a href="http://wiki.github.com/stubbornella/oocss">Object Oriented CSS</a>. She makes a solid argument that best practice CSS techniques should be used and that we can build on those techniques to create even more efficient CSS for everyone involved.</p>
<p><img src="http://www.typesett.com/wp-content/uploads/2010/01/oocss.gif" alt="OOCSS" /><br />
<span id="more-1136"></span><br />
<strong>There is a bit of controversy about the nature of calling it &#8220;Object Oriented&#8221; and the specific usage benefits of the techniques.</strong> This article will delve into what it is, how it can be used and link to different resources on the web for you to learn more as these concepts are in their fledgling stages. Don&#8217;t blame me for what it&#8217;s called. I just found it interesting and somewhat useful and wanted to share.</p>
<h5>What are the principles behind &#8220;Object Oriented&#8221; programming?</h5>
<p><em>I&#8217;m going to spare you the geek-speak and tell you straight up</em> — <strong>it&#8217;s basically programming blocks of code that you can use over again. </strong></p>
<p>Those blocks of code are often called &#8220;<strong>objects</strong>&#8221; in other programming languages and with HTML/CSS they are often referred to as &#8220;<strong>modules</strong>&#8220;. So for our purposes, OOCSS is basically a flexible HTML structure that you can apply sets of efficient and flexible CSS to. </p>
<h5>The Dirty Secret of OOCSS</h5>
<p>For those of you who live and die CSS — you already know&#8230; We already do this! It&#8217;s the nature of the cascade. Consider this example:</p>
<p><img src="http://www.typesett.com/wp-content/uploads/2010/01/diagram-1.gif" alt="Diagram 1" /></p>
<p>So we already know of some OOCSS because they are basically best practice CSS techniques that have become more or less common place.</p>
<h5>Advanced CSS Techniques First Please</h5>
<h6>Be Classy</h6>
<p><img src="http://www.typesett.com/wp-content/uploads/2010/01/diagram-2.gif" alt="Diagram 2" /></p>
<p>ID selectors are meant for single use and Class selectors are meant for multiple use. So make sure you&#8217;re not using ID selectors for repeating styles as using Class selectors give you flexibility and of course re-usability.</p>
<h6>No Twins Allowed</h6>
<p><img src="http://www.typesett.com/wp-content/uploads/2010/01/diagram-3.gif" alt="Diagram 3" /></p>
<p>Nicole Sullivan points out that if you have styles that are very similar they should be the same. Learn to design efficiently because OOCSS will do you no good if you&#8217;re essentially re-creating the same modules (but slightly different) over and over again. (The size of the text in the diagram is slightly different.)</p>
<h6>Seperate Stucture (HTML) and Skin (CSS)</h6>
<p><img src="http://www.typesett.com/wp-content/uploads/2010/01/diagram-4.gif" alt="Diagram 4" /></p>
<p>Properties like height and width are hard to use repeatedly (in respect to modules) so it&#8217;s best to use CSS as intended and leave structure to be determined by content and &#8220;learn to love grids&#8221; (to quote OOCSS royalty; Nicole Sullivan).</p>
<h5>Can We Get To The OOCSS Yet?</h5>
<p><strong>As Nicole Sullivan says</strong> — treat the modules like site-wide legos and start to build a component library that your modules will be composed of. First you define the defaults and then you start building classes that build upon the cascade.</p>
<h6>Define Defaults</h6>
<p>Start off with the defaults that you can then alter with a class. For instance, setting the size and font via the default and then use classes to become more and more specific with color, style and etc. </p>
<p><img src="http://www.typesett.com/wp-content/uploads/2010/01/diagram-6.gif" alt="Diagram 6" /><br />
<strong>So you may have an instance where you have a h1 with a classes of h3.</strong> <em>Honestly, this doesn&#8217;t feel great to me but I have come across having to define headers over and over again. So although this feels wrong, I&#8217;m not knocking it untlI try it.</em></p>
<h6>Build On The Defaults With Classes</h6>
<p><img src="http://www.typesett.com/wp-content/uploads/2010/01/diagram-5.gif" alt="Diagram 5" /><br />
<strong>Avoid styling elements and localized ID selectors and try styling classes instead.</strong></p>
<h6>Use The <del>Force,</del>Cascade <del>Luke</del></h6>
<p><img src="http://www.typesett.com/wp-content/uploads/2010/01/diagram-7.gif" alt="Diagram 7" /><br />
<strong>For the class components to work, they need to be the same strength so the cascade will overide the previous rule.</strong> So that means you can&#8217;t have some classes deprecated and expect all your CSS components to work in the way OOCSS was meant for.</p>
<h6>Localizing is Evil in OOCSS</h6>
<p><img src="http://www.typesett.com/wp-content/uploads/2010/01/diagram-8.gif" alt="Diagram 8" /><br />
<strong>There are instances where you can get a little local on websites such as the masthead logo.</strong> However, you don&#8217;t want to paint yourself into a corner by localizing because when you re-use a class it won&#8217;t make sense semantically. Being semantic is a best practice that goes along with OOCSS as it will hopefully be easier to share with co-workers and train n00bs. </p>
<h6>Over Specyfying Is Evil Too</h6>
<p><img src="http://www.typesett.com/wp-content/uploads/2010/01/diagram-9.gif" alt="Diagram 9" /><br />
<strong>The whole point of OOCSS is to make things efficient.</strong> If you over-specify, then I daresay you&#8217;re repeating yourself and although semantically correct&#8230; this is code bloat. If you continue down this path, it will only continue to grow.</p>
<h6>Avoid Code Sequels</h6>
<p><img src="http://www.typesett.com/wp-content/uploads/2010/01/diagram-10.jpg" alt="Diagram 9" /><br />
As you can see from Nicole Sullivan&#8217;s slide — rather than duplicating a class, just extend it for maximum efficiency.</p>
<h5>The Bigger The Website Audience, The More Rewarding</h5>
<p>Let&#8217;s be honest. Localizing is not evil for everybody but it certainly becomes more difficult to work with and is more conducive for code bloat as the website grows. It&#8217;s up to you on whether or not these OOCSS techniques are useful or not, so please I implore you to explore and help the CSS community form an opinion on some of these new ideas. Here are some links I used to bone up on the subject and believe me, there are more tasty nuggets in these resources that  may be helpful to you that I may not have covered.</p>
<p><strong>Nicole Sullivan is the OOCSS project queen over at Guthub:</strong><br />
<a href="http://wiki.github.com/stubbornella/oocss">Object Oriented CSS, Grids on Github</a></p>
<p><strong>Nicole Sullivan Kickin&#8217; It at Yahoo!</strong><br />
<a href="http://developer.yahoo.net/blogs/theater/archives/2009/03/website_and_webapp_performance.html">Object Oriented CSS video on YDN</a></p>
<p><strong>Nicole Sullivan&#8217;s Often Referenced OOCSS Slide Presentation</strong><br />
<a href="http://www.slideshare.net/stubbornella/object-oriented-css?type=powerpoint">SlideShare.net: Object Oriented CSS</a></p>
<p><strong>Net Tuts did a Tutorial. Although a cool &#8220;tut&#8221; by Andrew Burgess, he uses HTML5/CSS3 in his examples which confuses the subject.</strong><br />
<a href="http://net.tutsplus.com/tutorials/html-css-techniques/object-oriented-css-what-how-and-why/">Object-Oriented CSS: What, How, and Why</a></p>
<h5>Let me know if I missed anything!</h5>
]]></content:encoded>
			<wfw:commentRss>http://www.typesett.com/2010/01/object-oriented-css-oocss-the-lowdown/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Six Years of Suckerfish Dropdown Menus</title>
		<link>http://www.typesett.com/2009/10/six-years-of-suckerfish-dropdown-menus/</link>
		<comments>http://www.typesett.com/2009/10/six-years-of-suckerfish-dropdown-menus/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 05:18:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Best of Industry]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Dev]]></category>

		<guid isPermaLink="false">http://www.typesett.com/?p=1077</guid>
		<description><![CDATA[If you've ever done the <strong>"dropdown dance"</strong> while developing your websites and avoided clunky code while still attempting to be standards compliant, accessible and semantic — then you know about the <strong>Suckerfish</strong> menus made popular on <a href="http://www.alistapart.com/articles/dropdowns"><strong>A List Apart</strong></a>.  That article was published on November 7th, 2003, so that means we will be celebrating the sixth year anniversary of friendly neighborhood dropdown.]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve ever done the <a href="http://www.alistapart.com/articles/dropdowns"><strong>&#8220;dropdown dance&#8221;</strong></a> while developing your websites and avoided clunky code while still attempting to be standards compliant, accessible and semantic — then you know about the <strong>Suckerfish</strong> menus made popular on <a href="http://www.alistapart.com/articles/dropdowns"><strong>A List Apart</strong></a>.  That article was published on November 7th, 2003, so that means we will be celebrating the sixth year anniversary of our favorite friendly neighborhood dropdown.</p>
<p><img src="http://www.typesett.com/wp-content/uploads/2009/10/suckerfish-dropdowns.gif" alt="Celebrating 6 Years of Suckerfish Menus" /></a></p>
<p><span id="more-1077"></span></p>
<h5>The History</h5>
<p>Patrick Griffiths and Dan Webb are credited with coming up with a simple CSS and javascript-based  dropdown menu that was originally published on ALA. With the influence of ALA over the years, the popularity of the Suckerfish menu technique has grown in popularity and the basic concept of their technique — using the pseudo :hover class as the trigger — drives many a dropdown across the interwebz.</p>
<p>With the now outdated IE6 slowly being taken out to pasture, modern browsers are even more optimized to use Suckerfish-style menus. IE6 for those of you who forgot — did not support the pseudo :hover class and that&#8217;s why the simple javascript is necessary at all. It triggers the dropdown action for that browser. While most of us still try to support IE6, it&#8217;s no longer a top-priority as it once was. </p>
<p>Patrick Griffiths and Dan Webb have updated this landmark menu technique since the original and called it the <a href="http://htmldog.com/articles/suckerfish/dropdowns/">&#8220;Son of Suckerfish Dropdowns&#8221;</a> on their now defunct <a href="http://htmldog.com/">HTML Dog</a> website. They&#8217;ve expanded the functionality to include multiple levels and reduce the javascript as well as other compatibility enhancements.</p>
<p><img src="http://www.typesett.com/wp-content/uploads/2009/10/htmldog.gif" alt="HTML Dog Screen Shot" /></p>
<p><a href="http://htmldog.com/articles/suckerfish/dropdowns/"><strong>Visit Patrick Griffiths and Dan Webb&#8217;s &#8220;Son of Suckerfish Dropdowns&#8221; @ HTML Dog.</strong></a></p>
<p><img src="http://www.typesett.com/wp-content/uploads/2009/10/htmldog-example.gif" alt="Suckerfish Example" /></p>
<p><a href="http://htmldog.com/articles/suckerfish/dropdowns/example/"><strong>See an example from HTML Dog.</strong></a></p>
<h5>Why Suckerfish Dropdowns?</h5>
<p><strong>It&#8217;s Lightweight and Easy To Use</strong><br />
Using this technique requires using three web languages. HTML, CSS and Javascript. The HTML and CSS portions are already necessary if you plan to have a menu of any kind and the javascript is there for IE6 and even then it&#8217;s just few lines of code supplied to you that you don&#8217;t have to edit. For those of you who have searched around for dropdown menus, you&#8217;ll know it&#8217;s really tough to find a simple solution that works on a standards compliant browser AND the IE6s of the world. There is always a caveat&#8230; intense javascript based on conditions, tables, intense CSS and etc.</p>
<p><strong>It&#8217;s Standards Compliant &#038; Accessible</strong><br />
The dropdown menu structure is marked up as a regular ol&#8217; HTML list. It&#8217;s styled by CSS. The javascript can be used in conjunction with the CDATA tag and hence be seen as character data and pass validation.</p>
<p><a href="http://htmldog.com/articles/suckerfish/dropdowns/"><img src="http://www.typesett.com/wp-content/uploads/2009/10/htmldog-example-1.gif" alt="A List" /></a></p>
<p><strong>It&#8217;s Popular and Well Supported by the Community</strong><br />
Every implementation of the technique will be unique and without a doubt — you&#8217;ll have a bug. The great thing about Suckerfish dropdowns is that it&#8217;s now pretty mature and well adopted by the community. Issues have been documented and supported and many work-arounds and fixes are already available online a google search away.</p>
<p>I had the common Suckerfish :focus problem where parts of the menu would remain visible or &#8220;sticky&#8221; depending on how the :focus was triggered on IE7. I looked around and found a simple fix here and <a href="http://www.builtfromsource.com/2006/10/23/a-fix-for-suckerfish-dropdowns-in-ie-7/">voila</a>, problem solved!</p>
<p>So although you may not have the same problem, you can be sure you&#8217;ll probably have better luck finding help for Suckerfish dropdowns over the other techniques.</p>
<p><strong>It&#8217;s Versatile</strong><br />
I&#8217;ve been using it as a vertical menu for the most part but it works the same way with some tweaks as a <a href="http://htmldog.com/articles/suckerfish/dropdowns/example/vertical.html">horizontal menu</a> as well.<br />
<strong><br />
Also, why does it have to be a menu?</strong> Use the basic concept to hide and then open up a content box using the :hover class to trigger it. For instance, a Trivia Question box and they roll over a button to display the answer. The possibilities are endless!</p>
<p><strong>Six More Years of Suckerfish?</strong><br />
With the new features in CSS3 and HTML 5, I can&#8217;t wait to see what type of new progressive enhancement we&#8217;ll be seeing in years to come. Rounded corners, transparency, border-types, embedded media&#8230; all being used in imaginative ways with the basic Suckerfish techniques is a wonderful thing.</p>
<p>In the future when IE6 is nothing but a bad nightmare buried deep in our past, we won&#8217;t need the javascript portion of the technique making it even more easy to develop for. I prefer to use Suckerfish based menu techniques in general because of the reasons outlined above and I hope you consider in making your choice next time you do the dropdown dance!</p>
<h5>Did I Miss Anything? Correct me or add to the conversation in the comments!</h5>
]]></content:encoded>
			<wfw:commentRss>http://www.typesett.com/2009/10/six-years-of-suckerfish-dropdown-menus/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CSS Selectors &#8211; A Guide To The Common &amp; The Rare</title>
		<link>http://www.typesett.com/2009/09/css-selectors-a-guide-to-the-common-the-rare/</link>
		<comments>http://www.typesett.com/2009/09/css-selectors-a-guide-to-the-common-the-rare/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 06:51:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Dev]]></category>

		<guid isPermaLink="false">http://www.typesett.com/?p=1049</guid>
		<description><![CDATA[Most of you will be surprised by some of the CSS selectors that I'm writing about today. For instance, did you know can select a element based on a ending substring such as ".pdf"? BAM, add that selector to your a element and you can make all PDFs on your website italic and purple without any addition HTML! You xan do that with other substrings too! ]]></description>
			<content:encoded><![CDATA[<p>Most of you will be surprised by some of the CSS selectors that I&#8217;m writing about today. For instance, did you know can select a element based on a ending substring such as &#8220;.pdf&#8221;? BAM, add that selector to your a element and you can make all PDFs on your website italic and purple without any addition HTML! You xan do that with other substrings too! </p>
<p><img src="http://www.typesett.com/wp-content/uploads/2009/09/css-selectors-main.jpg" alt="Article Teaser Image" /></p>
<p>We&#8217;re also going to go over some of the differences between more common selectors just so you know you&#8217;re efficiently implementing your code.</p>
<p><span id="more-1049"></span></p>
<h5>COMMONLY USED SELECTORS (like squirrels)</h5>
<h6>UNIVERSAL SELECTOR:</h6>
<p><code>* {color:blue;}</code><br />
<strong>This is applied to all elements unless it has a explicit selector already applied.</strong> The most common usage is probably those who are using it to reset values or apply universal values (duh!). For a quick fix — it might come in handy if you were doing a website demo and wanted to adjust all the font-sizes in your website by adding a <em><strong>font-size: 125% </strong></em>temporarily for the people in the back to see better.</p>
<h6>TYPE SELECTOR:</h6>
<p><code>body {background-color:blue;}</code><br />
<strong>This is applied to to all matching elements.</strong> Whether it be a default or a custom Class or ID selector (see next), the match is found and the style is applied.</p>
<h6>CUSTOM CLASS  &#038; ID SELECTORS:</h6>
<p><code>.emergency {color:blue;}<br />
#wrapper {background-color: blue;}<br />
</code><br />
<strong>These are custom selectors that are formed by either using the dot notation or the hash mark preceding the name.</strong> The usage of these are basically Class for multiple instances and ID for single instances.  You can target elements by directly adding them preceding the dot or hash marks.</p>
<p><code>p.sidebar {color:blue;}<br />
p#content {color:blue;}<br />
</code></p>
<h6>DESCENDANT SELECTOR:</h6>
<p><code>body p {color:blue;}</code><br />
<strong>This is applied to to all descended elements of another selector.</strong> So that means all children, grandchildren, great-grandchildren will have the style applied to them.</p>
<h6>CHILD SELECTOR:</h6>
<p><code>ul > li {color:blue;}</code><br />
<strong>This is applied to only the children of the parent selector.</strong> This means you can target a specific depth of the element rather than have styles applied to the entire ancestry.</p>
<h5>LESS COMMONLY USED SELECTORS (like red pandas)</h5>
<h6>ADJACENT SIBLING  SELECTOR:</h6>
<p><code>h2 + p {color:blue;}</code><br />
<strong>This is applied to the adjacent sibling of another element.</strong> In other words, you might want to target an element that you know immediately follows another. For instance, in the middle of your web page content you have a text call-out with a <em><strong>h2</strong></em> header. You can have all the instances of a <em><strong>p</strong></em> be styled differently to indicate that it&#8217;s a call-out with a background value. Also, this only applies to elements — so text in between the elements will be ignored. (This only works according to HTML document tree). <a href="http://meyerweb.com/eric/articles/webrev/200007a.html">See Eric Meyer&#8217;s Website for more on this&#8230;</a></p>
<h6>SIMPLE ATTRIBUTE  SELECTOR:</h6>
<p><code>a[class] {color:blue}</code><br />
<strong>This is applied to any element with a matching attribute.</strong> For instance, you want to apply a style on every link on the page with a class associated with it, even though they belong to different classes.</p>
<h5>RARELY SEEN SELECTORS (like unicorns)</h5>
<h6>EXACT ATTRIBUTE  SELECTOR:</h6>
<p><code>a[rel="next"] {color:blue}</code><br />
<strong>This is applied to only elements with the exact matching attribute.</strong> This could be useful if you&#8217;re trying to style specific attributes or even if you&#8217;re trying to style a group of obscure attributes like a set of <em><strong>rel</strong></em> and <em><strong>rev</strong></em> links. (They&#8217;re obscure to me because I don&#8217;t often use them! ha!)</p>
<h6>PARTIAL ATTRIBUTE  SELECTOR:</h6>
<p><code>a[rel~="party"] {color:blue}</code><br />
<strong>This can be applied to elements with space separated values. </strong> For instance it would work for <em><strong>class=&#8221;party&#8221;</strong></em> and <em><strong>class=&#8221;party august&#8221;</strong></em> but not <em><strong>class=&#8221;party-time&#8221;</strong></em>. So you can see it would be useful if you used these selectors to group a set of targets together by naming them a certain way.</p>
<h6>BEGINNING SUBSTRING SELECTOR:</h6>
<p><code>a[href^="/party"] {color:blue}</code><br />
<strong>You can apply this selector to grab a element based on the beginning substring.</strong> This is useful if you want to style a set of elements that are grouped in a certain way like the beginning of a url for instance.</p>
<h6>ENDING SUBSTRING SELECTOR:</h6>
<p><code>a[href$="/document.pdf"] {color:blue}</code><br />
<strong>You can apply this selector to grab a element based on the ending substring.</strong> This is a showstopper for sure! I think it&#8217;s good usability to alert users what type of file they are clicking on and this is a great way to consistently label files for your users visually (you still might want to include the file name or file type in the text but this helps them scan).</p>
<h6>ARBITRARY SUBSTRING SELECTOR:</h6>
<p><code>a[href*="typesett.com"] {color:blue}</code><br />
<strong>You can apply this selector to grab a element based on any substring in the attribute.</strong> If you can find a pattern with an occurring substring on your page, you can exploit it to target only those same substrings.</p>
<h6>LANGUAGE SUBSTRING SELECTOR:</h6>
<p><code>body[lang|="en"] {color:blue}</code><br />
<strong>This is used for selecting elements with a lang attribute.</strong> This is useful for differentiating content in different languages. </p>
<p>I&#8217;ve actually known this to be the <em>&#8220;match or starts with&#8221;</em> selector. Some people use it like this:<br />
<code>img[src|="party"] {border-color:blue}</code><br />
and what it would do is find <em><strong>party.jpg</strong></em> or <em><strong>party56.jpg</strong></em> but not <em><strong>august/party.jpg</strong></em>.</p>
<p><a href="http://www.flickr.com/photos/minor_incident/"><em>Props to Jake Vance for the image!</em></a></p>
<h5>Comment If You Have Anything To Add Or Correct!</h5>
<h5>Other Articles You Might Like:</h5>
<p><a href="http://www.typesett.com/2009/07/css-rehab-3-step-program-to-getting-clean/">CSS Rehab – 3 Step Program To Getting Clean</a><br />
<a href="http://www.typesett.com/2009/08/5-innovative-css-techniques-you-should-know-about/">5 Innovative CSS Techniques You Should Know About</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.typesett.com/2009/09/css-selectors-a-guide-to-the-common-the-rare/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>5 Innovative CSS Techniques You Should Know About</title>
		<link>http://www.typesett.com/2009/08/5-innovative-css-techniques-you-should-know-about/</link>
		<comments>http://www.typesett.com/2009/08/5-innovative-css-techniques-you-should-know-about/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 02:49:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[Top Lists]]></category>
		<category><![CDATA[Web Dev]]></category>

		<guid isPermaLink="false">http://www.typesett.com/?p=1037</guid>
		<description><![CDATA[We all love CSS but keeping up with the latest techniques can be quite difficult at times. So for your convenience, I&#8217;ve compiled five tutorials that showcase useful and innovative techniques that you should know about.


[Just to be clear, I know some form of probably all these techniques may have existed for awhile but I [...]]]></description>
			<content:encoded><![CDATA[<p><strong>We all love CSS but keeping up with the latest techniques can be quite difficult at times.</strong> So for your convenience, I&#8217;ve compiled five tutorials that showcase useful and innovative techniques that you should know about.</p>
<p><img src="http://www.typesett.com/wp-content/uploads/2009/08/innovative-css-main.jpg" /><br />
<em><br />
[Just to be clear, I know some form of probably all these techniques may have existed for awhile but I feel these five choices can still be used/improved upon by us developers and/or not fully adapted yet even though they are known by many to be productive. A bump and a nod, if you will.]</em><br />
<span id="more-1037"></span></p>
<h5>1. Perfect Full Page Background Image</h5>
<p><strong>by Chris Coyer of CSS Tricks</strong></p>
<p><strong>For a project I worked on in the past, I tried to implement a full page background image via CSS and it is much more difficult than you&#8217;d expect.</strong> First of all you&#8217;re dealing with the scaling issue (because we don&#8217;t want white space) and then you have the proportions to worry about and then on top of all that you have to deal with the scroll bars and browser compatibility issues. </p>
<p>Thankfully, Chris Coyer takes you through two techniques (albeit only one technique truly fulfills all the requirements above).</p>
<p><a href="http://css-tricks.com/perfect-full-page-background-image/">http://css-tricks.com/perfect-full-page-background-image/</a></p>
<p><img src="http://www.typesett.com/wp-content/uploads/2009/08/innovative-css-1.jpg" /></p>
<h5>2. CSS Sprites: Image Slicing’s Kiss of Death</h5>
<p><strong>by Dave Shea of A List Apart</strong></p>
<p><strong>If your &#8220;images&#8221; folder is about to burst because of the sheer quantity and complexity of its contents, we have a winner for you!</strong> CSS sprites are basically a grid of images in a single image file that you position and re-position as necessary. You do this to help your production efficiency as you only need to maintain a single file. This technique is an absolute godsend for navigation links states effects.</p>
<p>ALA all-star, Dave Shea outlined these techniques as far back as 2004 and re-visited the subject in 2008.</p>
<p><a href="http://www.alistapart.com/articles/sprites/">http://www.alistapart.com/articles/sprites/</a><br />
<a href="http://www.alistapart.com/articles/sprites2/">http://www.alistapart.com/articles/sprites2/</a></p>
<p><img src="http://www.typesett.com/wp-content/uploads/2009/08/innovative-css-2.jpg" /></p>
<h5>3. How To Recreate Silverback’s Parallax Effect</h5>
<p><strong>By Paul Annett of Think Vitamin</strong></p>
<p><strong>I first saw Jeremy Keith show off the Silverback website at An Event Apart in San francisco last year (2008) and was blown away.</strong> Not so much because of how exciting it looked but more because of its elegant coolness factor. The parallax effect can basically be described as multiple background images set at individual visual levels to acheive a nice movement effect when the user changes the browser window size.</p>
<p>British developper, Paul Annett is responsible for the original implementation of this technique for Clearleft (who makes Silverback) and gives us a rundown of how he implemented it for them.</p>
<p><a href="http://carsonified.com/blog/design/how-to-recreate-silverbacks-parallax-effect/">http://carsonified.com/blog/design/how-to-recreate-silverbacks-parallax-effect/</a></p>
<p><img src="http://www.typesett.com/wp-content/uploads/2009/08/innovative-css-3.jpg" /></p>
<p>Other ways to accomplish this technique:<br />
<a href="http://forthelose.org/examples-of-and-how-to-do-the-css-parallax-effect">http://forthelose.org/examples-of-and-how-to-do-the-css-parallax-effect</a><br />
<a href="http://webdev.stephband.info/parallax.html">http://webdev.stephband.info/parallax.html</a></p>
<h5>4. CSS: Add a “Loading” Icon To Your Larger Images</h5>
<p><strong>by DynamiX Labs</strong><br />
<strong><br />
The tricky thing about dealing with large images (or multitudes of images that hog bandwidth) is that during loading it can really mess with your layout and confuse your viewers until the image loads.</strong> In other words &#8211; a bad first impression with your audience. To remedy this, use a preload image so that they know something is coming and they won&#8217;t be alarmed that the page is broken.</p>
<p>DynamiX Labs has a nice solution that is multi-browser compatible and requires no javascript.</p>
<p><a href="http://www.dynamixlabs.com/2008/01/17/a-quick-look-add-a-loading-icon-to-your-larger-images/">http://www.dynamixlabs.com/2008/01/17/a-quick-look-add-a-loading-icon-to-your-larger-images/</a></p>
<p><img src="http://www.typesett.com/wp-content/uploads/2009/08/innovative-css-4.jpg" /></p>
<h5>5. Create a Lightbox Effect Only With CSS – <em>no javascript needed (except to close the windows)</em></h5>
<p><strong>by Emanuele Feronato</strong><br />
<strong><br />
I am an advocate of Lightbox, Greybox and the other jQuery options to achieve the pop-up effects for opening new windows within a webpage.</strong> As they mature, the options for them become more and more impressive. However, sometimes all you need is a simple lightweight option that gets the job done for you without a whole lot of fuss. That&#8217;s the beauty of this mostly CSS solution (rudimentary javascript is used to close the window).</p>
<p>For a landing page project that I worked on that had a shelf-life of about a month, I decided to use this technique for a registration form and it worked out great. it was easy and fast to implement and had I appreciated the tiny footprint.</p>
<p><a href="http://www.emanueleferonato.com/2007/08/22/create-a-lightbox-effect-only-with-css-no-javascript-needed/">http://www.emanueleferonato.com/2007/08/22/create-a-lightbox-effect-only-with-css-no-javascript-needed/</a></p>
<p><img src="http://www.typesett.com/wp-content/uploads/2009/08/innovative-css-5.jpg" /></p>
<h5>You may also find these articles useful:</h5>
<p><a href="http://www.typesett.com/2009/06/3-fresh-web-design-ideas/">3 Fresh Web Design Ideas </a><br />
<a href="http://www.typesett.com/2009/07/css-rehab-3-step-program-to-getting-clean/">CSS Rehab &#8211; 3 Step Program To Getting Clean</a><br />
<a href="http://www.typesett.com/2009/06/why-i-love-expression-engine-cms/">Why I Love Expression Engine (CMS) </a></p>
<h5>Did I Miss Something?! Let me know in comments!</h5>
]]></content:encoded>
			<wfw:commentRss>http://www.typesett.com/2009/08/5-innovative-css-techniques-you-should-know-about/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>CSS Rehab &#8211; 3 Step Program To Getting Clean</title>
		<link>http://www.typesett.com/2009/07/css-rehab-3-step-program-to-getting-clean/</link>
		<comments>http://www.typesett.com/2009/07/css-rehab-3-step-program-to-getting-clean/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 05:21:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Dev]]></category>

		<guid isPermaLink="false">http://www.typesett.com/?p=941</guid>
		<description><![CDATA[<strong>I've been making websites commercially for about five years now.</strong> In 2004, a year or two out of college — it was definitely a learning process for me. I originally graduated with a  degree centered on print design, so programming in general was very new to me. During that time, table-based layout structure was still prevalent, so that's how I started out. ]]></description>
			<content:encoded><![CDATA[<p><strong>I&#8217;ve been making websites commercially for about five years now.</strong> In 2004, a year or two out of college — it was definitely a learning process for me. I originally graduated with a  degree centered on print design, so programming in general was very new to me. During that time, table-based layout structure was still prevalent, so that&#8217;s how I started out.</p>
<p><img src="http://www.typesett.com/wp-content/uploads/2009/06/css-cap.jpg" alt="CSS Illustration" /><br />
<span id="more-941"></span><br />
<strong>I eventually added CSS to slowly wick away the pain of tables by using simple global CSS selector</strong>s (i.e. body, link, img and etc.). At that time, I would say that&#8217;s what most people did. It was still very difficult for pure CSS based layouts because the browser situation was still awkward.* Internet Explorer was at it&#8217;s prime and Firefox was not as popular and easy an alternative as it is now.<br />
<em><br />
[*This is from my experience, as I remember specifically working on a client project in 2003-2004 how hard it was to follow tutorials as every one had so many browser caveats. I'm sure my inexperience contributed to the difficult as well.]</em></p>
<p>Needless to say, my HTML/CSS was a mess even after I started using CSS the way it is supposed to around 2006-2007. This is the time frame I&#8217;d say Firefox really started getting traction and soon after IE7 came out in 2007 making everybody&#8217;s life so much easier. The main problem was that even though I used CSS, the actual implementation was kind of jagged. As a designer/developer — it&#8217;s important to be clean, simple and elegant <em>(as Jamie from Myth Busters likes to phrase technically challenging concepts implemented efficiently)</em> as it helps to debug, transfer, share, update, teach and perform best practice techniques.</p>
<p><strong>Even now, I can do better but here are 3 techniques I practice religiously that have really benefited me after adapting them into my routine. </strong></p>
<h5>STEP 1: RESET &#8211; Let&#8217;s Code on a Level Programming Field</h5>
<p><strong>Since Eric Meyer made resetting browsers popular </strong>with his influence/community in 07&#8242;— it started to build in popularity quite rapidly. As soon as I started using it, I immediately thought to myself how great it was as many problems started fading away very quickly. Sure, we all used mini resets like setting margins and padding to &#8220;0&#8243; in the html or body selectors but completely eviscerating all browser defaults is a wonder you have to experience yourself.</p>
<p><strong><em>If you take nothing away from this article — make sure you start using CSS resets</em></strong>. It&#8217;s been one of the biggest difference makers in reducing day-to-day CSS headaches (especially between browsers). Eric Meyer is generally accepted as a CSS authority and his style sheet is generally accepted as the best:</p>
<p>From: <a href="http://meyerweb.com/eric/tools/css/reset/index.html">http://meyerweb.com/eric/tools/css/reset/index.html</a></p>
<p>[Link updated: 7.8.09]</p>
<p><code><br />
html, body, div, span, applet, object, iframe,<br />
h1, h2, h3, h4, h5, h6, p, blockquote, pre,<br />
a, abbr, acronym, address, big, cite, code,<br />
del, dfn, em, font, img, ins, kbd, q, s, samp,<br />
small, strike, strong, sub, sup, tt, var,<br />
b, u, i, center,<br />
dl, dt, dd, ol, ul, li,<br />
fieldset, form, label, legend,<br />
table, caption, tbody, tfoot, thead, tr, th, td {<br />
	margin: 0;<br />
	padding: 0;<br />
	border: 0;<br />
	outline: 0;<br />
	font-size: 100%;<br />
	vertical-align: baseline;<br />
	background: transparent;<br />
}<br />
body {<br />
	line-height: 1;<br />
}<br />
ol, ul {<br />
	list-style: none;<br />
}<br />
blockquote, q {<br />
	quotes: none;<br />
}<br />
blockquote:before, blockquote:after,<br />
q:before, q:after {<br />
	content: '';<br />
	content: none;<br />
}<br />
:focus {<br />
	outline: 0;<br />
}<br />
ins {<br />
	text-decoration: none;<br />
}<br />
del {<br />
	text-decoration: line-through;<br />
}<br />
table {<br />
	border-collapse: collapse;<br />
	border-spacing: 0;<br />
}<br />
</code></p>
<p>The way I use this is by linking to it as a separate external style sheet as the first cascade.</p>
<h5>STEP 2: FRAMEWORK &#8211; No Need to Re-Invent The Wheel</h5>
<p>I initially did not flock to CSS Frameworks but have personally experienced the benefits from using them these last few years. CSS is pretty simple once you gain experience using it, so going through the trouble of using a &#8220;bloated&#8221; framework seems like BS to some developers. This is especially true for those Jedi web developers who have made dozens and dozens of websites through the years and have developed their own way of doing things.</p>
<p>There are plenty to choose from, the two I am most familiar with is <a href="http://www.blueprintcss.org/">Blueprint</a> and a pseudo framework called <a href="http://960.gs/">960 Grid System (GS)</a> that predominantly focuses on standardizing grid layouts. Once I started using 960 GS, I never stopped. The main reason behind that is because it takes away arbitrary decisions that change from website to website.</p>
<p><img src="http://www.typesett.com/wp-content/uploads/2009/06/css-frameworks.jpg" alt="CSS Frameworks: 960GS and Blueprint" /></p>
<p>For example — what size should the sidebar be from website to website? In the past, it could range from 251px to 327px. Yes, circumstances may require you to make the sidebar exactly 243px wide but if you design it with the grid in mind in the first place — you can avoid these awkward numbers. That can become difficult to manage as you work on several new websites during the course of a day and even more if you do work updating old ones. 960 GS logically gives you several options to design from and as you implement the framework — it&#8217;s consistent and makes sense no matter what website you work on.</p>
<p><strong>The way that all the frameworks work is that they supply you with basically a template </strong>— but a bare template that&#8217;s flexible and versatile enough that web professionals will not reject it for lack of adaptability and can use it for any conceivable future project. Blueprint unlike 960 GS goes much further and offers all the selectors but IMO, it starts to get bloated. However, that&#8217;s the beauty of CSS frameworks — you can choose the one that makes sense to you. There probably is a Goldilocks framework out there waiting for you.</p>
<p><strong>Here&#8217;s a list of some of the most popular for you to explore:</strong><br />
<a href="http://960.gs/">http://960.gs/</a><br />
<a href="http://www.blueprintcss.org/">http://www.blueprintcss.org/</a><br />
<a href="http://www.yaml.de/en/">http://www.yaml.de/en/</a></p>
<p><strong>w3avenue and SpeckyBoy have explored more of the frameworks more in-depth:</strong><br />
<a href="http://www.w3avenue.com/2009/04/29/definitive-list-of-css-frameworks-pick-your-style/">http://www.w3avenue.com/2009/04/29/definitive-list-of-css-frameworks-pick-your-style/</a><br />
<a href="http://speckyboy.com/2008/03/28/top-12-css-frameworks-and-how-to-understand-them/">http://speckyboy.com/2008/03/28/top-12-css-frameworks-and-how-to-understand-them/</a></p>
<p><strong>Jeff Croft waxes poetic about this subject over at A List Apart</strong><br />
<a href="http://www.alistapart.com/articles/frameworksfordesigners">http://www.alistapart.com/articles/frameworksfordesigners</a></p>
<p><em>I actually saw Eric Meyer speak about CSS frameworks at An Event Apart SF 08 and the conclusion he left us with is that each one has good and bad points but most stress standards compliant code and organization&#8230; so using them certainly can&#8217;t hurt.</em></p>
<h5>STEP 3: ORGANIZING &#8211; It Works For Your Socks, Why Not Your Code?</h5>
<p>[NOTE: Step 3 is hard. It's a bit nit-picky but hey — we're all trying to get better right?! I know I need to follow my own advice better at times!]</p>
<p><strong>You&#8217;ve heard this before and like me</strong> — you&#8217;re too busy writing the code to fuss with it too much. That&#8217;s the reality but there are clear benefits as well. <strong>CSS = Cascading Style Sheets. </strong>Organization is inherently built into the functionality of the language! We should be striving to be clean and easy, and here&#8217;s a few quick tips that any of us can start doing right away without much fuss:</p>
<p><strong>Selector Grouping</strong></p>
<p><code>h1 { font-family: sans-serif }<br />
h2 { font-family: sans-serif }<br />
h3 { font-family: sans-serif }</code></p>
<p>is the same as:</p>
<p><code>h1, h2, h3 { font-family: sans-serif }</code></p>
<p>and a real world example of the space you&#8217;d be saving is:</p>
<p><code>h1, h2, h3 { font-family: sans-serif }<br />
h1 {2.5 em}<br />
h2 {2 em; color#000000;}<br />
h3 {2 em; color#333333;}</code></p>
<p>Reducing some of the redundancy will really help make your CSS be more efficient and save you time as well!</p>
<p><strong>Default Selectors First</strong></p>
<p>Define the values of these at the top of the document and keep them there. I&#8217;ve seen some style sheets where they group similar selectors together with the assigned selectors such as putting form selectors with the rest of the structure and styling of the form. It makes some sense but it&#8217;s bad practice because it&#8217;s hard to locate later on and especially frowned upon if you work with a team.</p>
<p><code>html, body, div, span, applet, object, iframe,<br />
h1, h2, h3, h4, h5, h6, p, blockquote, pre,<br />
a, abbr, acronym, address, big, cite, code,<br />
del, dfn, em, font, img, ins, kbd, q, s, samp,<br />
small, strike, strong, sub, sup, tt, var,<br />
dl, dt, dd, ol, ul, li,<br />
fieldset, form, label, legend,<br />
table, caption, tbody, tfoot, thead, tr, th, td</code></p>
<p>This actually happened to me&#8230; a co-worker a few years back told me I should stop sprinkling my selectors everywhere. He had to use the Find tool all the time to figure out what the hell I was doing. Don&#8217;t annoy your co-workers like me!</p>
<p><strong>Alphabetizing Selector Values</strong></p>
<p><strong>Yep.</strong> It&#8217;s as simple as that and yet it&#8217;s so hard to do.</p>
<p><code>h1 {<br />
background-color: #000000;<br />
color: #ffffff;<br />
font-family: sans-serif;<br />
padding: 20px;<br />
}</code></p>
<p>I read about some developers doing it but I always opted for grouping similar/popular values together. Such as width and height, padding and margin and etc. The reason why I&#8217;ve come over to this way of thinking is because I realized when I deliver code to a client&#8217;s IT team — it makes sense to them that it&#8217;s alphabetical since they don&#8217;t work with me and don&#8217;t know my quirks. In other words, my arbitrary grouping of selectors means nothing to other people. Alphabetical makes sense since it&#8217;s a simple and functional way to organize.</p>
<h5>In Conclusion&#8230;</h5>
<p>The reasons why you should strive for clean CSS is to code faster, be efficient and to not annoy your co-workers and clients.</p>
<ul>
<li>1. RESET!</li>
<li>2. Use a Framework!</li>
<li>3. Organize within your code!</li>
</ul>
<p><em>Thanks <a href="http://www.flickr.com/photos/darwinbell/">Darwin</a> for the photo!</em></p>
<h5>Helpful? Comment!</h5>
]]></content:encoded>
			<wfw:commentRss>http://www.typesett.com/2009/07/css-rehab-3-step-program-to-getting-clean/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Farewell IE6 &#8211; It&#8217;s Been Craptastic</title>
		<link>http://www.typesett.com/2009/03/farewell-ie6-its-been-craptastic/</link>
		<comments>http://www.typesett.com/2009/03/farewell-ie6-its-been-craptastic/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 06:07:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Dev]]></category>

		<guid isPermaLink="false">http://www.typesett.com/?p=310</guid>
		<description><![CDATA[With the debut of Internet Explorer 8 and the overall leading market share of IE7 — we will begin to see IE6 erode into history at a much quicker pace. Yes, let&#8217;s all praise the Lord for second. Done? Ok — IE6 came out roughly around September 2001, and has been driving web developers nuts [...]]]></description>
			<content:encoded><![CDATA[<p><strong>With the debut of Internet Explorer 8 and the overall leading market share of IE7 — we will begin to see IE6 erode into history at a <em>much quicker pace.</em></strong> Yes, let&#8217;s all praise the Lord for second. <strong>Done? Ok</strong> — IE6 came out roughly around September 2001, and has been driving web developers <strong>nuts</strong> ever since. Just last week,<em> I cursed it&#8217;s foul name as I had to debug a problem that only surfaced in it&#8217;s vile window.</em> <strong>Before we officially warn you about the door hitting your ass on the way out, let&#8217;s reminisce about some of the bad times we had:</strong></p>
<h5>Security — Sad.</h5>
<p><a href="http://en.wikipedia.org/wiki/Browser_timeline"><img src="http://www.typesett.com/wp-content/uploads/2009/03/ie6-timeline.gif" alt="IE6 Timeline" /></a><br />
<strong>Internet Explorer 6&#8217;s golden age, around 2002 and 2003 where it captured about 95%</strong> of the browser market unfortunately led to it being the main target of hackers, spy ware, phishing rings and nefarious scammers across the globe. Active X and Active scripting really just opened the door for these vile bastards and I think Microsoft products can be directly credited for phrases like &#8220;identity theft&#8221;.<br />
<span id="more-310"></span></p>
<h5>Standards — Pathetic.</h5>
<p><a href="http://www.google.com/search?hl=en&#038;client=firefox-a&#038;rls=org.mozilla%3Aen-US%3Aofficial&#038;q=ie6+hacks&#038;btnG=Search"><img src="http://www.typesett.com/wp-content/uploads/2009/03/ie6-google.gif" alt="IE6 Google Screen Shot" /></a><br />
<strong>The very people slaving away each day making web pages for your browser are the same ones that curse your name!</strong> From the noted lack of support for CSS, PNG files and sufficient debugging tools — is this any way for the leader of the market to act? We had to wait for late 2006 until IE7 to come out and even that wasn&#8217;t enough! We&#8217;ve been suffering since 2001 for God sakes (<em>and still am *cough*cough*</em>)!</p>
<h5>Crashing — Unforgivable.</h5>
<p><a href="http://www.pcworld.com/article/125772-3/the_25_worst_tech_products_of_all_time.html"><img src="http://www.typesett.com/wp-content/uploads/2009/03/ie6-25worst.gif" alt="PCWorld Screen Shot" /></a><br />
<strong>If you can&#8217;t stand the heat stay out of the kitchen! <em>Unfortunately, IE6 runs out of the kitchen hides under the bed.</em></strong> Because of all the security fixes that came out one after another, the browser was often left kind of unstable. The reasons it crashed ranged from new security fixes, innovative CSS, Flash and Shockwave rendering and just not being able to handle multiple windows. Considering IE7 in 2006 was the first to get tabbed browsing, we&#8217;d have liked our primary content delivery system to the masses be more stable for the users we develop for.</p>
<h5>Don&#8217;t let the door hit your ass on the way out — farewell, IE6.</h5>
<h5>Finish this sentence for me in the <em>Comments</em>: IE6 makes me want to _________!*</h5>
<p><strong>Expletives allowed. Go to town! </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.typesett.com/2009/03/farewell-ie6-its-been-craptastic/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
