<?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>E Marketing, Web Design, Web Develop, SEO and SEM Egypt Blog &#187; web design</title>
	<atom:link href="http://code95.com/blog/archives/category/web-design/feed" rel="self" type="application/rss+xml" />
	<link>http://code95.com/blog</link>
	<description>e marketing, seo, sem, egypt , web , design , develop, shopping cart, e- commerce, outsourcing , company , financial , artwork , css , logo , forex , travel , flash , arabia , egyptian , graphic , commerce , created , designs , toolbar , company identity , itida , javascript , marketing , technology , portal , banners , businesses , careers , creative , designers</description>
	<lastBuildDate>Fri, 09 Apr 2010 04:18:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>More than one way… (delegate edition)</title>
		<link>http://code95.com/blog/archives/29762</link>
		<comments>http://code95.com/blog/archives/29762#comments</comments>
		<pubDate>Wed, 07 Apr 2010 17:42:58 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29762</guid>
		<description><![CDATA[There was a question in the forums about affecting non-hovered items. The effect they were after is that they had an unordered list of items and when they were rolled over, they would all dim (lower opacity) except the one hovered.
This can be done with CSS, using pseduo-selectors.
ul li:not(:hover) { opacity: 0.5; }
However we know [...]]]></description>
			<content:encoded><![CDATA[<p>There was a question in the forums about <a href="http://css-tricks.com/forums/viewtopic.php?f=5&amp;t=7141&amp;start=0">affecting non-hovered items</a>. The effect they were after is that they had an unordered list of items and when they were rolled over, they would all dim (lower opacity) <em>except</em> the one hovered.</p>
<p>This can be done with CSS, using pseduo-selectors.</p>
<pre><code>ul li:not(:hover) { opacity: 0.5; }</code></pre>
<p>However we know that <a href="http://css-tricks.com/pseudo-class-selectors/">pseudo-selectors</a> don&#8217;t have very good cross-browser support. And for that matter, <a href="http://css-tricks.com/css-transparency-settings-for-all-broswers/">opacity</a> doesn&#8217;t either. jQuery is pretty good at mitigating cross-browser problems, so l thought I might give that a spin. In attempting it, I had a nice little learning journey.</p>
<p><span></span></p>
<p>My first thought is that I needed to write a selector to select all list items except the one currently being hovered over. I had this come up recently for another reason, and I made a snippet for it: <a href="http://css-tricks.com/snippets/jquery/exclude-this-from-selector/">Excluding this from the selector</a>. In this example:</p>
<pre><code>$("ul li").not(this).css("opacity", "0.5");</code></pre>
<p>We just need to wrap that in some kind of hover function. The most obvious:</p>
<pre><code>$("li").hover(function() {
  $("li").not(this).css("opacity", 0.5);
}, function() {
  $("li").not(this).css("opacity", 1);
});</code></pre>
<p>But I&#8217;ve been being taught that binding events like this is inefficient, since 1) it requires one event handler for every single element and 2) new elements appended to the page after this code runs will need to be re-bound. (Not to mention, you would definitely want to cache that selector above <tt>var $listItems = $("li");</tt>).</p>
<p>So I thought I&#8217;d go right for the new delegate function which we have mentioned here on CSS-Tricks a few times now. This is awesome because it solves both the issues mentioned above. This was my first <strong>(utterly broken)</strong> attempt.</p>
<pre><code>$("ul").delegate("li", "hover", function() {
    $("ul li").not(this).css("opacity", "0.5");
}, function() {
    $("ul li").not(this).css("opacity", "1");
});</code></pre>
<p>Don&#8217;t try that at home, it&#8217;s not going to work. Why not? <a href="http://twitter.com/padolsey/status/11761527435">James Padolsey reminded me</a> that &#8220;hover&#8221; isn&#8217;t an event. It&#8217;s a jQuery function, but not a real event, and will not work with delegate. Besides, even if it did, delegate is expecting just the three parameters: element, event, and function, not four parameters like I was passing it (assuming it would know the last function was supposed to be a callback/mouseleave).</p>
<p>Then the next most obvious transformation becomes this:</p>
<pre><code>$("ul").delegate("li", "mouseenter", function() {
    $("ul li").not(this).css("opacity", "0.5");
}).delegate("li", "mouseleave", function() {
    $("ul li").not(this).css("opacity", "1");
});</code></pre>
<p>That uses two delegate functions, this time with real events, to get the job done. This is fine, but we can make it a bit more efficient by mapping both events to a single delegate and then just testing to see what type of event was fired. <a href="http://twitter.com/davidlink/status/11761767896">David Link</a> had this idea:</p>
<pre><code>$("ul").delegate("li", "mouseover mouseout", function(e) {
    if (e.type == 'mouseover') {
      $("ul li").not(this).css("opacity", "0.5");
    } else {
      $("ul li").not(this).css("opacity", "1");
    }
});</code></pre>
<p>Which <a href="http://twitter.com/padolsey/status/11762175991">James Padolsey</a> had an even cleaner version:</p>
<pre><code>$("ul").delegate("li", "mouseover mouseout", function(e) {
    $("ul li").not(this).css("opacity", e.type == 'mouseover' ? 0.5 : 1);
});</code></pre>
<p>jQuery&#8217;s live() function is also a good choice here, but has some quirks as well. It turns out you <em>can</em> pass &#8220;hover&#8221; to live, but you can still only provide a single function. The function will then fire on both mouseenter and mouseleave events, and you&#8217;ll have to do event.type testing (like above) to figure out which it was and behave accordingly. Thanks to <a href="http://twitter.com/paul_irish/status/11761933514">Paul Irish</a> and <a href="http://twitter.com/nettuts/status/11761898088">Jeffrey Way</a> for that one.</p>
<p>And remember that CSS selector from the very top? We can use that right in jQuery too:</p>
<pre><code>$("ul li:not(:hover)").css("opacity", "0.5");</code></pre>
<p>Quite the journey eh? Like all things web, always more than one way to <a href="http://www.worldwidewords.org/qa/qa-mor1.htm">skin the cat</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29762/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Conference + Win a Ticket!</title>
		<link>http://code95.com/blog/archives/29761</link>
		<comments>http://code95.com/blog/archives/29761#comments</comments>
		<pubDate>Wed, 07 Apr 2010 17:42:48 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29761</guid>
		<description><![CDATA[
I&#8217;ll be speaking at the upcoming jQuery Conference. It is in the San Francisco Bay Area (Mountain View, at the Microsoft Campus) on April 24 – 25, 2010. Just check out that link for all the details. It looks pretty great.

&#8220;Solving Common Client Requests with jQuery&#8221;
That is my chosen topic. Since I think I&#8217;ll be [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/jquerycon.jpg" width="570" height="242" alt="" /></p>
<p>I&#8217;ll be speaking at the upcoming <a href="http://events.jquery.org/2010/sf-bay-area/">jQuery Conference</a>. It is in the San Francisco Bay Area (Mountain View, at the Microsoft Campus) on April 24 – 25, 2010. Just check out that link for all the details. It looks pretty great.</p>
<p><span></span></p>
<h3>&#8220;Solving Common Client Requests with jQuery&#8221;</h3>
<p>That is my chosen topic. Since I think I&#8217;ll be speaking to a room of folks 75% of which are going to be smarter than me, I thought I would take more of a real-world approach rather than straight instructional. We&#8217;ll be taking a look at some actual sites I&#8217;ve worked on and how I leaned on jQuery to help me accomplish something that would have been difficult or impossible otherwise.</p>
<h3>Win a free ticket!</h3>
<p>I have one free ticket to give away to a CSS-Tricks reader. I always struggle with this because I don&#8217;t like &#8220;leave a comment to win&#8221; contests and I also dislike Facebook/Twitter related contests. So we are going to try something new here.</p>
<p>To enter to win the free ticket: <strong>you must donate $10 to ANY open source project.</strong> Then forward your receipt to me at chriscoyier@gmail.com and you&#8217;ll be entered to win.</p>
<p>If you win, you get a $199 ticket for $10. If you lose, you get the intense satisfaction that you helped an deserving open source project. <em>If you aren&#8217;t comfortable with that, don&#8217;t enter.</em> Transportation and lodging is up to you.</p>
<p>Also remember it&#8217;s ANY open source project. Could be <a href="http://jquery.org/donate">jQuery</a> (or <a href="http://benalman.com/projects/jquery-bbq-plugin/">some</a> <a href="http://www.uploadify.com/">plugin</a>), could be <a href="http://wordpressfoundation.org/donate/">WordPress</a> (or <a href="http://www.arnebrachhold.de/projects/wordpress-plugins/google-xml-sitemaps-generator/">some</a> <a href="http://noel.io/2008/05/19/donate-a-1/">plugin</a>), or literally ANY other open source project that accepts donations.</p>
<p>This is going to be fairly <strong>quick</strong>. I&#8217;m going to pick winners on <strong>this Friday</strong>, April 9 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29761/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Slot Machine Tabs</title>
		<link>http://code95.com/blog/archives/29747</link>
		<comments>http://code95.com/blog/archives/29747#comments</comments>
		<pubDate>Tue, 06 Apr 2010 03:39:51 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29747</guid>
		<description><![CDATA[I was looking at the features page of a web service called Fluxiom. I haven&#8217;t used the product (although it looks pretty nice and might be good few a couple of our clients). It&#8217;s the tabs on that page that I thought were pretty neat. As you click a different tab, the three columns of [...]]]></description>
			<content:encoded><![CDATA[<p>I was looking at the <a href="http://fluxiom.com/features/">features page</a> of a web service called Fluxiom. I haven&#8217;t used the product (although it looks pretty nice and might be good few a couple of our clients). It&#8217;s the tabs on that page that I thought were pretty neat. As you click a different tab, the three columns of text fly upward at different rates and are replaced by new columns. It looks kinda like a slot machine. I didn&#8217;t investigate too deeply how they were doing it, but as I often do, I set about recreating the effect with jQuery.</p>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/slotmachinetabsexample.jpg" width="570" height="266" alt="" /><br /> After clicking a new tab the three columns slide away and are replace with new ones at random rates, like a slot machine.</div>
<p><a href="http://css-tricks.com/examples/SlotMachineTabs/">View Demo</a> &nbsp; <a href="http://css-tricks.com/examples/SlotMachineTabs.zip">Download Files</a></p>
<p>I thought I did OK&#8230; although it can definitely be improved. There are also enough interesting things to talk about, so let&#8217;s get after it.</p>
<p><span></span></p>
<h3>HTML</h3>
<p>Just going to do a bit of a code dump here so you can see it all.</p>
<pre><code>&lt;div id="slot-machine-tabs"&gt;

	&lt;ul class="tabs"&gt;
		&lt;li&gt;&lt;a href="#one"&gt;Tab One&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="#two"&gt;Tab Two&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="#three"&gt;Tab Three&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;

	&lt;div class="box-wrapper"&gt;

		&lt;div id="one" class="content-box"&gt;
			&lt;div class="col-one col"&gt;
				&lt;img src="images/evangeline.jpg" alt="" /&gt;
			&lt;/div&gt;
			&lt;div class="col-two col"&gt;
				&lt;h3&gt;Kate&lt;/h3&gt;
				&lt;p&gt;Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.&lt;/p&gt;
			&lt;/div&gt;
			&lt;div class="col-three col"&gt;
				&lt;p&gt;Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.&lt;/p&gt;
			&lt;/div&gt;
		&lt;/div&gt;

		&lt;div id="two" class="content-box"&gt;
			&lt;div class="col-one col"&gt;
				&lt;img src="images/elizabeth.jpg" alt="" /&gt;
			&lt;/div&gt;
			&lt;div class="col-two col"&gt;
				&lt;h3&gt;Juliet&lt;/h3&gt;
				&lt;p&gt;Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.&lt;/p&gt;
			&lt;/div&gt;
			&lt;div class="col-three col"&gt;
				&lt;p&gt;Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.&lt;/p&gt;
			&lt;/div&gt;
		&lt;/div&gt;

		&lt;div id="three" class="content-box"&gt;
			&lt;div class="col-one col"&gt;
				&lt;img src="images/sonya.jpg" alt="" /&gt;
			&lt;/div&gt;
			&lt;div class="col-two col"&gt;
				&lt;h3&gt;Penelope&lt;/h3&gt;
				&lt;p&gt;Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.&lt;/p&gt;
			&lt;/div&gt;
			&lt;div class="col-three col"&gt;
				&lt;p&gt;Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.&lt;/p&gt;
			&lt;/div&gt;
		&lt;/div&gt;

	&lt;/div&gt; &lt;!-- END Box Wrapper --&gt;

&lt;/div&gt; &lt;!-- END Slot Machine Tabs --&gt;</code></pre>
<p>Important points:</p>
<ul>
<li>The whole thing is wrapped in an <tt>div</tt> with an ID value. Should we convert this idea into a plugin, the idea would be to target this ID and do the magic. But the ID is totally unnecessary for the CSS. That means we could have multiple instances of the slot machine tabs on a single page.</li>
<li>The &#8220;navigation&#8221; (the tabs) are at the top above the content boxes. With styling turned off, this will look like a navigation list like any other. The <tt>href</tt> values for the links point to the ID&#8217;s of the content boxes, so the links would jump down the page to the corresponding content. Ideal.</li>
<li>When there are a lot of closing &lt;/div&gt;&#8217;s in a row, I like to do the thing where you add a comment afterward to explain which thing this is closing (e.g. &lt;!&#8211; END page wrap &#8211;&gt;)</li>
</ul>
<h3>CSS</h3>
<p>The tabs themselves will be like any other horizontal navigation. We&#8217;ll make the list items inline and the anchors block floated left. Simple borders and backgrounds, and a special state for &#8220;current&#8221; (no border and bumped down) and we&#8217;re set.</p>
<pre><code>.tabs { list-style: none; overflow: hidden; padding-left: 1px; }
.tabs li { display: inline; }
.tabs li a { display: block; float: left; padding: 4px 8px; color: black; border: 1px solid #ccc; background: #eee; margin: 0 0 0 -1px; }
.tabs li a.current { background: white; border-bottom: 0; position: relative; top: 2px; z-index: 2; }</code></pre>
<p>One somewhat-unsemantic thing we are using is the <tt>#box-wrapper</tt> div, but whatever it&#8217;s not that bad and it helps us in a number of ways. For one, it&#8217;s the the relative positioning container which limits the scope of absolute positioning inside it. We can then absolutely position each content box on top of each other inside.</p>
<p>My favorite part is the box-shadow CSS around the <tt>#box-wrapper</tt> div. Not only does it help the tabbed area pop up a bit, but it handles the shading on the tabs themselves. The box wrapper sits on top (literally, z-index wise) of the non-current tabs. This is exactly the illusion/visual-metaphor we are going for: the current tab is on top and connected, the non-current tabs are &#8220;behind&#8221; (shadow is cast upon them).</p>
<pre><code>.box-wrapper { -moz-box-shadow: 0 0 20px black; -webkit-box-shadow: 0 0 20px black; padding: 20px; background: white; border: 1px solid #ccc; margin: -1px 0 0 0; height: 210px; position: relative; }
.content-box { overflow: hidden; position: absolute; top: 20px; left: 20px; width: 658px; height: 230px; }</code></pre>
<p>Notice we also pull the box up by one pixel with a negative top margin. That makes sure the under-border of the non-current tabs don&#8217;t make a 2px line but a consistent 1px line.</p>
<p>Another important empowering concept here is that the <tt>#box-wrapper</tt> has hidden overflow and a set height. The columns in all the content boxes that are non-current are hidden by way of pushing their top value to 350px (a value taller than the height of the box). This pushes them completely out of view because of the hidden overflow. JavaScript will later do the job of pulling up new columns and pushing the old ones out of the way when needed.</p>
<p>The columns:</p>
<pre><code>.col { width: 30%; float: left; position: relative; top: 350px; }
.col-one, .col-two { margin-right: 3%; }</code></pre>
<p>Notice we only apply right margin to the first two columns. Another way to have done that is to apply the margin to all the columns but use <tt>.col:last-child { margin-right: 0; }</tt> to remove it. That might be the best way to go if you plan on having a variable number of columns. Just be aware of the lack of <a href="http://css-tricks.com/pseudo-class-selectors/">pseudo selector</a> support on IE.</p>
<h3>jQuery JavaScript</h3>
<p>This isn&#8217;t plugin-ized yet, but it probably could/should be. There are some things I would want to fix/make less redundant before that happens, which I&#8217;ll cover later. You can view the <a href="http://css-tricks.com/examples/SlotMachineTabs/js/slotmachine.js">full commented JavaScript file here</a>.</p>
<p>I&#8217;m not going to do a full code dump but I&#8217;ll cover some interesting lines.</p>
<p>Right away the first tab and the first content box are declared as current. The current content columns are moved to a top position of 0 (so they are visible) rather than the default hidden value from the CSS.</p>
<pre><code>$(".tabs li:first-child a, .content-box:first").addClass("current");
$(".box-wrapper .current .col").css("top", 0);</code></pre>
<p>We use the delegate function for the click events on the tabs, since that&#8217;s so efficient (and could handle dynamic addition of tabs if that came up):</p>
<pre><code>$("#slot-machine-tabs").delegate(".tabs a", "click", function() {
   // stuff
}</code></pre>
<p>When a click happens, action only takes place if the tab clicked on is <em>not</em> the current tab <em>and</em> there is no other animation taking place on the page. In this limited demo, the only animation possible is the columns. In a more &#8220;real&#8221; environment the scope of this test should probably be pared down to inside the slot machine tabs specific ID. Something like <tt>$("#slot-machine-tabs *:animated)</tt></p>
<pre><code>$el = $(this);

 if ( (!$el.hasClass("current")) &amp;&amp; ($(":animated").length == 0 ) ) {
    // stuff
}</code></pre>
<p>I thought it was a more engaging effect if columns didn&#8217;t change at the same rate each time. I set the speeds pseudo-randomly for each animation, but with a base value of half a second. The speed for the leaving column and entering column match though, so there is no overlapping.</p>
<pre><code>speedOne = Math.floor(Math.random()*1000) + 500;
speedTwo = Math.floor(Math.random()*1000) + 500;
speedThree = Math.floor(Math.random()*1000) + 500;</code></pre>
<p>Notice in the demo how all new columns always slide up from the bottom. But as they leave, the slide up to the top. That is accomplished because after the slide-them-up-and-away animation is finished, we instantly move them back down to the default low-and-hidden position. Before doing that, we need to make sure that all animations are completed. I had a slightly hard time doing this. Normally to fire something after an animation, it&#8217;s no big deal because you can have a callback function on an animation which only fires when the animation is complete. But we are running six different animations here and because they all take a random length of time, we don&#8217;t know which one is going to end last.</p>
<p>My solution so far is to call the same function on callback on every single finishing animation. For example:</p>
<pre><code>$(".box-wrapper .current .col-one").animate({
	"top": 0
}, speedOne, function() {
	ifReadyThenReset();
});</code></pre>
<p>The ifReadyThenReset() function will only do it&#8217;s thing (reset the column top positions) when it&#8217;s been called for the third time:</p>
<pre><code>var columnReadyCounter = 0;

function ifReadyThenReset() {

	columnReadyCounter++;

	if (columnReadyCounter == 3) {
		$(".col").not(".current .col").css("top", 350);
		columnReadyCounter = 0;
	}

};</code></pre>
<p>Issues:</p>
<ul>
<li>It&#8217;s not a plugin.</li>
<li>Each of the columns involved in a tab-changing event is individually animated. That&#8217;s six things being animated at once and all of them are &#8220;hard-coded&#8221;. This makes adding or removing columns more of a chore than it should be.</li>
<li>The call-the-callback-three-times thing seems kludgey to me, and the hard coded three shares the same problem as above.</li>
</ul>
<h3>Demo &#38; Download</h3>
<p><a href="http://css-tricks.com/examples/SlotMachineTabs/">View Demo</a> &nbsp; <a href="http://css-tricks.com/examples/SlotMachineTabs.zip">Download Files</a></p>
<p>As always, do what you will with this, including use it in a corporate project to impress your boss and use as example of why you deserve a raise.</p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29747/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Abstraction Point</title>
		<link>http://code95.com/blog/archives/29710</link>
		<comments>http://code95.com/blog/archives/29710#comments</comments>
		<pubDate>Sat, 03 Apr 2010 01:27:48 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29710</guid>
		<description><![CDATA[Reader Joe Bob sent me a link to IxEdit to ask what I thought. I hadn&#8217;t heard of it, so I checked it out. They have a six minute video you can watch which explains it pretty well. In a nutshell, it&#8217;s a GUI editor for creating interactive stuff on websites. Click an element, tell [...]]]></description>
			<content:encoded><![CDATA[<p>Reader Joe Bob sent me a link to <a href="http://ixedit.com/">IxEdit</a> to ask what I thought. I hadn&#8217;t heard of it, so I checked it out. They have a six minute video you can watch which explains it pretty well. In a nutshell, it&#8217;s a GUI editor for creating interactive stuff on websites. Click an element, tell it how you want it to behave. Think of it like CSS Edit for jQuery (it uses jQuery and jQuery UI to do it&#8217;s thing).</p>
<p>My thoughts: Wow, that&#8217;s extremely cool. But I&#8217;d probably never use it.</p>
<p><span></span></p>
<p>The fact that I&#8217;d never use it has nothing to do with the quality of the product. It has to do with the fact that it is beyond my Abstraction Point. If I&#8217;m going to write some page interactions, like a tabbed area or a click-this-slide-down, I&#8217;d rather write it myself in jQuery. But that&#8217;s kind of absurd isn&#8217;t it? jQuery in itself is an abstraction of JavaScript. When I write $(&#8220;#thingy&#8221;).slideDown(); there is lots of stuff going on that I barely understand. I&#8217;m far from &#8220;writing it from scratch&#8221;.</p>
<p>Taking it further, that code is ultimately served up from a web server. I certainly didn&#8217;t write that code. That web server runs on an operating system. The operating system runs on lower level code. There is a lot of steps between that circuit board and my slideDown animation. Everybody stops along the chain somewhere.</p>
<blockquote><p>&#8220;That&#8217;s for newbies, not <strong>real</strong> developers.&#8221;</p>
</blockquote>
<blockquote><p>&#8220;I write <strong>my</strong> code from scratch!&#8221;</p>
</blockquote>
<blockquote><p>&#8220;I like to know what my code is <strong>doing</strong>.&#8221;</p>
</blockquote>
<p>I think these are flawed statements. When we say or think these things, we are really saying &#8220;This is above my abstraction point.&#8221;</p>
<p>Your abstraction point is the level of abstraction you feel most comfortable in getting stuff done from day to day. It might be using design view in Dreamweaver and adding interactions with IxEdit. It might be writing in assembly language. Neither one is &#8220;better&#8221; than the other. It&#8217;s just where your current comfort level is, and more importantly, using the tools you need to to get the task done with reasonable speed.</p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29710/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Screencast: Thoughts on SEO</title>
		<link>http://code95.com/blog/archives/29709</link>
		<comments>http://code95.com/blog/archives/29709#comments</comments>
		<pubDate>Sat, 03 Apr 2010 01:27:44 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29709</guid>
		<description><![CDATA[Fair warning: more rambling than usual. Listen to my thoughts about SEO. What I think I know is that SEO is a series of fairly obvious best practices. A SEO service that helps you with those things can be good, a SEO service that claims to do anything else seems shady. However, there are plenty [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Fair warning: more rambling than usual. Listen to my thoughts about SEO. What I think I know is that SEO is a series of fairly obvious best practices. A SEO service that helps you with those things can be good, a SEO service that claims to do anything else seems shady. However, there are plenty of examples where seemingly doing everything right doesn&#8217;t seem to work, and results that show up higher than your project look like pure garbage. SEO is, and may always be, quite mysterious.</p>
</blockquote>
<p><a href="http://css-tricks.com/video-screencasts/83-thoughts-on-seo/"><img src="http://css-tricks.com/wp-content/csstricks-uploads/screencast-83-thumb.jpg" width="249" height="154" alt="" /><br /> View Screencast</a></p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29709/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Middle Box Links</title>
		<link>http://code95.com/blog/archives/29708</link>
		<comments>http://code95.com/blog/archives/29708#comments</comments>
		<pubDate>Sat, 03 Apr 2010 01:27:32 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29708</guid>
		<description><![CDATA[Worst name ever, but I was having a hard time naming it and that seemed to fit the bill. This is the end result:

It covers a variety of things I thought were interesting:

jQuery 1.4&#8217;s new element creation syntax which is pretty cool and we haven&#8217;t covered
Writing a little plugin to prevent repeated code (and keep [...]]]></description>
			<content:encoded><![CDATA[<p>Worst name ever, but I was having a hard time naming it and that seemed to fit the bill. This is the end result:</p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/middleboxlinkexample.png" width="570" height="300" alt="" /></p>
<p>It covers a variety of things I thought were interesting:</p>
<ul>
<li>jQuery 1.4&#8217;s new element creation syntax which is pretty cool and we haven&#8217;t covered</li>
<li>Writing a little plugin to prevent repeated code (and keep it in the spirit of jQuery)</li>
<li>Touches on what I am starting to consider object-oriented CSS</li>
</ul>
<p><span></span></p>
<h3>The Goal</h3>
<p>What we have here is some boxes of content. The goal is that when you mouse over them, they darken and a link appears in the exact center of them. I realize this isn&#8217;t going to be an ideal UI choice for many things. Making things unreadable as you mouse over them is an unusual design choice. But it might be perfect in some circumstances. Moral of the story: don&#8217;t make snap judgments based on demos.</p>
<h3>HTML</h3>
<p>Just a div with some text in it&#8230;</p>
<pre><code>&lt;div class="widget widget-one rounded"&gt;
  &lt;p&gt;Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.&lt;/p&gt;
&lt;/div&gt;</code></pre>
<p>What you <strong>might</strong> want to do is include a hyperlink in each widget that will go to the same place the link we are going to add with JavaScript does (degradability). Again, this is just a demo and the circumstances will be different in live scenarios.</p>
<h3>CSS</h3>
<p>I&#8217;m calling our little boxes &#8220;widgets&#8221;. Notice I gave the div wrapper a class of widget. This is the basic widget:</p>
<pre><code>.widget {
   width: 300px;
   padding: 20px;
   border: 1px solid #999;
   margin: 0 20px 20px 0;
   float: left;
   position: relative;
}</code></pre>
<p>But note that in the live demo and the image above, the widgets have rounded corners. We all know how to make rounded corners in CSS by now. There is the standard <tt>border-radius</tt> and its sister vendor extensions. Why aren&#8217;t we adding them right to the widget CSS itself? This is where the object-oriented CSS comes in&#8230;</p>
<p>The way my brain and CSS <em>typically</em> work is that I try and keep the HTML as absolutely clean and semantic as possible. I was always taught than using a CSS class name like &#8220;red&#8221; is mega bad practice because &#8220;red&#8221; isn&#8217;t semantic, is specifically descriptive. Instead you should use something like &#8220;important&#8221; or &#8220;warning&#8221;, because then later if you decide that those things should been green instead of red, your &#8220;red&#8221; class is embarrassingly irrelevant.</p>
<p>Object oriented CSS throws some of that thinking on it&#8217;s head.  Object oriented CSS uses class names specifically to describe design characteristics of that &#8220;object&#8221; (page element). Notice I also gave the widget a class of &#8220;rounded&#8221;. In our CSS, the rounded class will be this:</p>
<pre><code>.rounded {
   -moz-border-radius: 20px;
   -webkit-border-radius: 20px;
   border-radius: 20px;
}</code></pre>
<p>Blasphemy? I used to think so, but lately I&#8217;m really liking this approach. There may be 20 things on the page that are &#8220;rounded&#8221;. Now all we need to do is apply the rounded class name to each of them and they become rounded. Need to adjust that border radius? Adjust it in a single place and all the rounded objects match. Without doing it this way we&#8217;d be updating 60 different places in our CSS.</p>
<p>This may be right for some sites and not for others. That feels like a cop-out thing to say, but it&#8217;s true. Perhaps it&#8217;s unrealistic for a site with loads of legacy content. It might be brilliant for a brand new site with less content where there just nearly just as much CSS as there is HTML.</p>
<p>The JavaScript is ultimately going to apply a new div to our widgets, which will have the job of darkening the widget. We&#8217;ll call this class &#8220;overlay&#8221;. Here is the CSS for that:</p>
<pre><code>.overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: url(../images/black75.png);
    background: rgba(0,0,0,0.6);
    text-align: center;
}</code></pre>
<p>It uses RGBa to do the darkening for modern browsers (more flexibility, may save an HTTP Request), and falls back to an alpha-transparent PNG (for IE 7). Another way to deal with this would be to use a solid black background color and use <a href="http://css-tricks.com/css-transparency-settings-for-all-broswers/">regular transparency</a>, but since in this demo we&#8217;re going to have the &#8220;middle box link&#8221; inside the overlay, and we don&#8217;t want that to be transparent as well, this works fine.</p>
<h3>jQuery JavaScript</h3>
<p>To repeat our goal quickly: when a widget is rolled over, we want to darken it and add a link in the dead center of it. In our demo we have four widgets. Some of them are of a different height, so we&#8217;ll need to accommodate for that. Each widget also has different text displayed as the &#8220;middle button link&#8221; and also a different URL. That means some of this code will be different, but much will be the same. This calls for some abstraction. In JavaScript we could go right for a custom function, which we could call for each widget. In the spirit of jQuery though, let&#8217;s make it a little plugin. This means that we&#8217;ll keep intact sweet jQuery-specific features like chainability.</p>
<p>Notice that we&#8217;ve added a unique class name to each widget. That is so we can target widgets individually with that hook in the JavaScript. We could have used ID&#8217;s as well, which is a bit more efficient, but hey, you might have two widgets on the same page that use the same text and link. Using the same class name will work in that circumstances while ID&#8217;s would not. This is the abstraction we desire:</p>
<pre><code>$(function() {

    $(".widget-one").middleBoxButton("Read More", "#read");
    $(".widget-two").middleBoxButton("Go to the Store", "#store");
    $(".widget-three").middleBoxButton("Continue", "#more");
    $(".widget-four").middleBoxButton("Behold!", "#bazinga");

});</code></pre>
<p>Of course &#8220;middleBoxButton&#8221; isn&#8217;t a function. That&#8217;s what we&#8217;ll be creating as our plugin. Here&#8217;s the whole shebang:</p>
<pre><code>var $el, $tempDiv, $tempButton, divHeight = 0;

$.fn.middleBoxButton = function(text, url) {

    return this.hover(function(e) {

        $el = $(this).css("border-color", "white");
        divHeight = $el.height() + parseInt($el.css("padding-top")) + parseInt($el.css("padding-bottom"));

        $tempDiv = $("&lt;div /&gt;", {
            "class": "overlay rounded"
        });

        $tempButton = $("&lt;a /&gt;", {
            "href": url,
            "text": text,
            "class": "widget-button rounded",
            "css": {
                top: (divHeight / 2) - 7 + "px"
            }
        }).appendTo($tempDiv);

        $tempDiv.appendTo($el);

    }, function(e) {

        $el = $(this).css("border-color", "#999");

        $(".overlay").fadeOut("fast", function() {
            $(this).remove();
        })

    });

}</code></pre>
<p>So when a widget is rolled over, a brand new &lt;div&gt; is created. This div has a class of &#8220;overlay&#8221; and &#8220;rounded&#8221;. We already know what &#8220;rounded&#8221; means (OOCSS). We also already know what the &#8220;overlay&#8221; is, it ensures the div is exactly the same size is the div by setting absolute positioning and the top, right, bottom, and left values all to zero and deals with darkening. Nothing is done with this div quite yet though.</p>
<p>Then we create an anchor link. We give it the text and href attribute that we passed the plugin explicitly for this purpose. Then we append this link to the overlay div we just created and then append them both together to the widget. This element creation business is made nice and succient by jQuery 1.4&#8217;s new element creation syntax. This part:</p>
<pre><code>$("&lt;a /&gt;", {
    "href": url,
    "text": text,
    "class": "widget-button rounded",
    "css": {
        "top": (divHeight / 2) - 7 + "px"
    }
});</code></pre>
<p>Notice that I have all the &#8220;keys&#8221; (the part before the colon) in quotes. Most of the keys will work without quotes, but I was having issues with the key &#8220;class&#8221; not working in IE. Turns out it&#8217;s not a bug, it&#8217;s just that &#8220;class&#8221; is a reserved word in JavaScript, and it&#8217;s bad form not to quote it. Also turns out it&#8217;s good form to just quote everything when using JSON-like syntax like this uses.</p>
<p>Since one of our goals here is that the link appears in the exact middle, let&#8217;s talk about that. Centered it horizontally is easy, the overlay div has text-align: center, so that&#8217;s that. Vertical centering is a bit trickier. There are CSS ways of dealing with it, but none that are super clean and easy. We&#8217;re using JavaScript anyway, so let&#8217;s exploit that. We&#8217;ll just measure the height of the widget, cut it in half, and kick the link down that distance. The one kinda kludge-y part is the value &#8220;7&#8243;. You gotta hate hard-coding a value like that when what I really mean is &#8220;half the height of the button&#8221;. The problem is I couldn&#8217;t calculate the height of the button because it doesn&#8217;t exist yet when I&#8217;m setting the other attributes. If you have an idea, let me know. Also note, the height of the widget is calculated not just by using the .height() function, but by using that and adding in the top and bottom padding.</p>
<p>The callback function for the hover (mouse out), just sets the border back to its original color and fades out (then removes) the overlay div. Done!</p>
<h3>Demo and Download</h3>
<p><a href="http://css-tricks.com/examples/MiddleBoxLinks/">View Demo</a> &nbsp; <a href="http://css-tricks.com/examples/MiddleBoxLinks.zip">Download Files</a></p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29708/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Estimating Projects</title>
		<link>http://code95.com/blog/archives/29685</link>
		<comments>http://code95.com/blog/archives/29685#comments</comments>
		<pubDate>Tue, 30 Mar 2010 14:20:08 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29685</guid>
		<description><![CDATA[I like the way that we estimate projects1 at Chatman Design2. I think it epitomizes &#8220;real world&#8221; web design. We do our best to streamline the process and have a methods to the madness. But a lot of the time, estimates come down to educated guesses. Most importantly, we try and make things as clear, [...]]]></description>
			<content:encoded><![CDATA[<p>I like the way that we estimate projects<sup>1</sup> at <a href="http://chatmandesign.com">Chatman Design</a><sup>2</sup>. I think it epitomizes &#8220;real world&#8221; web design. We do our best to streamline the process and have a methods to the madness. But a lot of the time, estimates come down to educated guesses. Most importantly, we try and make things as clear, understandable, and fair for both the potential customers and us.</p>
<p><span></span></p>
<h3>The Final Product</h3>
<p>The final product of our estimating process is a PDF file that we email back to the potential client. It is on formal letterhead and recaps the major points that have been discussed thus far as well as the different major components of the project and what we will charge. The cost isn&#8217;t broken down by every little individual task, but into major groups. For example, if it would make sense to break up development of the site into phases, each phase is described and quoted. We also encourage clients to opt in to monthly maintenance, so we can nurture the site over time. Monthly maintenance is typical optional, and so is quoted separately.</p>
<p>Estimates are sent via Email generally within a few weeks of a formal exploratory meeting. These meetings are typically face to face, but not always (I typically attend via audio/video chat).</p>
<h3>Before it all begins&#8230;</h3>
<p>We don&#8217;t send a formal estimate in reply to every single email we get asking about projects. The harsh truth is that a good percentage of email inquiries about work don&#8217;t make it past the first email. If the email is poorly worded or otherwise awkward, it probably gets deleted. The client/designer relationship is a long term and important relationship. Communication needs to flow smoothly and words need to be understood clearly so the corresponding actions can be clear. If the first email throws up red flags, imagine the quagmire 100 emails later.</p>
<h3>Stick To It</h3>
<p>We prefer to quote projects <em>by the job</em>. This is mostly for the clients benefit. They can see a number and know exactly what they are getting in to. If it&#8217;s on target, they can agree and we on on our way. If it&#8217;s way off base, that can be discussed before any more unnecessary time is spent on either side. The quoted number will be the final billed number in most cases, although <em>not always</em> (read on).</p>
<h3>Hourly</h3>
<p>Even though we tend to quote <strong>by the job</strong>, we still have an hourly rate in mind when coming up with the numbers. There is a base, but it can vary up and down depending on things like:</p>
<ul>
<li>Have we worked with you before?</li>
<li>What is the nature of the work?</li>
<li>How many of us will need to be involved?</li>
</ul>
<p><a href="http://www.teehanlax.com/blog/2010/03/23/why-we-are-getting-rid-of-our-hourly-rate/">Some folks</a> would say that hourly rates are bad. One reason mentioned is that it encourages an agency to take longer since that would be more profitable. Definitely not the case with us since 1) the hourly rate mostly just helps estimate and 2) we just don&#8217;t dilly dally around to bloat bills, that&#8217;s ridiculous.</p>
<p>Depending on the situation, and especially with web-only projects, we may specially present how many hours we are estimating for different parts of the projects. This is for the explicit purpose of defining scope of the project. Web projects have a much higher tendency to have &#8220;scope creep&#8221;, or end up consuming a lot more time than originally estimated. When the hours are specified, we will likely include language like <em>&#8220;If the completed project ends up taking anywhere near the estimated hours, the final bill will be what is estimated. If we find that the project is significantly exceeding those hours, we will be in touch to discuss options.&#8221;</em></p>
<p>After all, we are talking about <em>estimates</em>. How firmly we stick to that number in final billing is another matter. Whether we include hours or not, we do mention that should the final bill exceed this price more than 25%, client approval is needed first.</p>
<h3>Fixed Costs</h3>
<p>These are easy. Do they need you to buy the domain name? Twenty bucks. Hosting for a year? Hundred bucks. These are just examples (services as well as pricing).</p>
<h3>An Educated Guess</h3>
<p>Sometimes, as much logic as you try and throw at estimating a project, you end up with the feeling that you just don&#8217;t know. You just don&#8217;t know how long it&#8217;s going to take. You just can&#8217;t forsee what kind of roadblocks you are going to come across. You just don&#8217;t know how well these new clients are going to communicate with you.</p>
<p>At this point you&#8217;ll need to do a little reflection on previous projects and then perhaps, pull a rabbit out of a hat. <em>Uhm, let&#8217;s say $8,500, that sounds about right.</em> That might read as unprofessional, but I&#8217;ll bet you a dollar the majority of agencies do a little rabbit-pulling in their estimates. It&#8217;s not unprofessional at all; In fact, I think it&#8217;s the definition of professionalism.  Professionals are people educated, trained, and skilled in a field of work. That&#8217;s what we are, and a part of those skills are making good estimations at what to charge for our services.</p>
<h3>Terms</h3>
<p>The terms of the final billing should be in the estimate as well. When the client agrees to an estimate, they are then fully aware of how the billing will go down. Projects will be billed within 30 days of the projects completion are are due NET 30 DAYS upon receipt of the bill. Past due invoices are charged a late fee percentage. Payment may be submitted via check, money order, etc.</p>
<p>You may wish to to have a client sign an agreement of the estimate and terms before beginning the project. We generally don&#8217;t, but probably would if it was a large project for a brand new client. It&#8217;s not rude, it&#8217;s business. Personally, I don&#8217;t know enough about this to give advice. Since the goal here is a legally binding contract, you should consult a lawyer.</p>
<h3>RFP</h3>
<p>Also known as a &#8220;request for proposal,&#8221; is an approach I really like that many bigger agencies take. We aren&#8217;t a big agency, but we&#8217;ve been throwing around the idea of putting something like this together. In essence, instead of having a simple contact form where someone can type in their name, phone number, and message regarding their project (and you&#8217;ll get back to them), an RFP is a much more robust form. It asks about budget and timeframe and goals and related websites and all kinds of other stuff. It might feel like a lot of hoops to jump through as a client, but this is how I see it: We&#8217;re going to be serious about your project, so we expect you to be serious about it too, and part of that is being able to clearly explain the project, yourself, your goals, your budget, and anything else we think is vital to giving you a fair estimate.</p>
<p>For an example, download the <a href="http://www.happycog.com/contact/">Project Planner from Happy Cog</a>. That&#8217;s probably a lot bigger and more detailed than we would need to be. We also take projects with a lower budget than $100,000. Although we don&#8217;t really mess around with budgets any lower than a few grand.</p>
<hr />
<p><sup>1</sup>If you are interested in having a project estimated, your best bet is to fill out our <a href="http://chatmandesign.com/contact/">simple contact form</a> with as many details about yourself and your project as possible.</p>
<p><sup>2</sup>I will actually be leaving my job at Chatman Design in May. I just need a break from the daily grind of the same sites I&#8217;ve been working on for 3 years. Chatman Design was the first web job I ever had and played huge role in shaping me into the designer I am today. I think it will be good for the clients too, as they will get a fresh set of eyes looking over their sites which I think is an undervalued thing in this industry. Carpe diem!</p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29685/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3D Text Tower</title>
		<link>http://code95.com/blog/archives/29684</link>
		<comments>http://code95.com/blog/archives/29684#comments</comments>
		<pubDate>Tue, 30 Mar 2010 14:20:02 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29684</guid>
		<description><![CDATA[Have you seen David Desandro&#8217;s site? It&#8217;s pretty slick. His footer is especially fun:

The technique is clever in it&#8217;s simplicity. Let&#8217;s take a look.

Multiple Text Shadows
The major empowering concept here is the CSS3 property text-shadow. Typically it&#8217;s like this:
.shadow {
   text-shadow: 2px 2px 4px #000;
}
Which is:
.shadow {
   text-shadow: [X offset] [Y [...]]]></description>
			<content:encoded><![CDATA[<p>Have you seen <a href="http://desandro.com/">David Desandro&#8217;s site</a>? It&#8217;s pretty slick. His footer is especially fun:</p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/texttowerexample.png" width="570" height="219" alt="" /></p>
<p>The technique is clever in it&#8217;s simplicity. Let&#8217;s take a look.</p>
<p><span></span></p>
<h3>Multiple Text Shadows</h3>
<p>The major empowering concept here is the CSS3 property <tt>text-shadow</tt>. Typically it&#8217;s like this:</p>
<pre><code>.shadow {
   text-shadow: 2px 2px 4px #000;
}</code></pre>
<p>Which is:</p>
<pre><code>.shadow {
   text-shadow: [X offset] [Y offset] [Blur size] [Color];
}</code></pre>
<p>Notice there is no vendor prefixes, which is nice (Related: <a href="http://www.quirksmode.org/blog/archives/2010/03/css_vendor_pref.html">recent debate on vendor prefixes</a>). You can also apply <em>multiple</em> shadows to the same text:</p>
<pre><code>.shadow {
   text-shadow: 1px 1px 0 black, 2px 2px 0 black;
}</code></pre>
<p>Multiple shadows happen by using a comma separated list. In the above code, there are two shadows, one offset by 1px on both axes with no blur, the second by 2px on both axes with no blur.</p>
<p>See the trick? We can apply multiple shadows, each offset by 1px from each other to build a &#8220;tower&#8221; style shadow below it. By default this would apply shadows deeper and deeper underneath the text, but we can appear to have it &#8220;pop up&#8221; by having the shadows only appear on hover and moving the text up and to the left the same depth of the shadow.</p>
<pre><code>.shadow {
   color: white;
   font: bold 52px Helvetica, Arial, Sans-Serif;
   text-shadow: 1px 1px #fe4902, 2px 2px #fe4902, 3px 3px #fe4902;
}
.shadow:hover {
   position: relative;
   top: -3px; left: -3px;
   text-shadow: 1px 1px #fe4902, 2px 2px #fe4902, 3px 3px #fe4902, 4px 4px #fe4902, 5px 5px #fe4902, 6px 6px #fe4902;
}</code></pre>
<h3>Transitions</h3>
<p>As it stands with the above code, the rollover will instantly pop up the &#8220;tower&#8221; on rollover. But we can make it &#8220;grow up&#8221; instead, as most modern browsers are now supporting transitions (i.e. animation from one state of appearance to another). We don&#8217;t get so lucky with the vendor prefixes this time. There are three to cover:</p>
<pre><code>.shadow { color: white; font: bold 52px Helvetica, Arial, Sans-Serif;
   text-shadow: 1px 1px #fe4902, 2px 2px #fe4902, 3px 3px #fe4902;
   -webkit-transition: all 0.12s ease-out;
   -moz-transition: all 0.12s ease-out;
   -o-transition: all 0.12s ease-out;
}
.shadow:hover {
   position: relative; top: -3px; left: -3px;
   text-shadow: 1px 1px #fe4902, 2px 2px #fe4902, 3px 3px #fe4902, 4px 4px #fe4902, 5px 5px #fe4902, 6px 6px #fe4902;
}</code></pre>
<p><strong>Note:</strong> -moz-transition will only begin to work in Firefox 3.7.</p>
<h3>Fun with Scaling</h3>
<p>The middle section of the footer has a different neat affect. As you roll over the different lines they grow in size. This is an other CSS3 effect: transform. Again with the vendor prefixes:</p>
<pre><code>div:hover {
   -webkit-transform: scale(1.1);
   -moz-transform: scale(1.1);
   -o-transform: scale(1.1);
   text-shadow: 3px 3px 0 #333;
}</code></pre>
<h3>Fallbacks</h3>
<p>So what happens in Internet Explorer? Text shadow won&#8217;t work, but the positioning will.</p>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/iefooterexample.png" width="344" height="197" alt="" /><br /> It&#8217;s not as pretty but it&#8217;s totally acceptable.</div>
<h3>Demo and Download</h3>
<p><a href="http://css-tricks.com/examples/3DTextTower/">View Demo</a> &nbsp; <a href="http://css-tricks.com/examples/3DTextTower.zip">Download Files</a></p>
<p>If you plan to use this somewhere, be inspired by the idea and the technology, don&#8217;t just rip off David&#8217;s footer.</p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29684/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LessConf3010</title>
		<link>http://code95.com/blog/archives/29671</link>
		<comments>http://code95.com/blog/archives/29671#comments</comments>
		<pubDate>Sat, 27 Mar 2010 01:29:34 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29671</guid>
		<description><![CDATA[
I&#8217;ll be heading down to Atlanta, Georgia to attend LessConf3010 on May 21/22, 2010. They can say it better than I can:
LessConf is a conference with talks ranging from startups to design to marketing to business.  It&#8217;s a casual two-day event in Atlanta Georgia with awesome speakers here to inspire you. Each speaker will [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://lessconf.lesseverything.com/"><img src="http://css-tricks.com/wp-content/csstricks-uploads/2010_poster2.jpg" width="288" height="450" alt="" style="float: left; margin: 0 10px 2px 0;" /></a></p>
<p>I&#8217;ll be heading down to Atlanta, Georgia to attend <a href="http://lessconf.lesseverything.com/">LessConf3010</a> on May 21/22, 2010. They can say it better than I can:</p>
<blockquote><p>LessConf is a conference with talks ranging from startups to design to marketing to business.  It&#8217;s a casual two-day event in Atlanta Georgia with awesome speakers here to inspire you. Each speaker will have a 45 minute talk followed by a 15 minute Q/A session with Steven Bristol.</p>
</blockquote>
<p>It&#8217;s put on by Allan and Steve of <a href="http://lesseverything.com/">LessEverything</a>. It&#8217;s $402 and includes a T-Shirt, copy of REWORK, and lunch with the speakers if you are within the first 100 to sign up (still room).</p>
<p>I&#8217;m pretty stoked about it. I don&#8217;t get a chance to go to many conferences, but the two I&#8217;ve been to I had a great time at. I&#8217;m looking forward to the variety at this one. Some design stuff, but also startup stuff, marketing stuff, and general business stuff.</p>
<div></div>
<p><span></span></p>
<h3>Speaker Lineup</h3>
<ul>
<li><strong>Cameron Moll</strong> of <a href="http://authenticjobs.com">Authentic Jobs</a> (and various other awesomeness)</li>
<li><strong>Chris Wanstrath</strong> of <a href="https://github.com/">GitHub</a></li>
<li><strong>Saul Colt</strong> of <a href="http://thoora.com/">Thoora</a></li>
<li><strong>Dan Martell</strong> of <a href="http://www.flowtown.com/">Flowtown</a></li>
<li><strong>David Heinemeier Hansson</strong> and <strong>Jason Fried</strong> of <a href="http://37signals.com">37signals</a></li>
<li><strong>Alex Hillman</strong> of <a href="http://indyhall.org/">IndyHall</a></li>
<li><strong>Peldi Guilizzoni</strong> of <a href="http://balsamiq.com/">Balsamiq</a></li>
<li><strong>Clay Hebert</strong> of <a href="http://tribeswin.com/">TribesWin</a></li>
</ul>
<p>I probably don&#8217;t have the answers to any super specific questions about it, so I&#8217;m going to turn off comments here and have you direct your questions/comments <a href="http://lessconf.lesseverything.com/">toward the conference folks</a> themselves.</p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29671/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Data URIs</title>
		<link>http://code95.com/blog/archives/29670</link>
		<comments>http://code95.com/blog/archives/29670#comments</comments>
		<pubDate>Sat, 27 Mar 2010 01:29:28 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29670</guid>
		<description><![CDATA[Did you know that you don&#8217;t have to link to an external image file when using an &#60;img&#62; element in HTML, or declaring a background-image in CSS? You can embed the image data directly into the document with data URIs.
With CSS, it looks like this:
li {
  background:
    url(data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7)
    [...]]]></description>
			<content:encoded><![CDATA[<p>Did you know that you don&#8217;t have to link to an external image file when using an &lt;img&gt; element in HTML, or declaring a background-image in CSS? You can embed the image data directly into the document with <strong>data URIs</strong>.</p>
<p>With CSS, it looks like this:</p>
<pre><code>li {
  background:
    url(data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7)
    no-repeat
    left center;
  padding: 5px 0 5px 25px;
}</code></pre>
<p>With HTML, it looks like this:</p>
<pre><code>&lt;img width="16" height="16" alt="star" src="data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7" /&gt;</code></pre>
<p>The format, to be specific:</p>
<pre><code>data:[&lt;mime type&gt;][;charset=&lt;charset&gt;][;base64],&lt;encoded data&gt;</code></pre>
<p>Basically, a super long string of gibberish characters. It&#8217;s not gibberish to the browser though of course. This data is interpreted as the type of file you are saying it is.</p>
<p>You can see a <a href="http://css-tricks.com/examples/DataURIs/">really dumb demo page here</a>. I&#8217;ll be covering the important parts next.</p>
<p><span></span></p>
<h3>Why would you do this?</h3>
<p>The biggest reason: it saves HTTP Requests. Other than pure document size, this is the #1 factor concerning how fast a page loads. Less = better.</p>
<h3>How do you get the code?</h3>
<p>Use this <a href="http://websemantics.co.uk/online_tools/image_to_data_uri_convertor/">online conversion tool</a>. It&#8217;s the nicest one I have found.</p>
<h3>Browser Compatibility</h3>
<p>Data URI&#8217;s don&#8217;t work in IE 5-7, but are supported in IE 8. You could:</p>
<ul>
<li>Use an <a href="http://css-tricks.com/how-to-create-an-ie-only-stylesheet/">IE-only stylesheet</a> to put images in, or,</li>
<li>Use it only for progressive enhancement type stuff where having no image is perfectly acceptable, or,</li>
<li>Not care</li>
<li><a href="http://www.phpied.com/mhtml-when-you-need-data-uris-in-ie7-and-under/">Read this article</a> about an alternate technique that does work.</li>
</ul>
<h3>Important Notes</h3>
<ul>
<li>Size of embedded code is somewhat larger than size of resource by itself. <a href="http://css-tricks.com/snippets/htaccess/active-gzip-compression/">GZip compression</a> will help.</li>
<li>IE8 has the lowest maximum data URI size of 32768 Bytes. (HEY?!?! There is that <a href="http://css-tricks.com/32766/">crazy number</a> again.)</li>
<li>It&#8217;s hard to maintain site with embedded data URIs for everything. It&#8217;s easier to just update an image and replace it.</li>
<li>If you are using PHP (or <a href="http://css-tricks.com/css-variables-with-php/">PHP as CSS</a>), you could create data URIs on the fly like this <tt>&lt;?php echo base64_encode(file_get_contents("../images/folder16.gif")) ?&gt;</tt></li>
<li>You should only use this in documents that are heavily cached, like your CSS should be. Having a CSS file that is 300k instead of 50k is fine if it saves 6 HTTP requests, but only if that CSS file is cached just as well as those images would be. Setting <a href="http://css-tricks.com/snippets/htaccess/set-expires/">long expires</a> on CSS files should help.</li>
<li>Data URIs are not limited to images, they could literally be anything.</li>
<li>&lt;canvas&gt; may obsolete the coolness of all this, when it gets more supported and people build cool tools for it.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29670/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>32766</title>
		<link>http://code95.com/blog/archives/29654</link>
		<comments>http://code95.com/blog/archives/29654#comments</comments>
		<pubDate>Wed, 24 Mar 2010 23:56:47 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29654</guid>
		<description><![CDATA[This is a bit of an interesting number. Google turns up a number of bug-related threads. The reason it came up for me, is that I get a lot of emails like this:
The AnythingSlider doesn&#8217;t work in Opera!!!

They were right&#8230; but it seemed to be a fairly new issue and I never could figure out [...]]]></description>
			<content:encoded><![CDATA[<p>This is a bit of an interesting number. Google <a href="http://www.google.com/search?hl=en&amp;safe=off&amp;client=safari&amp;rls=en&amp;q=32766+limit+-FL&amp;aq=f&amp;aqi=&amp;aql=&amp;oq=&amp;gs_rfai=">turns up</a> a number of bug-related threads. The reason it came up for me, is that I get a lot of emails like this:</p>
<blockquote><p>The <a href="http://css-tricks.com/examples/AnythingSlider/">AnythingSlider</a> doesn&#8217;t work in Opera!!!</p>
</blockquote>
<p>They were right&#8230; but it seemed to be a fairly new issue and I never could figure out why. It turns out it all comes back to 32766.</p>
<p><span></span></p>
<p>I used to get emails from people who were using the AnythingSlider and added like 80 slides to it and it didn&#8217;t work anymore. The reason was always that the inside &lt;ul&gt; element that wrapped all the slides was too narrow to fit their 80 slides. It was set at a fixed width of 9999px. The right answer would have been to make the wrapper the width of one slide multiplied by the number of them (via the JavaScript). But just in being lazy, I just added another &#8220;9&#8243; to the width making the wrapper 99999px. This was the change the borked Opera.</p>
<p>Apparently, Opera can&#8217;t handle widths greater than 32766px. There is a <a href="http://dev.opera.com/forums/topic/242545?t=1269270866&amp;page=1">thread in Opera&#8217;s forums</a> which means I&#8217;m not alone here.</p>
<p>Reader Erdei Csaba clued me in:</p>
<blockquote><p>32766px &#8230; is the highest signed 16-bit number (32767) &#8211; 1.</p>
</blockquote>
<p>Opera must store these values as signed 16-bit numbers. And apparently higher positive values (&gt; 32767) are processed as negative values.  The <a href="http://www.w3.org/TR/CSS1/#width">CSS1 spec</a> explicitly forbade negative width values, but the newer specs don&#8217;t really say anything about it. They probably assume they didn&#8217;t have to say anything, because it&#8217;s obviously pretty ridiculous to have a negative width.</p>
<p><strong>Long story short:</strong> the maximum width of an element in Opera is 32766px, and that probably should be fixed.</p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29654/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Indeterminate Radio Buttons</title>
		<link>http://code95.com/blog/archives/29653</link>
		<comments>http://code95.com/blog/archives/29653#comments</comments>
		<pubDate>Wed, 24 Mar 2010 23:56:42 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29653</guid>
		<description><![CDATA[There is a pseudo class selector, :indeterminate, whose job it can be to select radio button inputs which are neither selected (have attribute &#8220;checked&#8221;) or unselected (don&#8217;t have that). This is a CSS3 selector, which may be in response to the HTML5 spec, which explicitly allows radio buttons to be in this state:
If none of [...]]]></description>
			<content:encoded><![CDATA[<p>There is a pseudo class selector, :indeterminate, whose job it can be to select radio button inputs which are neither selected (have attribute &#8220;checked&#8221;) or unselected (don&#8217;t have that). This is a CSS3 selector, which may be in response to the <a href="http://dev.w3.org/html5/spec/forms.html#radio-button-group">HTML5 spec</a>, which explicitly allows radio buttons to be in this state:</p>
<blockquote><p>If none of the radio buttons in a radio button group are checked when they are inserted into the document, then they will all be initially unchecked in the interface, until such time as one of them is checked (either by the user or by script).</p>
</blockquote>
<p>What&#8217;s the point of all this? <strong>Well&#8230; why explicitly allow such bad UI?</strong></p>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/malefemale.png" width="129" height="55" alt="" /><br /> Neither choice selected</div>
<p><span></span></p>
<p>In a comment here last week, Lee Kowalkowski summed it up nicely:</p>
<blockquote><p>It&#8217;s poor UI in my opinion. The most popular option should be checked. If choosing nothing is valid, then a radio group isn&#8217;t a good fit because the user cannot easily revert the group to its indeterminate state.</p>
</blockquote>
<p>It&#8217;s worth repeating: <strong>the user cannot easily revert the group to its indeterminate state.</strong></p>
<p>The <a href="http://www.w3.org/TR/html401/interact/forms.html#h-17.2.1">HTML4 spec</a> made more sense:</p>
<blockquote><p>At all times, exactly one of the radio buttons in a set is checked. If none of the &lt;INPUT&gt; elements of a set of radio buttons specifies &#8216;CHECKED&#8217;, then the user agent must check the first radio button of the set initially.</p>
<p>Since user agent behavior differs, authors should ensure that in each set of radio buttons that one is initially &#8220;on&#8221;.</p>
</blockquote>
<p>That second part there, in plain English: Since we know no browsers actually follow this, we are adding this special note to remind authors to take this into their own hands.</p>
<p>In my opinion, we should revert back to the HTML4 spec, but browsers should actually respect it, by forcing at least one radio button to be checked, per group, at all times. Which would then make the :indeterminate pseudo kind of useless.</p>
<p>Remember that radio buttons and select dropdowns are essentially the same thing (can only pick one choice from multiple). So if you need an &#8220;unselected&#8221; state, perhaps a &lt;select&gt; with a default option of &#8220;Choose&#8221; would do the trick for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29653/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grid Accordion with jQuery</title>
		<link>http://code95.com/blog/archives/29638</link>
		<comments>http://code95.com/blog/archives/29638#comments</comments>
		<pubDate>Tue, 23 Mar 2010 11:22:08 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29638</guid>
		<description><![CDATA[Accordions are a UI pattern where you click on a title (in a vertical stack of titles) and a panel of content reveals itself below. Typically, all other open panels close when the new one opens. They are a clever and engaging mechanism for packing a lot of information in a small space.
  Basic [...]]]></description>
			<content:encoded><![CDATA[<p>Accordions are a UI pattern where you click on a title (in a vertical stack of titles) and a panel of content reveals itself below. Typically, all other open panels close when the new one opens. They are a clever and engaging mechanism for packing a lot of information in a small space.</p>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/accordianexample.png" width="292" height="166" alt="" /><br /> Basic accordion from jQuery UI</div>
<p>One way to look at an accordion is like a collapsed single column of a table. I was recently building a page for a client site, where the information that they provided really made sense to present as a table. But it was too much information to view all at once. I thought it would have been overwhelming visually. I also thought that it was most likely that people visiting this page would know what they needed right away, so having them click once to get it seemed pretty reasonable. So, a table of accordions!</p>
<p>Another consideration in this table I was building is that there was enough columns that each individual column (should they have been equal width in the space available) wasn&#8217;t very wide, maybe 150px. Some of these cells contained several paragraphs of text. A cell 150px wide with several paragraphs of text would awkwardly tall. Hence, the Grid Accordion is born!</p>
<p>The Grid Accordion works with the same theory as most other accordions. Only one cell is open at a time. <em>The big thing is that the column of the current open cell expands to a reasonable reading width.</em></p>
<p><img src="http://css-tricks.com/wp-content/infogridexample.jpg" width="570" height="384" alt="" /></p>
<p>You can view and download the example at the end of this article. I&#8217;ll go through some of the important bits next.</p>
<p><span></span></p>
<h3>HTML: Classic use of the definition list</h3>
<p>Accordions are perfect semantic examples of definition lists. A quick review of those:</p>
<pre><code>&lt;dl&gt;
   &lt;dt&gt;Title&lt;/dt&gt;
   &lt;dd&gt;Information about that title here&lt;/dd&gt;
   &lt;dt&gt;Another Title&lt;/dt&gt;
   &lt;dd&gt;Information about that other title here&lt;/dd&gt;
&lt;/dl&gt;</code></pre>
<p>Our grid accordion will be made up of divs floated into a horizontal row. Each div contains the title for the column and an image, as well most importantly the definition list itself. Sample of one of those divs:</p>
<pre><code>&lt;div class="info-col"&gt;

	&lt;h2&gt;Batman&lt;/h2&gt;

	&lt;a class="image batman" href="http://jprart.deviantart.com/"&gt;View Image&lt;/a&gt;

	&lt;dl&gt;
	  &lt;dt&gt;Super Power&lt;/dt&gt;
	  &lt;dd&gt;Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.&lt;/dd&gt;
	  &lt;dt&gt;Costume&lt;/dt&gt;
	  &lt;dd&gt;Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.&lt;/dd&gt;
	  &lt;dt&gt;Morality&lt;/dt&gt;
	  &lt;dd&gt;Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.&lt;/dd&gt;
	  &lt;dt&gt;Sidekicks&lt;/dt&gt;
	  &lt;dd&gt;Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.&lt;/dd&gt;
	  &lt;dt&gt;Vehicles&lt;/dt&gt;
	  &lt;dd&gt;Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.&lt;/dd&gt;
	  &lt;dt&gt;Weaknesses&lt;/dt&gt;
	  &lt;dd&gt;Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.&lt;/dd&gt;
	&lt;/dl&gt;

&lt;/div&gt;</code></pre>
<h3>CSS: trying to stay accessible</h3>
<p>Most of the CSS is just simple setup and not really worth covering here (<a href="http://css-tricks.com/examples/InfoGrid/css/style.css">full CSS file here</a>).</p>
<p>One aspect that is worth covering those is accessibility. We need to &#8220;hide&#8221; all the information panels of the table by default. One of the ways we could do that is to set the <tt>dd</tt> elements to display: none; in the CSS. This is a seriously accessibility problems though, as many screen readers will obey that CSS and completely remove that information.</p>
<p>Instead, we can &#8220;hide&#8221; the cells by just kicking them outside the browser window.</p>
<pre><code>dd { position: absolute; top: -9999px; left: -9999px; }</code></pre>
<p>This is a classic technique. In fact, it&#8217;s pretty common to see those exact CSS properties and values with a utility class name like this:</p>
<pre><code>.screen-reader-text { position: absolute; top: -9999px; left: -9999px; }</code></pre>
<p>We have another concern though. We&#8217;re going to be using some jQuery animations to slideUp and slideDown the info cells. So we can&#8217;t have them kicked off the page for typical viewers. We&#8217;ll move the cells back when the JavaScript first runs and then have the JavaScript hide them.</p>
<p>The thing about the slideDown jQuery function is that it works best when it already knows what height the element originally was before it was closed or hidden, so it can smoothly animate itself back to that original height. If we used display: none; in the CSS, this function would have no idea how tall those cells are supposed to be. Kicking them off the page instead means that the original height will be calculated, keeping that animation as smooth as it can be. We just need to make sure that the cell is set to its &#8220;full&#8221; width so the height is calculated at the width the cell will be when it&#8217;s visible.</p>
<pre><code>dd { width: 299px; position: absolute; left: -9999px; top: -9999px; }</code></pre>
<p>So at this point we have an accessible page of information, in that screen readers should be able to get all they need, and regular users have a smoothly operating system. However one thing that isn&#8217;t fully addressed is simply having JavaScript turned off. In that scenario, the information cells are still hidden by CSS. Personally, I&#8217;m far more concerned about accessibility than I am about people who browse around with JavaScript turned off and a torch to bear. However if you are, feel free to either 1) Put in a &lt;noscript&gt; message or 2) remove the CSS hiding and just let there be a bit of a flash of content before the JavaScript hides the cells.</p>
<h3>CSS: Fun with CSS3</h3>
<p>The CSS3 pseudo class selector :nth-of-type is particularly useful with definition lists. Because the dt and dd elements alternate, and actually can be repeated or in any order, :nth-child would be a non-maintainable way to go. Let&#8217;s color the cells of the table using :nth-of-type</p>
<pre><code>dt:nth-of-type(1) { background: #b44835; }
dd:nth-of-type(1) { background: #b44835; }

dt:nth-of-type(2) { background: #ff7d3e; }
dd:nth-of-type(2) { background: #ff7d3e; }

dt:nth-of-type(3) { background: #ffb03b; }
dd:nth-of-type(3) { background: #ffb03b; }

dt:nth-of-type(4) { background: #c2a25c; }
dd:nth-of-type(4) { background: #c2a25c; }

dt:nth-of-type(5) { background: #4c443c; }
dd:nth-of-type(5) { background: #4c443c; }

dt:nth-of-type(6) { background: #656b60; }
dd:nth-of-type(6) { background: #656b60; }</code></pre>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/nthoftypecoloring.jpg" width="570" height="271" alt="" /></p>
<p>For the rabble-rabble-IE-compatibility crowd, go ahead and add extra class names to the cells and do your coloring with those hooks.</p>
<p>One of the bits flair we are going to add is highlighting the current column. The class name of &#8220;curCol&#8221; will be applied and removed as needed via JavaScript. The current column will have a shadow around it, which of course is the perfect use for box-shadow:</p>
<pre><code>.curCol { -moz-box-shadow: 0 0 10px rgba(0,0,0,0.2); -webkit-box-shadow: 0 0 10px rgba(0,0,0,0.2); z-index: 1; position: relative; }</code></pre>
<p>While I was playing with this, I originally tried using some transforms to scale up the size of the current column. Ultimately I didn&#8217;t like the look (one pixel lines look awful when scaled). I liked the shadows much better, but I found that the right edge of the shadow was being cut off the the next column. It was because that next column sat slightly above the current one in terms of vertical stacking order. Hence, the curCol class having the z-index and relative positioning, to make sure it sits on top of the others.</p>
<p>Randomly, I also discovered that the transform property also solved the problem. As in, setting -moz-transform: scale(1); (which scales something to 100%, or basically, does nothing to unscaled elements) also worked by making the shadow visible. In other words: using transforms on elements affects their vertical stacking order. I&#8217;m just not sure how it all works exactly quite yet.</p>
<h3>jQuery JavaScript</h3>
<p>Again I won&#8217;t cover every line of this (you can see the <a href="http://css-tricks.com/examples/InfoGrid/js/infogrid.js">full file here</a>). Here is the logical structure though:</p>
<ol>
<li>When a &lt;dt&gt; is clicked&#8230;</li>
<li>If it&#8217;s the currently active cell, do nothing</li>
<li>Otherwise&#8230;</li>
<li>Close all open cells</li>
<li>Shrink old title</li>
<li>Enlarge new title</li>
<li>Open new cell</li>
<li>Mark the current column</li>
<li>Make sure current column is expanded and others are shrunk</li>
</ol>
<p>Couple of interesting things&#8230;</p>
<p>I would have normally used the .live() function to handle the clicks on the dt elements. But the newfangled hip way to handle this in jQuery is using .delegate()</p>
<pre><code>$("#page-wrap").delegate("dt", "click", function() {
  // do stuff
}</code></pre>
<p>Where live would have to watch the entire document for clicks, delegate limits that watching to only the page-wrap, which is more efficient.</p>
<p>I showed this to Doug Neiner, and he also suggested that clicking on the photos in each column would only open the column. Then if clicked again, they would actually go to the artist&#8217;s website (where the href of each image links to). The trick here was to prevent the default action (going to the link) when clicking on an image if it&#8217;s not the current column. Instead, divert the click to the first title in that column (which will open it). We can use delegate for this again:</p>
<pre><code>$("#page-wrap").delegate("a","click", function(e) { 

    if ( !$(this).parent().hasClass("curCol") ) {
        e.preventDefault();
        $(this).next().find('dt:first').click();
    } 

});</code></pre>
<h3>Demo and Download</h3>
<p><a href="http://css-tricks.com/examples/InfoGrid/">View Demo</a> &nbsp; <a href="http://css-tricks.com/examples/InfoGrid.zip">Download Files</a></p>
<p>Until I figure out some good licensing system&#8230; just a reminder than any downloadable example like this on this site you can use to do whatever you want with. Preferably, use it in big corporate projects and make boat loads of cash. Or, show it to your friends and tell them you did it so they will think you are awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29638/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Hard Part First</title>
		<link>http://code95.com/blog/archives/29626</link>
		<comments>http://code95.com/blog/archives/29626#comments</comments>
		<pubDate>Sun, 21 Mar 2010 19:30:46 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29626</guid>
		<description><![CDATA[I like the submit form on Art in my Coffee. It packs a lot of features into a compact space and is clear about what you are able to do and what is required of you. But best of all, I like how the very first thing it asks of you is the hardest part [...]]]></description>
			<content:encoded><![CDATA[<p>I like the <a href="http://artinmycoffee.com/submit">submit form on Art in my Coffee</a>. It packs a lot of features into a compact space and is clear about what you are able to do and what is required of you. But best of all, I like how the very first thing it asks of you is the hardest part of the whole form.</p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/hardestpart.png" width="570" height="387" alt="" /></p>
<p>It&#8217;s just a simple file input box, why is that the &#8220;hardest part&#8221;? Think what that input box represents.</p>
<ol>
<li>User has a device capable of capturing a photo</li>
<li>User has transferred that photo to his/her computer</li>
<li>User knows the location of that photo file on his/her computer</li>
<li>User is ready to brave the file selection dialog box to select it</li>
</ol>
<p><span></span></p>
<p>In a form like this, if the user doesn&#8217;t have a digital photo ready to go, they really shouldn&#8217;t be filling out the submit form. Having the file input as the first thing stops folks from doing any unnecessary work.</p>
<p>Conversely, users that <em>do</em> have an digital photo ready to go get to choose it right away. That act of choosing a file gets them heavily engaged in the process of filling out this form from the get-go. Choosing a file is a pretty intimate experience as far as web forms go. Once that is done, there will be some excitement in filling the rest of it out so it can be submitted.</p>
<p>I think this goes beyond this particular form. The overall message being: <em>let users do the thing they want to do right away</em> (likely &#8220;the hard part&#8221;) and the rest of the form will be a breeze for them. Take this example:</p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/questionfirst.png" width="570" height="494" alt="" /></p>
<p>Here we ask if the user has a question right away. They are probably at this form to begin with because they <em>do</em> have a question. Let&#8217;s let them ask it first thing. Once they&#8217;ve written it out, they are pretty committed to this form and have some momentum. Filling out their name/email/phone will be easy.</p>
<p>As opposed to this:</p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/namefirst.png" width="570" height="495" alt="" /></p>
<p>I can imagine this being met with far less enthusiasm. <em>Ugh, more hoops to jump through, I just want to ask a question.</em> Of course you are asking the exact same questions in both examples and a purely logical user would understand that of course name and contact information needs to gathered. But that doesn&#8217;t matter, the user is thinking about their question, not what other information this form wants. Let them do the hard part first.</p>
<p>&nbsp;</p>
<p>I wish I had some A/B testing to throw at you here, but I don&#8217;t. I&#8217;d like to do some on this some day. So this is just me tossing out what I think is a good UI choice based on my own professional judgment.</p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29626/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What Changed?</title>
		<link>http://code95.com/blog/archives/29616</link>
		<comments>http://code95.com/blog/archives/29616#comments</comments>
		<pubDate>Fri, 19 Mar 2010 00:12:03 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29616</guid>
		<description><![CDATA[If something was working, but now it&#8217;s broken, then something changed.
  Many things are the same, some are different.
This is true with anything: your watch, a remote control, even your relationships. It&#8217;s certainly true with websites. If your website used to work fine, but now it won&#8217;t load, then something changed. To fix it, [...]]]></description>
			<content:encoded><![CDATA[<p>If something was working, but now it&#8217;s broken, then something changed.</p>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/today-yesterday.jpg" width="570" height="200" alt="" /><br /> Many things are the same, some are different.</div>
<p>This is true with anything: your watch, a remote control, even your relationships. It&#8217;s certainly true with websites. If your website used to work fine, but now it won&#8217;t load, then something changed. To fix it, you need to figure out what that thing was.</p>
<p>Pretty obvious? Sure, if everything is working great for you right now. But the minute something breaks, it&#8217;s really easy to get into the WELL EVERYTHING WAS WORKING FINE YESTERDAY mode.</p>
<p>What could it have been?</p>
<p><span></span></p>
<ul>
<li>Has any new software been installed?</li>
<li>Has any code changed?</li>
<li>Have you asked everyone with access to it?</li>
<li>Is your allowed disk space full? Maybe something you don&#8217;t often think about was filling it, like server logs.</li>
<li>Did any file permissions change?</li>
<li>Are all the external resources your site depends on functioning properly and up to speed? Think: external JavaScript links, external RSS feeds, advertising services, APIs, etc.</li>
<li>How is incoming traffic? Major spike? Are you watching analytics? More traffic means more server resources, so you&#8217;ll need to watch things like your memory usage.</li>
<li>Is your database server responding properly? Is your database itself in good condition?</li>
<li>Did anything change with your web host?</li>
<li>Is your domain registration up to date?</li>
<li>Is the DNS server you use responding properly?</li>
<li>Is there a chance you were hacked?</li>
</ul>
<p>I once had a conversation with a Joyent employee who said that in the overwhelming majority of cases, a website was down because of something the user did, not the hosting. But still, I think a good host will help you figure out what the problem is if it is their fault or not.</p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29616/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Meet the Pseudo Class Selectors</title>
		<link>http://code95.com/blog/archives/29615</link>
		<comments>http://code95.com/blog/archives/29615#comments</comments>
		<pubDate>Fri, 19 Mar 2010 00:11:59 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29615</guid>
		<description><![CDATA[Pseudo class selectors CSS selectors with a colon preceding them. You are probably very familiar with a few of them. Like hover:
a:hover {
 /* Yep, hover is a pseudo class */
}
They are immensely useful in a variety of situations. Some of them are CSS3, some CSS2&#8230; it depends on each particular one. Outside of IE, [...]]]></description>
			<content:encoded><![CDATA[<p>Pseudo class selectors CSS selectors with a colon preceding them. You are probably very familiar with a few of them. Like hover:</p>
<pre><code>a:hover {
 /* Yep, hover is a pseudo class */
}</code></pre>
<p>They are immensely useful in a variety of situations. Some of them are CSS3, some CSS2&#8230; it depends on each particular one. Outside of IE, they have great browser support. In IE land, even IE8, support is pretty barren. However, the IE9 preview has <a href="http://ie.microsoft.com/testdrive/benchmarks/CSS3info/Default.html">full support of them</a>. The link-related ones work but not much else.  Let&#8217;s take a brief look at each one of them. Don&#8217;t worry, there isn&#8217;t that many.</p>
<p><span></span></p>
<h3>Link-related pseudo class selectors</h3>
<p><strong>:link</strong> &#8211; Perhaps the most confusion-causing link-related pseudo selector. Aren&#8217;t all &lt;a&gt;&#8217;s links? Well not if they don&#8217;t have an href attribute. This selects only those that do, thus is essentially the same as a[href]. This selector will become a lot more useful should <a href="http://meyerweb.com/eric/thoughts/2008/07/23/any-element-linking-demo/">any-element linking</a> become reality.</p>
<p><strong>:visited</strong> &#8211; Selects links that have already been visited by the current browser.</p>
<p><strong>:hover</strong> &#8211; When the mouse cursor rolls over a link, that link is in it&#8217;s hover state and this will select it.</p>
<p><strong>:active</strong> &#8211; Selects when the link while it is being activated (being clicked on or otherwise activated). For example, for the &#8220;pressed&#8221; state of a button-style link or to <a href="http://css-tricks.com/one-pixel-shift-buttons/">make all links feel more button-like</a>.</p>
<p>There is a fun technique to remember all the link pseduo class selectors. Look at the first letter if each: LVHA &#8230; <a href="http://css-tricks.com/remember-selectors-with-love-and-hate/"><strong>L</strong>O<strong>V</strong>E <strong>H</strong><strong>A</strong>TE</a>.</p>
<h3>Input &#38; link related pseudo class selectors</h3>
<p><strong>:focus</strong> &#8211; Defining hover styles for links is great, but it doesn&#8217;t help out those who used keyboard navigation to get to the link. :focus will select links that are the current focus of the keyboard. This is not limited to links, but can be used (and really should be used) on inputs and textareas as well. <a href="http://antonpeck.com/journal/article/focus_on_the_hover/">Some would tell you</a> to define a :focus style for anything that has a :hover style.</p>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/formwithfocus.png" width="392" height="293" alt="" /><br /> Form with a text input in focus. Yellow background is a focus style.</div>
<p><strong>:target</strong> &#8211; The target pseudo class is used in conjunction with ID&#8217;s, and match when the hash tag in the current URL match that ID. So if you are at URL www.yoursite.com/#home then the selector <tt>#home:target</tt> will match. Then can be extremely powerful. For example, you can create a <a href="http://css-tricks.com/css3-tabs/">tabbed area</a> where the tabs link to hash tags and then the panels &#8220;activate&#8221; by matching :target selectors and (for example) using z-index to move to the top.</p>
<p><strong>:enabled</strong> &#8211; Selects inputs that are in the default state of enabled and ready to be used.</p>
<p><strong>:disabled</strong> &#8211; Selects inputs that have the <tt>disabled</tt> attribute. A lot of browsers will make the input a faded out gray, you can control that with this selector.</p>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/disabledelements.png" width="374" height="95" alt="" /></div>
<p><strong>:checked</strong> &#8211; Selects checkboxes that are, wait for it, checked.</p>
<p><strong>:indeterminate</strong> &#8211; Selects radio buttons that are in the purgatory state of neither chosen or unchosen (like when a page loads with radio button choices but no default is set).</p>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/radiopurgatory.png" width="80" height="61" alt="" /><br /> Set of radio buttons in purgatory. Or more accurately, in their :indeterminate status.</div>
<h3>Position/Number-based pseudo class selectors</h3>
<p><strong>:root</strong> &#8211; Selects the element that is at the root of the document. Almost certainly will select the &lt;html&gt; element, unless you are specifically working in some weird environment that somehow also allows CSS. Perhaps XML.</p>
<p><strong>:first-child</strong> &#8211; Selects the first element of its type within a parent.</p>
<p><strong>:last-child</strong> &#8211; Selects the last element of its type within a parent.</p>
<p><strong>:nth-child(N)</strong> &#8211; Selects elements based on a simple provided algebraic expression (e.g. &#8220;2n&#8221; or &#8220;4n-1&#8243;). Has the ability to do things like select even/odd elements, &#8220;every third&#8221;, &#8220;the first five&#8221;, and things like that. Covered in <a href="http://css-tricks.com/how-nth-child-works/">more detail here</a> with a <a href="http://css-tricks.com/examples/nth-child-tester/">tester tool</a>.</p>
<p><strong>:nth-of-type(N)</strong> &#8211; Works like :nth-child, but used in places where the elements at the same level are of different types. Like if inside a div you had a number of paragraphs and a number of images. You wanted to select all the odd images. :nth-child won&#8217;t work there, you&#8217;d use <tt>div img:nth-of-type(odd)</tt>. Particularly useful when working with definition lists and their alternating &lt;dt&gt; and &lt;dd&gt; elements.</p>
<p><strong>:first-of-type</strong> &#8211; Selects the first element of this type within any parent. So if you have two divs, each had within it a paragraph, image, paragraph, image. Then <tt>div img:first-of-type</tt> would select the first image inside the first div and the first image inside the second div.</p>
<p><strong>:last-of-type</strong> &#8211; Same as above, only would select the last image inside the first div and the last image inside the second div.</p>
<p><strong>:nth-last-of-type(N)</strong> &#8211; Works like :nth-of-type, but it counts up from the bottom instead of the top.</p>
<p><strong>:nth-last-child(N)</strong> &#8211; Works like :nth-child, but it counts up from the bottom instead of the top.</p>
<p><strong> <img src='http://code95.com/blog/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> nly-of-type</strong> &#8211; Selects only if the element is the only one of its kind within the current parent.</p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/relationalpseudos2.png" width="570" height="541" alt="" /></p>
<h3>Relational pseudo class selectors</h3>
<p><strong>:not(S)</strong> &#8211; Removes elements from an existing matched set that match the selector inside the parameter of :not(). So for example, all divs <em>except</em> those with a class of &#8220;music&#8221; = <tt>div:not(.music)</tt>. The spec says that :not selectors cannot be nested, but they can be chained. Some browsers (Firefox) also support comma-separated selectors as the selector parameter, although chaining them would be a far safter bet. Also useful in conjunction with attribute selectors, e.g. <tt>input:not([disabled])</tt>.</p>
<p><strong>:empty</strong> &#8211; Selects elements which contain no text and no child elements. e.g. <tt>&lt;p&gt;&lt;/p&gt;</tt></p>
<h3>Text-related pseudo class selectors / elements</h3>
<p><strong>:first-letter</strong> &#8211; Selects the first letter of the text in the element. Typical use: dropcaps.</p>
<p><strong>:first-line</strong> &#8211; Selects the first line of text in the element. Typical use: setting the first sentence in small-caps as a typographical eye-catcher / lead-in.</p>
<p><strong>:lang</strong> &#8211; This pseudo selector is in the CSS3 spec but only implemented in IE 8+. Will match anything that either has or is a descendant of an element with a matching lang attribute. For example, :lang(fr) will match any paragraph, even without a lang attribute, if the parent body had lang=&#8221;fr&#8221; as an attribute.</p>
<p><strong>::selection</strong> &#8211; Allows the changing of style of selected text. For Firefox, you can use ::-moz-selection. <a href="http://css-tricks.com/overriding-the-default-text-selection-color-with-css/">More information here</a>.</p>
<h4>Quick note</h4>
<p>You can chain pseduo selectors just like you can <a href="http://css-tricks.com/multiple-class-id-selectors/">chain class and ID selectors</a>. This is particularly useful here while we are looking at :first-letter and :first-line. You probably wouldn&#8217;t want to drop cap every single paragraph on the page, but just the first one, so, <tt>p:first-child:first-letter {   }</tt></p>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/dropcap.png" width="246" height="139" alt="" /><br /> Dropcap using :first-letter, which enlarges the font size and floats to the left.</div>
<h3>Content-related pseudo &#8220;elements&#8221;</h3>
<p><strong>:before</strong> &#8211; Is able to add content before a certain element. For example, adding an opening quote before a blockquote or perhaps an preceding image to set apart a particular paragraph.</p>
<p><strong>:after</strong> &#8211; Is able to add content after a certain element. For example, a closing quote to a blockquote. Also used commonly for the <a href="http://css-tricks.com/snippets/css/clear-fix/">clearfix</a>, where an empty space is added after the element which clears the float without any need for extra HTML markup.</p>
<h4>Quick note</h4>
<p>These are appropriately called pseudo &#8220;elements&#8221; (not selectors) because they don&#8217;t select any &#8220;real&#8221; element that exists on the page. This goes for these two, as well as the previous sections :first-letter and :first-line. Make sense? Like the first letter that :first-letter selects isn&#8217;t an element all to itself, it&#8217;s just a part of an existing element, hence, pseudo element.</p>
<h3>Deprecated</h3>
<p><strong>:contains()</strong> &#8211; As far as I know, this is gone. The current CSS3 spec has removed it. I don&#8217;t know the story, let me know if you do. At a glance, it looks ridiculously useful (being able to select objects based on the textual content they contain). It may be because of problems, or having content in selectors being undesirable. My preference would be to have it select by elements rather than text, like p:contains(img), but alas, no such luck.</p>
<p><strong>:required / <img src='http://code95.com/blog/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> ptional / :read-only / :read-write</strong> &#8211; Just use attribute selectors instead.</p>
<h3>jQuery Usage</h3>
<p>jQuery can use all of these in its selectors, which if awesome. Even <em>awesomer</em>, jQuery has additional pseudo class selectors available.</p>
<p><strong>:first</strong> &#8211; The same as :nth-child(1)</p>
<p><strong>:eq(X)</strong> &#8211; The same as :nth-child(X)</p>
<p><strong>:contains(&#8216;text&#8217;)</strong> &#8211; This is removed from CSS, but still works in jQuery.</p>
<p><strong>:lt(X)</strong> &#8211; The same as :nth-child(-n+X), as in it selects the &#8220;first X elements&#8221;</p>
<p><strong>:gt(X) </strong>- The same as :nth-child(n+X), as in it selects everything except the &#8220;first (X-1) elements&#8221;</p>
<p><strong>:even</strong> &#8211; The same as :nth-child(even) or :nth-child(2n)</p>
<p><strong> <img src='http://code95.com/blog/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> dd</strong> &#8211; The same as :nth-child(odd) or :nth-child(2n+1)</p>
<p><strong>:has(S)</strong> &#8211; Works like I wish CSS :contain did, where it tests if the element has a descendant of a certain selector before matching.</p>
<p>There are actually a whole bunch more, and all of them are clever and useful (or at least an improvement on readability) See the <a href="http://api.jquery.com/category/selectors/">selector documentation</a> for more.</p>
<h3>Specificity</h3>
<p>The specificity of a pseudo class selector is less than a regular class selector. It&#8217;s the lowest value, the same value as an element selector:</p>
<pre><code>li            {}  /* specificity = 0,0,0,1 */
li:first-line {}  /* specificity = 0,0,0,2 */
li.red  {}        /* specificity = 0,0,1,1 */</code></pre>
<p>So in the example above, the :first-line selector would &#8220;beat&#8221; the regular list item selector, but the class selector will &#8220;beat&#8221; both of them.</p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29615/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Review of LightCMS</title>
		<link>http://code95.com/blog/archives/29599</link>
		<comments>http://code95.com/blog/archives/29599#comments</comments>
		<pubDate>Tue, 16 Mar 2010 19:18:30 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29599</guid>
		<description><![CDATA[Back in the summer of last year, I did a little roundup I called The &#8220;Light&#8221; CMS Trend. Ironically enough, one that wasn&#8217;t included was LightCMS. I&#8217;ve been checking it out (yes, this is a sponsored review) and it definitely fits the category, with some features that set it apart.


LightCMS is a Light CMS
Really easy [...]]]></description>
			<content:encoded><![CDATA[<p>Back in the summer of last year, I did a little roundup I called <a href="http://css-tricks.com/the-light-cms-trend/">The &#8220;Light&#8221; CMS Trend</a>. Ironically enough, one that wasn&#8217;t included was <a href="http://www.speaklight.com/">LightCMS</a>. I&#8217;ve been checking it out (yes, this is a sponsored review) and it definitely fits the category, with some features that set it apart.</p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/lightcms.png" width="570" height="100" alt="" /></p>
<p><span></span></p>
<h3>LightCMS is a Light CMS</h3>
<p><strong>Really easy updates.</strong> That is the whole point of a &#8220;light&#8221; CMS. They don&#8217;t have as many features or as much extensibility as a &#8220;full&#8221; CMS (e.g. WordPress), but they do make the job of editing content on a site more intuitive, especially for less technology-inclined clients.</p>
<p>For example, to log in to your site, you append /login to the URL, and you&#8217;ll be presented with a login screen directly in the skin of your site.</p>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/lightcms-login.jpg" width="496" height="534" alt="" /><br /> Any client can appreciate that.</div>
<p>Some of what LightCMS does is common to many CMSs. It is for managing content and building websites. It lets clients do this themselves (literally every single client I&#8217;ve had in the past many years has wanted this, whether they actually do it or not). There are users. There are templates. Some features of LightCMS are unique to it, which I&#8217;ll cover later.</p>
<h3>Editing</h3>
<p>The most important part, the editing of content, is a nice clean process. Content is kept on the page in modules. The modules can be drag &#8216;n dropped around (or manually moved) as well as of course editing and deleted.</p>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/lightcms-dragndrop.png" width="527" height="430" alt="" /><br /> Drag and drop modules</div>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/lightcmseditmenu.png" width="235" height="216" alt="" /><br /> Module menu</div>
<p>I enjoy how clean and polished all of this is. There is a lot of detail in an app with this many features and options, and it easily could have been half-assed.</p>
<h3>Differentiation</h3>
<h4>Hosted</h4>
<p>A common approach to the &#8220;light CMS&#8221; thing is to either give the CMS access to your site via FTP credentials, or put files on your server which do the job of editing. Either way, it&#8217;s your server. That can be a good thing, I know a lot of times I like having things under my control a lot of times. However, none of them are free, so it&#8217;s an expense you have on top of what you already pay for hosting. LightCMS is fully hosted.</p>
<p>They have a bunch of plans (literally 6) from free to a premier $99/month plan. The plans vary in number of users who can access the account, number of pages you can control, and the storage.</p>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/lightcmsplans.jpg" width="570" height="327" alt="" /><br /> Some of the pricing plans</div>
<p>Fully hosted means that, by default, your site lives at a subdomain on lightcms, for example: http://yourwebsite.publishpath.com/.  That may work for you, but probably not. Not very professional and all. You can easily use your own domain name though, with a simple CNAME change.</p>
<p>Fully hosted also means no manual upgrading. Not to mention customer support.</p>
<h4>FTP</h4>
<p>Even with the hosting, and the otherwise kind of clean/sanitized environment, you can get direct FTP access. Nice.</p>
<h4>Widgetry</h4>
<p>Another unique feature is how they give you functional bits you can add to pages as modules (I think they call them &#8220;elements&#8221;) just like your own custom ones. For example, a blog element, calendar element, a robust form builders, photo gallery, donations buttons, etc.</p>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/lightcmswidgets.png" width="399" height="256" alt="" /></div>
<h3>Reselling</h3>
<p>They have kind of a white label option, where you can have your clients pay for the service, and you earn money from that. They charge $19/month, and you can set the price at whatever you want (you earn whatever on top of 19 you charge). Might be nice for some folks, but probably not something I would use. I prefer billing my own clients, so I&#8217;ll just pay for it and mark it up in my own invoices, but hey whatever works.</p>
<h3>Your own designs</h3>
<p>It should go without saying, but you can use your own designs with this. Basically you create a template with HTML files in a specific naming convention (Home.html, Inside.html, Admin.html, etc). Inside those templates you declare editable regions with &#8220;tokens&#8221; like this:</p>
<pre><code>&lt;$region$&gt; &lt;$/region$&gt;</code></pre>
<p>Once you got it all together, you just zip it up and upload it and your new design will be available as a template.</p>
<h3>Try it</h3>
<p>I think it&#8217;s a pretty decent little system. Go check out their <a href="http://www.speaklight.com/why-lightcms">Why LightCMS? page</a> (and the tour) for a more thorough overview of what it does than what I presented.</p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29599/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Off Results</title>
		<link>http://code95.com/blog/archives/29598</link>
		<comments>http://code95.com/blog/archives/29598#comments</comments>
		<pubDate>Tue, 16 Mar 2010 19:18:26 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29598</guid>
		<description><![CDATA[Alright so after one missed deadline, the results are here! You can browse all the scores and see peoples entries on the CSS Off results page.


Winners
Of course all these people did a great job. For their benefit, we&#8217;re just going to nitpick offer a little constructive criticism.
1st Place &#8211; Steven Schrab &#8211; View entry
Notes: Take [...]]]></description>
			<content:encoded><![CDATA[<p>Alright so after one missed deadline, the results are here! You can browse all the scores and see peoples entries on the <a href="http://css-tricks.com/examples/CSS-OFF-2010/">CSS Off results page</a>.</p>
<p><a href="http://css-tricks.com/examples/CSS-OFF-2010/"><img src="http://css-tricks.com/wp-content/csstricks-uploads/cssresultsheader.png" width="570" height="200" alt="" /></a></p>
<p><span></span></p>
<h3>Winners</h3>
<p>Of course all these people did a <strong>great job</strong>. For their benefit, we&#8217;re just going to <strike>nitpick</strike> offer a little constructive criticism.</p>
<h4>1<sup>st</sup> Place &#8211; <a href="http://www.gsdesign.com/">Steven Schrab</a> &#8211; <a href="http://css-tricks.com/examples/CSS-OFF-2010/83/">View entry</a></h4>
<p><strong>Notes:</strong> Take it a little easier on the image compression. CSS image replacement on title looked good, but would be impractical.</p>
<h4>2<sup>nd</sup> Place &#8211; <a href="http://e26.co.uk/">Edd Sowden</a> &#8211; <a href="http://css-tricks.com/examples/CSS-OFF-2010/2/">View entry</a></h4>
<p><strong>Notes:</strong> IE 8 could have used some fallback alpha transparency support. IE 6 had the raw stylesheet, which usually is awesome, but would have been good to support for this contest.</p>
<h4>3<sup>rd</sup> Place &#8211; <a href="http://mustafaquilon.com/">Mustafa Quilon</a> &#8211; <a href="http://css-tricks.com/examples/CSS-OFF-2010/42/">View entry</a></h4>
<p><strong>Notes:</strong> Would have preferred a Helvetica at the top of the font stack over Gill Sans. Missed the shadows on the footer lines as they go under the article page.</p>
<h4>4<sup>th</sup> Place &#8211; <a href="http://www.pamgriffith.net/">Pam Griffith</a> &#8211; <a href="http://css-tricks.com/examples/CSS-OFF-2010/39/">View entry</a></h4>
<p><strong>Notes:</strong> The <tt>font-stretch</tt> property caused some big differences in the header type between WebKit and Gecko.</p>
<p>These winners have been contacted, who will then in turn select the winning commenters on the <a href="http://css-tricks.com/the-great-css-off-giveaway/">original post</a>. Once they have been selected, those people will be contacted and then prize selecting will begin.</p>
<h3>As a whole</h3>
<p>Everyone who entered should pat themselves on the back. As a whole everyone did a great job and should be proud. It was a for a good cause and good practice. I just mention this because I&#8217;m sure there will be some of you who are unhappy with their score. Don&#8217;t take it too seriously&#8230;</p>
<h3>Judging</h3>
<p>Entries were judged by myself and Doug Neiner. We each judged different alternating parts of each entry. You probably know me. Here is Doug:</p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/dougsmall.jpg" alt="" style="float: left; margin: 0 10px 2px 0;" /></p>
<p>Doug is a designer, developer, and owner of <a href="http://pixelgraphics.us/">Pixel Graphic Design Studio</a>. He is CTO of Fuel and blogger at <a href="http://fuelyourcoding.com/">Fuel Your Coding</a>. He also has a <a href="http://dougneiner.com/">personal website</a>.</p>
<div></div>
<p>&nbsp;</p>
<p>We judged on the following 100 point scale:</p>
<table rules="all" cellpadding="5" cellspacing="5">
<tr>
<td>Clean, Consistent Style</td>
<td>1 – 10 points</td>
<td>All code (HTML/CSS) organized and readable</td>
</tr>
<tr>
<td>Semantics</td>
<td>1 – 5 points</td>
<td>Smart elements and class/ID names used. Bonus for HTML5</td>
</tr>
<tr>
<td>Folder Organization</td>
<td>1 – 5 points</td>
<td>Structure of folder made sense and was organized</td>
</tr>
<tr>
<td>Matched Original Design</td>
<td>1 – 20 points</td>
<td>How close it was to original mockup in a modern browser</td>
</tr>
<tr>
<td>Good Choice Points</td>
<td>1 – 20 points</td>
<td>Made smart choices: things that should be text were text, the button was done in a smart flexible way, rollovers looked good, etc.</td>
</tr>
<tr>
<td>Modern Browser Support</td>
<td>1 – 10 points</td>
<td>Firefox 3, Safari 4</td>
</tr>
<tr>
<td>Slightly Outdated Browser Support</td>
<td>1 – 5 points</td>
<td>IE 7</td>
</tr>
<tr>
<td>Old Browser Support</td>
<td>1 – 5 points</td>
<td>IE 6</td>
</tr>
<tr>
<td>File Size</td>
<td>1 – 10 points</td>
<td>The largest (reasonable) entry got a 1, the smallest got a 10, then it was judged on that line</td>
</tr>
<tr>
<td>Image Quality</td>
<td>1 – 10 points</td>
<td>How the images looked. This was to balance the file size. Most points to entries who balanced nice images with small file sizes.</td>
</tr>
<tr>
<td>Total</td>
<td>100 max</td>
<td></td>
</tr>
</table>
<h3>Specific Problem Areas</h3>
<p>We were fairly lenient on fonts when it came to all the Helvetica Neue business. PC&#8217;s don&#8217;t come with that font, so if you used image replacement in the header, that was fine. Using image replacement for the article title isn&#8217;t a good idea though, so that was taken off for. I would have rather seen a wrong font than something that unflexible.</p>
<p>After all that judging, these are the things that tripped people up the most:</p>
<p><img src="http://css-tricks.com/wp-content/PROBLEMAREAS.jpg" width="570" height="466" alt="" /></p>
<h4>1. Line Height</h4>
<p>There was text all over this mockup, with a variety of line-heights. This was often overlooked or misjudged. Line height is crucial for displaying text that feels good to read.</p>
<h4>2. Subtle Shadows</h4>
<p>As the three little lines went under the article box, there was a subtle shadow there.</p>
<h4>3. Grid</h4>
<p>The legs of the clock lined up nicely with the edges of the three photo boxes in the mockup. Many designs didn&#8217;t get that right. If the clock was placed in a fluid width manner yet lined up when the window size was about the size of the mockup, that was acceptable.</p>
<h4>4. Web text</h4>
<p>The text in the three &#8220;quote&#8221; boxes at the bottom was Georgia in three different colors. That definitely should have been web text sitting on top of those boxes, not an image, even if it was image replacement or had proper ALT text. Web text renders better, is easier to update, is selectable, etc.</p>
<h3>Interesting Entries</h3>
<p>None of these entries were winners, but they all did interesting stuff, check it out!</p>
<p><a href="http://css-tricks.com/examples/CSS-OFF-2010/103/">#103</a> &#8211; Fixed position footer and the content slides underneath it.<br /> <a href="http://css-tricks.com/examples/CSS-OFF-2010/117/">#117</a> &#8211; View source =)<br /> <a href="http://css-tricks.com/examples/CSS-OFF-2010/104/">#104</a> &#8211; One of the examples with animations for the arms of the clock<br /> <a href="http://css-tricks.com/examples/CSS-OFF-2010/58/">#58</a> &#8211; Total reinvention of the design<br /> <a href="http://css-tricks.com/examples/CSS-OFF-2010/127/">#127</a> &#8211; Maybe the only attempt at fixed positioning the clock<br /> <a href="http://css-tricks.com/examples/CSS-OFF-2010/11/">#11</a> &#8211; Used the <a href="http://css-tricks.com/jquery-magicline-navigation/">MagicLine</a></p>
<h3>Wrap up</h3>
<p>It has been a long road! The important lesson we learned from putting on the event is that it&#8217;s a lot more work that the original idea seemed to be. But we got through it! Next time we&#8217;ll be more upfront about the timeframe and have the process more ironed out. Some sponsors will be good to to keep the thing cost neutral for everyone.</p>
<p>If you missed it up top, the <a href="http://css-tricks.com/examples/CSS-OFF-2010/">results are here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29598/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Poll: Server Side Languages</title>
		<link>http://code95.com/blog/archives/29578</link>
		<comments>http://code95.com/blog/archives/29578#comments</comments>
		<pubDate>Sat, 13 Mar 2010 19:17:23 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29578</guid>
		<description><![CDATA[A bit of a cookie-cutter poll this time, but sometimes those lead to the biggest and most interesting discussions. This is for the folks around here who are more of web developers than web designers:
What is your server-side language of choice?

Poll is on the site in the sidebar for your voting pleasure.
I know many of [...]]]></description>
			<content:encoded><![CDATA[<p>A bit of a cookie-cutter poll this time, but sometimes those lead to the biggest and most interesting discussions. This is for the folks around here who are more of web developers than web designers:</p>
<blockquote><p>What is your server-side language of choice?</p>
</blockquote>
<p>Poll is on the site in the sidebar for your voting pleasure.</p>
<p>I know many of you probably know multiple languages. Some of you probably are forced to write in particular languages for you job. For this poll, choose the language that you actually <em>like</em> the most.</p>
<p><span></span></p>
<p>And yes, I know the are more choices than in the list, that&#8217;s what &#8220;Other&#8221; is for, and I&#8217;d love to hear what those others are and why you prefer that language. For example, I&#8217;ve been hearing more and more about server-side JavaScript. Also if it&#8217;s not obvious, this is sans-framework. If you like Rails, clearly that&#8217;s Ruby. Django is Python. CodeIgnitor is PHP. Etc, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29578/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Poll Results: Punctuation Inside or Out?</title>
		<link>http://code95.com/blog/archives/29565</link>
		<comments>http://code95.com/blog/archives/29565#comments</comments>
		<pubDate>Thu, 11 Mar 2010 19:43:48 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29565</guid>
		<description><![CDATA[Quite a lot of people weighed in on this poll that went out in January. The question was:
Should tags like em and strong go &#60;em&#62;(outside)&#60;/em&#62; punctuation characters, or (&#60;strong&#62;inside them&#60;/strong&#62;)?

Like many polls around here, the question was interesting and stirred up some great conversation, but the question itself was probably flawed. There were only two [...]]]></description>
			<content:encoded><![CDATA[<p>Quite a lot of people weighed in on this poll that went out <a href="http://css-tricks.com/new-poll-tagpunctuation-placement/">in January</a>. The question was:</p>
<blockquote><p>Should tags like em and strong go &lt;em&gt;(outside)&lt;/em&gt; punctuation characters, or (&lt;strong&gt;inside them&lt;/strong&gt;)?</p>
</blockquote>
<p>Like many polls around here, the question was interesting and stirred up some great conversation, but the question itself was probably flawed. There were only two choices: outside and inside, referring to placement of the HTML tags. So if &#8220;outside&#8221;, in the example in the question above, the parentheses would be italicized by the &lt;em&gt; tags. If &#8220;inside&#8221;, in the same example above, the parentheses would be regular text and the text inside them would be bolded by the &lt;strong&gt; tags.</p>
<p>What I was expecting was someone to chime in with the <em>&#8220;absolute official rules on the right way to do it according to the typographic gods of the land.&#8221;</em> That didn&#8217;t really happen. Instead the general consensus was <em>&#8220;it depends.&#8221;</em></p>
<p>As for the poll results, at the time of this writing, 6,261 people have voted and the results are 55% in favor of &#8220;inside&#8221;:</p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/insideoutsideresults.png" width="570" height="150" alt="" /></p>
<p><span></span></p>
<h3>It depends&#8230;</h3>
<p>The following examples are still debatable, but these feel like the most correct way to go, as agreeded upon by most commenters in the original poll article.</p>
<div> Come and see me &lt;em&gt;today&lt;/em&gt;!</div>
<p>The punctuation is left outside of the tag because the word &#8220;today&#8221; alone is what is being emphasized.</p>
<hr />
<div> &lt;em&gt;Holy Crap!&lt;/em&gt; That’s a really cool blog post.</div>
<p>The punctuation is inside, because the whole phrase &#8220;Holy Crap!&#8221; is what is being emphasized.</p>
<hr />
<div> Goat heads (&lt;em&gt;see page 85&lt;/em&gt;) are very nutritious.</div>
<p>There is split evidence on this one. Some would say that because that whole phrase is an &#8220;injection&#8221; into the sentence is should be grouped with the tag (outside) and all emphasized. Other more official sources say parentheses should never be emphasized. Personally I&#8217;d go outside. Seems like there could be awkward typography tension with the last letter being italic butting up against and upright parentheses.</p>
<hr />
<div> The books title was &lt;em&gt;Gimme! Gimme! Gimme!&lt;/em&gt;</div>
<p>Punctuation in book titles always go inside the tags.</p>
<hr />
<div> Was that really Meg Ryan in &lt;em&gt;Cherry 2000&lt;/em&gt;?</div>
<p>Again it&#8217;s the title alone being emphasized, so having the question mark outside is the general consensus. I feel weird on this one, for some reason I like the opposite when it ends a sentence like this and prefer seeing the question mark follow suite with the previous words. This is a case where actually &lt;i&gt; may be more appropriate&#8230;</p>
<h3>HTML5 and &lt;b&gt; &#38; &lt;i&gt;</h3>
<p>Ever since I&#8217;ve been a web designer I&#8217;ve been scoffing at the use of the deprecated &lt;b&gt; and &lt;i&gt; tags and dutifully fixing them with the more semantic &lt;strong&gt; and &lt;em&gt; tags. This always made sense to me as we are applying emphasis with these tags, not any specific styling. For example, you might want to leave the text roman for a strong tag but apply a background behind it instead to call it out.</p>
<p>But now that we are pretty much ready to rock with HTML5, we see the &lt;b&gt; and &lt;i&gt; tags return. WTF, you ask? Well, that&#8217;s what I thought, until you read up and think on it a bit. HTML5 is not replacing strong and em, these are just coming back in addition to them, and all four will live in harmony. In general, you&#8217;ll still use em and strong to emphasize words in text, but you should use b and i <em>when you are bolding for the sake of bolding or italicizing for the sake of italicizing</em>.</p>
<p>For example, book titles in text should be italicized. Not emphasized, italicized. That is a case of italicizing for the sake of italicizing and makes more sense to use the &lt;i&gt; tag.</p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29565/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Off Update</title>
		<link>http://code95.com/blog/archives/29564</link>
		<comments>http://code95.com/blog/archives/29564#comments</comments>
		<pubDate>Thu, 11 Mar 2010 19:43:39 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29564</guid>
		<description><![CDATA[I was telling everyone to check back Wednesday for CSS Off results. Well&#8230; #facepalm. Huge apologies, we still aren&#8217;t quite ready. As it turns out judging 136 entries is quite a huge task. The important bit: come hell or high water, results will be posted Monday. You&#8217;ll be able to browse all the entries and [...]]]></description>
			<content:encoded><![CDATA[<p>I was telling everyone to check back Wednesday for CSS Off results. Well&#8230; #facepalm. Huge apologies, we still aren&#8217;t quite ready. As it turns out judging 136 entries is quite a huge task. The important bit: come hell or high water, <strong>results will be posted Monday</strong>. You&#8217;ll be able to browse all the entries and see how we scored each based on the criteria we chose. So between the organization, initial judging, top entries judging, and crafting the results page&#8230;  it has been a long road. Not to mention we didn&#8217;t anticipate so many entries! Anyway, no more excuses, see you Monday with results.</p>
<p>I got a nice card from Doctors Without Borders from the donation made based on the number of entries, so in the meantime we can all feel good about that =).</p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29564/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rabble Rabble Rabble!</title>
		<link>http://code95.com/blog/archives/29548</link>
		<comments>http://code95.com/blog/archives/29548#comments</comments>
		<pubDate>Wed, 10 Mar 2010 02:14:24 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29548</guid>
		<description><![CDATA[CSS3 is a big mess! 4+ rules for making a corner round or adding a drop shadow! Preposterous! Where are the standards?!

I&#8217;ve been hearing a ton of that. There is something of a point here. We all like standards, no question they are a good thing for the industry. Seeing a bunch of messy/repeated code [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>CSS3 is a big mess! <a href="http://css3please.com/">4+ rules</a> for making a corner round or adding a drop shadow! Preposterous! Where are the standards?!</p>
</blockquote>
<p>I&#8217;ve been hearing a ton of that. There is something of a point here. We all like standards, no question they are a good thing for the industry. Seeing a bunch of messy/repeated code like CSS3 can produce doesn&#8217;t feel like the clean happy code that standards is supposed to be all about.</p>
<p>But here is the deal.</p>
<p>The specs for these things aren&#8217;t done yet. Standards move frigging slowly. Browser vendors know we want this stuff, so they don&#8217;t wait for the spec, the use vendor-specific CSS attributes so we can start using/testing them now. This is good. It means they aren&#8217;t sitting on their asses waiting for a slow train that answers to no one. When the spec does get finished, they can roll out support for it in the standard way much quicker.</p>
<p>In my opinion, it would be <em>worse</em> for browsers to implement the new attributes without the vendor-specific prefixes, as that would <em>actually</em> be abandoning standards.</p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29548/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updates / Links</title>
		<link>http://code95.com/blog/archives/29547</link>
		<comments>http://code95.com/blog/archives/29547#comments</comments>
		<pubDate>Wed, 10 Mar 2010 02:14:21 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29547</guid>
		<description><![CDATA[If you were interested in that CSS Tabs stuff from yesterday, check out the new demo. I got a little obsessed with it and tried out a bunch more things. Still nothing I&#8217;d call a 100% perfect replacement to using JavaScript for tabs, but getting a lot cleaner and closer.
I&#8217;m sure most of you read [...]]]></description>
			<content:encoded><![CDATA[<p>If you were interested in that CSS Tabs stuff from yesterday, <a href="http://css-tricks.com/examples/CSSTabs/">check out the new demo</a>. I got a little obsessed with it and tried out a bunch more things. Still nothing I&#8217;d call a 100% perfect replacement to using JavaScript for tabs, but getting a lot cleaner and closer.</p>
<p>I&#8217;m sure most of you read these sites anyway, but just in case&#8230;</p>
<p><span></span></p>
<p>I thought Nettuts ran a pretty sweet article about jQuery and it&#8217;s <a href="http://net.tutsplus.com/tutorials/javascript-ajax/uncovering-jquerys-hidden-features/">hidden features</a> by James Padolsey. For example, I always forget how awesomely easy it is to serialize from inputs (like for AJAX submission). Serialize = find all the inputs in the form and build a query string with the name/value pairs, instead of doing all that yourself/hard coding it.</p>
<p>Then Smashing Magazine ran a great one by Andy Rutledge answering <a href="http://www.smashingmagazine.com/2010/03/08/common-questions-about-design-professionalism/">common questions about design professionalism</a>. Andy is an opinionated dude and I love how he dished out some hard facts here. For example, if you are asking questions like &#8220;I&#8217;m just staring freelancing and I&#8217;m wondering how I can get more clients&#8230;&#8221; then you probably shouldn&#8217;t be freelancing. Plus, a heaping helping of personal responsibility.</p>
<p>Jeff Starr over on Digging Into WordPress wrote up a nice guide on <a href="http://digwp.com/2010/03/add-plugin-to-wordpress-plugin-repository/">getting a plugin into the official plugin repository</a>. I&#8217;m a little disappointed in myself I&#8217;ve never done this before. I&#8217;m not much of a deep backend dude, but still, I have a few ideas that I think would make cool plugins.</p>
<p>I&#8217;m gonna close comments here just because anything that needs to be said about any of these things is probably best said at that article.</p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29547/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS3-Only Tabbed Area</title>
		<link>http://code95.com/blog/archives/29546</link>
		<comments>http://code95.com/blog/archives/29546#comments</comments>
		<pubDate>Wed, 10 Mar 2010 02:14:14 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29546</guid>
		<description><![CDATA[When you think of &#8220;tabs&#8221;, your mind might go right to JavaScript. Watch for a click on a tab, hide all the panels, show the one corresponding to tab just clicked on. All major JavaScript libraries tackle tabs in some way. But there is a way to accomplish this same idea with &#8220;pure CSS&#8221;. Just [...]]]></description>
			<content:encoded><![CDATA[<p>When you think of &#8220;tabs&#8221;, your mind might go right to JavaScript. Watch for a click on a tab, hide all the panels, show the one corresponding to tab just clicked on. All major JavaScript libraries tackle tabs in some way. But there is a way to accomplish this same idea with &#8220;pure CSS&#8221;. Just as we did with the <a href="http://css-tricks.com/video-screencasts/82-css-image-switcher/">CSS Image Switcher</a>, let&#8217;s tackle this traditionally JavaScript project with only CSS.</p>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/csstabsexample.png" width="497" height="141" alt="" /><br /> Tabs: a ubiquitous design pattern</div>
<p><span></span></p>
<h3>:target pseudo class selector</h3>
<p>The major empowering concept here is the CSS pseudo selector :target. :target is used in conjunction with ID selectors. The selector will match when the current URL contains a hash-tag of that exact ID. So if the current URL is:</p>
<p>http://css-tricks.com/#big-bam-boom</p>
<p>And there was an element with that ID on the page:</p>
<pre><code>&lt;h1 id="big-bam-boom"&gt;Kaplow!&lt;/h1&gt;</code></pre>
<p>Then this selector will match:</p>
<pre><code>#big-bam-boom:target { color: red; }</code></pre>
<p>How does one get to a URL with such a hash tag? You have links that activate them:</p>
<pre><code>&lt;a href="#big-bam-boom"&gt;Mission Control, we're a little parched up here.&lt;/a&gt;</code></pre>
<h3>Browser Support / CSS3</h3>
<p>Normally I might end a tutorial like this with a little section on browser support. But it&#8217;s rather important in this case so let&#8217;s get it out of the way now. :target is considered CSS3. It has wide support across all the major current browsers. Of course I&#8217;m all abut dropping support for IE 6, so who cares if it doesn&#8217;t work in that (it doesn&#8217;t), but :target is also not supported in IE 7 or 8. These browsers are still very much on the radar, which puts this whole tutorial in a fun/educational category rather than a use-this-in-live-production category.</p>
<p>Of course, if you wanted to use it in production, one option would be to use <a href="http://css-tricks.com/how-to-create-an-ie-only-stylesheet/">conditional comments</a> to add JavaScript to make them to work. We won&#8217;t specifically cover that here.</p>
<h3>Clean HTML</h3>
<p>Let&#8217;s start this out right with some nice and clean HTML markup for our soon-to-be tabbed area:</p>
<pre><code>&lt;div class="tabbed-area"&gt;

	&lt;ul class="tabs group"&gt;
	    &lt;li&gt;&lt;a href="#box-one"&gt;Tab 1&lt;/a&gt;&lt;/li&gt;
	    &lt;li&gt;&lt;a href="#box-two"&gt;Tab 2&lt;/a&gt;&lt;/li&gt;
	    &lt;li&gt;&lt;a href="#box-three"&gt;Tab 3&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;

	&lt;div class="box-wrap"&gt;

		&lt;div id="box-one"&gt;
		  &lt;!-- box two content --&gt;
		&lt;/div&gt;

		&lt;div id="box-two"&gt;
		  &lt;!-- box two content --&gt;
		&lt;/div&gt;

		&lt;div id="box-three"&gt;
		  &lt;!-- box two content --&gt;
		&lt;/div&gt;

	&lt;/div&gt;

&lt;/div&gt;</code></pre>
<p>I&#8217;d call that perfectly clean. Even with CSS disabled, you would see a list of links each of which would jump down the page to the div with the content related to that link.</p>
<h3>CSS</h3>
<p>The tabs themselves we&#8217;ll set up as a horizontal row of links.</p>
<pre><code>.tabs { list-style: none; }
.tabs li { display: inline; }
.tabs li a { color: black; float: left; display: block; padding: 4px 10px; margin-left: -1px; position: relative; left: 1px; background: white; text-decoration: none; }
.tabs li a:hover { background: #ccc; }</code></pre>
<p>When you float all the links like that, the parent will collapse, so let&#8217;s chuck in the old clearfix class so we can use it on the parent <tt>ul</tt> so it has a natural height. No need for the IE 6 and 7 hacks here, since neither of those support this technique anyway.</p>
<pre><code>.group:after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; }</code></pre>
<p>Now let&#8217;s set up the very basic styling for the panels. There is a wrapping div for all the panels. The purpose of that is to set a relative positioning context so we can absolutely position panels inside of it. All the panels will be of equal height and width and positioned exactly on top of each other. Both panels and tabs share the same 1px border.</p>
<pre><code>.box-wrap { position: relative; min-height: 250px; }
.tabbed-area div div { background: white; padding: 20px; min-height: 250px; position: absolute; top: -1px; left: 0; width: 100%; }
.tabbed-area div div, .tabs li a { border: 1px solid #ccc; }</code></pre>
<p>Now the magical part that makes it work is as simple as adjusting the z-index of the panels when they are &#8220;targeted&#8221;.</p>
<pre><code>#box-one:target, #box-two:target, #box-three:target {
  z-index: 1;
}</code></pre>
<h3>Ruh-Roh&#8230; What about current tab highlighting?</h3>
<p>What we have so far is a totally functional tabbed area. You click the tab, the corresponding content in that tab loads. Functional, but not the most helpful UI. There is no feedback at all which tab is the currently showing tab, either when the page loads or even when you click to view a different tab.</p>
<p>This is a fairly major hurdle. I find a way to solve it, and we&#8217;ll go through that here, <strong>but it&#8217;s dirty</strong>. The root of the issue is that we can&#8217;t select back &#8220;up&#8221; the element tree. So if we need the panels to have ID&#8217;s, the only thing we can affect in CSS is decedents of that div when it is in :target. For example:</p>
<pre><code>#box-four:target a[href="#box-four"] { color: red; }</code></pre>
<p>That would be a cool way to select only that particular link when that panel is active, but as of now, we can&#8217;t do that because that link isn&#8217;t a descendant of the panel.</p>
<p>The only way I&#8217;ve been able to solve this is to actually just make the navigation descendants of the panels. This is a bummer, because that means that each panel needs to repeat the tabs&#8230;.</p>
<pre><code>&lt;div class="box-wrap"&gt;

	&lt;div id="box-four"&gt;
        &lt;!-- content for panel --&gt;

        &lt;ul class="tabs group"&gt;
            &lt;li class="cur"&gt;&lt;a href="#box-four"&gt;Tab 4&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="#box-five"&gt;Tab 5&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="#box-six"&gt;Tab 6&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
	&lt;/div&gt;

	&lt;div id="box-five"&gt;
	    &lt;!-- content for panel --&gt;

        &lt;ul class="tabs group"&gt;
            &lt;li&gt;&lt;a href="#box-four"&gt;Tab 4&lt;/a&gt;&lt;/li&gt;
            &lt;li class="cur"&gt;&lt;a href="#box-five"&gt;Tab 5&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="#box-six"&gt;Tab 6&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
	&lt;/div&gt;

	&lt;div id="box-six"&gt;
	    &lt;!-- content for panel --&gt;

        &lt;ul class="tabs group"&gt;
            &lt;li&gt;&lt;a href="#box-four"&gt;Tab 4&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="#box-five"&gt;Tab 5&lt;/a&gt;&lt;/li&gt;
            &lt;li class="cur"&gt;&lt;a href="#box-six"&gt;Tab 6&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
	&lt;/div&gt;

&lt;/div&gt;</code></pre>
<p>Very much not ideal, I know. But now that the lists are inside the panels, we can just use a &#8220;current&#8221; class on the list item that is the correct corresponding link and style that. And we&#8217;ll make sure the current panels tab navigation is positioned above the panels and is &#8220;on top&#8221; when it&#8217;s panel is.</p>
<pre><code>.cur-nav-fix .tabs { position: absolute; bottom: 100%; left: -1px; }
.cur-nav-fix .tabs li a { background: -moz-linear-gradient(top, white, #eee); }
#box-four { z-index: 1; }
#box-four:target .tabs, #box-five:target .tabs, #box-six:target .tabs { z-index: 3; }
.cur-nav-fix .tabs li.cur a { border-bottom: 1px solid white; background: white; }</code></pre>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/curnavtab.png" width="320" height="148" alt="" /><br /> Now with current tab highlighting!</div>
<div>
<h4>Update</h4>
<p>The above code, as mentioned, is definitely not a good way to go. I played with this whole idea a bunch more and the demo linked to now below has a whole bunch of different ideas for this including some decent solutions.</p>
</div>
<h3>Demo and Download</h3>
<p>Use at will, just be aware of the IE 7 problem. All of the HTML and CSS are right on one page, so if you want to &#8220;download&#8221; it, just copy and paste the code into an html file and save it.</p>
<p><a href="http://css-tricks.com/examples/CSSTabs/">View Demo</a></p>
<h3>Hash it out</h3>
<p>You&#8217;ll notice in the demo that if you click a tab in the one on the left and then click on a tab in the one on the right, the area on the left will revert back to it&#8217;s default slide rather than keep it&#8217;s current slide. That all goes back to :target and how it&#8217;s related to the hash in the URL. There is really no way around this without bringing in JavaScript, so if that&#8217;s not gonna work for you, you should probably just go JavaScript from the get-go.</p>
<p>Also, hash tag links &#8220;jump down the page&#8221; when clicked, so also note that that when you click a tab your browser window will pop down to have that tab be the top-most element (if there is enough room to scroll down on the page). Again, no fighting that without JavaScript to my knowledge.</p>
<h3>Other resources</h3>
<ul>
<li><a href="http://carsonified.com/blog/dev/stay-on-target/">Stay on Target</a> &#8211; Awesome article from Think Vitamin, unfortunately missing it&#8217;s demos. It covers some uber clever techniques though.</li>
<li><a href="http://www.w3.org/TR/css3-selectors/#target-pseudo">W3C spec on :target</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29546/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unicode Characters for Class Names</title>
		<link>http://code95.com/blog/archives/29531</link>
		<comments>http://code95.com/blog/archives/29531#comments</comments>
		<pubDate>Sat, 06 Mar 2010 13:46:16 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29531</guid>
		<description><![CDATA[Reader Kartlos emailed me in pointing to me to an interesting article by the great Mr. Snook from a few years back. I don&#8217;t think I had seen it before and it&#8217;s a bonafide &#8220;CSS Trick&#8221; so I thought I would share.
The idea is that you can use unicode characters (read: fancy symbols) for class [...]]]></description>
			<content:encoded><![CDATA[<p>Reader Kartlos emailed me in pointing to me to an interesting article by the great <a href="http://snook.ca/archives/html_and_css/unicode_for_css_class_names">Mr. Snook</a> from a few years back. I don&#8217;t think I had seen it before and it&#8217;s a bonafide &#8220;CSS Trick&#8221; so I thought I would share.</p>
<p>The idea is that you can use unicode characters (read: fancy symbols) for class names in your HTML, and even use write CSS selectors with those same characters.</p>
<pre><code>&lt;div class="♫"&gt;
    A.A. Bondy
    &lt;em&gt;I Can See The Pines Are Dancing&lt;/em&gt;
&lt;/div&gt;</code></pre>
<pre><code>.♫ {
   display: block;
   background: #eee;
   padding: 5px;
 }</code></pre>
<p>Pretty cool eh? I&#8217;d call my example above perfectly semantic as well, since the div with the music note class name is marking up a musician and song. Possibly even more semantic, as a music note symbolizes music moreso than any English word.</p>
<p><span></span></p>
<p>I put together a <a href="http://css-tricks.com/examples/UnicodeClassNames/">super simple demo page</a> that shows it working. Oh, and yes-it-works-in-IE6&trade; &amp; yes-it-validates&trade;</p>
<h3>But&#8230;</h3>
<p>One funny thing? View the source on that page. I use PHP includes for the headers and footers of all my demos, and because of the character encoding (?) of that page the PHP doesn&#8217;t run it just sits there as text.</p>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/phpastext.png" width="326" height="87" alt="" /><br /> That ain&#8217;t right.</div>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/codawarning.png" width="566" height="171" alt="" /><br /> Coda does warn you first.</div>
<p>Weird eh? If you know how this could work both ways, let me know.</p>
<h3>Other uses</h3>
<p>Jonathan presented (in his original article) and idea for targeting the corners of a box.</p>
<pre><code>&lt;div class="□"&gt;
  &lt;div class="┌"&gt;
    &lt;div class="┐"&gt;
      &lt;div class="└"&gt;
        &lt;div class="┘"&gt;
          content
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;</code></pre>
<p>Remember back a few years ago most of us were rocking rounded corners with nested divs and images like that! The corners symbols are clever, but I could see the <tt>&lt;div class="□"&gt;</tt> being used for like &#8220;container&#8221; or &#8220;box&#8221; style classes today, or, perhaps best of all, <a href="http://css-tricks.com/snippets/css/clear-fix/">the clearfix</a>.</p>
<p>I posted a little code clip of this over on <a href="http://forrst.com/">Forrst</a> (sorry I know most folks don&#8217;t have accounts there yet) and a guy named Aaron had a funny idea. Using upside down writing to be annoying! <tt>id='ɹǝpɐǝɥ', id='ɹǝddɐɹʍ', id='ɹǝʇooɟ'</tt></p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29531/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Screencast: CSS Image Switcher</title>
		<link>http://code95.com/blog/archives/29522</link>
		<comments>http://code95.com/blog/archives/29522#comments</comments>
		<pubDate>Thu, 04 Mar 2010 20:22:58 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29522</guid>
		<description><![CDATA[Roll over a link, watch the image above change. That’s what we build in this screencast, only we don’t use any JavaScript to do it. The trick is some simple z-index switching on hover and a bit of absolute positioning.

 View Screencast
]]></description>
			<content:encoded><![CDATA[<blockquote><p>Roll over a link, watch the image above change. That’s what we build in this screencast, only we don’t use any JavaScript to do it. The trick is some simple z-index switching on hover and a bit of absolute positioning.</p>
</blockquote>
<p><a href="http://css-tricks.com/video-screencasts/82-css-image-switcher/"><img src="http://css-tricks.com/wp-content/csstricks-uploads/screencast-82-thumb.jpg" width="249" height="154" alt="" /><br /> View Screencast</a></p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29522/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Increment Inputs with the Mousewheel</title>
		<link>http://code95.com/blog/archives/29521</link>
		<comments>http://code95.com/blog/archives/29521#comments</comments>
		<pubDate>Thu, 04 Mar 2010 20:22:52 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29521</guid>
		<description><![CDATA[In the past we&#8217;ve covered adding +/- buttons to number-based inputs to help user interface (it&#8217;s easier than typing in some circumstances). Reader Hitesh N Chavda emailed me with the idea of doing it with the scroll of the mouse wheel instead.
  With the mouse cursor inside the input box, you can use the [...]]]></description>
			<content:encoded><![CDATA[<p>In the past we&#8217;ve covered <a href="http://css-tricks.com/number-increment-buttons/">adding +/- buttons</a> to number-based inputs to help user interface (it&#8217;s easier than typing in some circumstances). Reader Hitesh N Chavda emailed me with the idea of doing it with the scroll of the mouse wheel instead.</p>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/mousewheelinput.png" width="226" height="68" alt="" /><br /> With the mouse cursor inside the input box, you can use the mouse scroll wheel to increment the number up and down.</div>
<p>Hitesh worked up a technique for doing it using jQuery, which works great. Then later he found <a href="http://brandonaaron.net/code/mousewheel/demos">a plugin</a> which has already been built for dealing with mousewheel events, which is really nice and simplifies things. Just for fun the demo will leave both versions in it.</p>
<p><span></span></p>
<h3>HTML</h3>
<p>This could literally work on any element, but text inputs make the most sense. Perhaps this could be used on a time-tracking form where you need to need to enter the number of hours/minutes spent on something. Or perhaps an order form for entering how many of something to order.</p>
<p>In our demo we&#8217;ll just have a label input pair like you&#8217;d find in just about any &lt;form&gt;:</p>
<pre><code>&lt;div&gt;
    &lt;label for="how-many"&gt;How Many? &lt;/label&gt;
    &lt;input type="text" id="how-many" class="wheelable" value="1" name="how-many" /&gt;
&lt;/div&gt;</code></pre>
<h3>jQuery</h3>
<p>If you want to check out the non-plugin version of this, just download the files below. We&#8217;ll cover using the plugin here, for brevity. You&#8217;ll need to include jQuery, the plugin, and your own JavaScript file:</p>
<pre><code>&lt;script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="js/jquery.mousewheel.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="js/increment.js"&gt;&lt;/script&gt;</code></pre>
<p>When the DOM is ready, we&#8217;ll bind the new &#8220;mousewheel&#8221; event to the input. When that input fires, if it&#8217;s an &#8220;up&#8221; mousewheel scroll, we&#8217;ll increment the value upwards one, if &#8220;down&#8221;, it will be decremented by one (unless it&#8217;s already zero).</p>
<p>The appending of the image on the first line is so that non JavaScript users won&#8217;t see the graphic which indicates mousewheel scrollability.</p>
<pre><code>$(function() {

    $("div").append('&lt;img src="images/mousewheelupdown.png" alt="Scroll up or down with mousewheel" /&gt;');

    $("#how-many").bind("mousewheel", function(event, delta) {
        if (delta &gt; 0) {
            this.value = parseInt(this.value) + 1;
        } else {
            if (parseInt(this.value) &gt; 0) {
                this.value = parseInt(this.value) - 1;
            }
        }
        return false;
     });

});</code></pre>
<h3>What about non-numeric inputs?</h3>
<p>You&#8217;ll have to deal with that as needed. Now that you have the &#8220;mousewheel&#8221; event that the plugin provides, the function you write when that event fires could be anything. In the demo I have a text input which cycles through a list of different kinds of whales&#8230;</p>
<pre><code>$("#whale").bind("mousewheel", function(event, delta) {
    if (this.value == "Blue") {
        this.value = "Sperm";
    }
    else if (this.value == "Sperm") {
        this.value = "Orca";
    }
    else if (this.value == "Orca") {
        this.value = "Humpback";
    }
    else if (this.value == "Humpback") {
        this.value = "Blue";
    }
    return false;
 });</code></pre>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/whale.png" width="321" height="79" alt="" /><br /> Killer whales are getting all the press lately, time for some Humpback love.</div>
<h3>Degradation</h3>
<p>This is pure progressive enhancement. Without JavaScript the inputs are still inputs which behave just as any other input would.</p>
<h3>Enjoy</h3>
<p><a href="http://css-tricks.com/examples/MousewheelInputs/">View Demo</a> &nbsp; <a href="http://css-tricks.com/examples/MousewheelInputs.zip">Download Files</a></p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29521/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speed Up with CSS3 Gradients</title>
		<link>http://code95.com/blog/archives/29506</link>
		<comments>http://code95.com/blog/archives/29506#comments</comments>
		<pubDate>Wed, 03 Mar 2010 04:10:34 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29506</guid>
		<description><![CDATA[WebKit browsers paved the way with CSS based gradients. Now Firefox 3.6 is out and is supporting them as well, which makes using them for progressive enhancement all the more appealing. More good news, CSS3 gradients fall into the camp where you can specify fallbacks (i.e. images) so that browsers that don&#8217;t support them just [...]]]></description>
			<content:encoded><![CDATA[<p>WebKit browsers paved the way with CSS based gradients. Now Firefox 3.6 is out and is supporting them as well, which makes using them for progressive enhancement all the more appealing. More good news, CSS3 gradients fall into the camp where you can specify fallbacks (i.e. images) so that browsers that don&#8217;t support them just use the image instead.</p>
<p>But wait&#8230; if you need to use an image anyway, why bother with declaring the gradient with CSS?  That is kind of how I felt for a long time, but there is one important aspect that makes it worth it: <strong>browsers that support them don&#8217;t load the image fallback.</strong> One less HTTP Request = all the faster your site will load.</p>
<p><span></span></p>
<p><strong>Huge thanks to <a href="http://www.spathon.se/">Patrik Spathon</a> for this idea and help with the demo page!</strong></p>
<h3>How it&#8217;s done</h3>
<p>Cutting to the chase, here is how it&#8217;s done:</p>
<pre><code>div {
            background-color: #1a82f7; /* fallback color */
            background-image: url(images/linear_bg_2.png); /* fallback image */
            background-image: -moz-linear-gradient(100% 100% 90deg, #2F2727, #1a82f7);
            background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#1a82f7), to(#2F2727));
}</code></pre>
<p><a href="http://css-tricks.com/examples/CSS3Gradient/">View Demo</a> &nbsp; <a href="http://css-tricks.com/examples/CSS3Gradient.zip">Download Files</a></p>
<h3>Different syntax for different rendering engines</h3>
<h4>Mozilla (Firefox, Flock, etc)</h4>
<p>Mozilla&#8217;s syntax (<a href="https://developer.mozilla.org/en/CSS/-moz-linear-gradient">more detail here</a>) is like this:</p>
<pre><code>-moz-linear-gradient( [&lt;point&gt; || &lt;angle&gt;,]? &lt;stop&gt;, &lt;stop&gt; [, &lt;stop&gt;]* )</code></pre>
<p>The simplest way to declare a gradient is to just list a comma separated list of colors. That will start at the top and gradient to the bottom with equidistant color stops for each color. In the demo code above, we use a point and an angle (90deg) to it go bottom-to-top instead. For radial gradients: <tt>-moz-radial-gradient</tt></p>
<h4>WebKit (Safari, Chrome, etc)</h4>
<p>WebKit&#8217;s syntax (<a href="http://webkit.org/blog/175/introducing-css-gradients/">more detail here</a>) is like this:</p>
<pre><code>-webkit-gradient(&lt;type&gt;, &lt;point&gt; [, &lt;radius&gt;]?, &lt;point&gt; [, &lt;radius&gt;]? [, &lt;stop&gt;]*)</code></pre>
<h4>Trident (IE)</h4>
<p>Trident&#8217;s syntax (not really CSS3&#8230; <a href="http://msdn.microsoft.com/en-us/library/ms532997%28VS.85,loband%29.aspx">more detail here</a>) is like this:</p>
<pre><code>filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#1471da, endColorstr=#1C85FB);

-ms-filter: "progid:DXImageTransform.Microsoft.gradient (GradientType=0, startColorstr=#1471da, endColorstr=#1C85FB)";</code></pre>
<p><strong>Unfortunately, we can&#8217;t invite IE to the party!</strong> Using these filter properties does indeed work, and it would allow us to programatically declare gradients which is cool. But, instead of using the filter first and the image as a fallback, declaring a background-image overrides the filter and it uses that. Since we definitely still need image fallbacks, we might as well not use this at all.</p>
<h3>&#8220;Stops&#8221;</h3>
<p>The WebKit and Mozilla syntax for gradients both incorporate &#8220;stops&#8221;. A stop is an optional additional declaration that includes a point and a color. This means the gradient wont just start at one color and end at the other, it will fade to the stop color first, and that stop color will fade to the end color. More than one stop can also be used.</p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/stopexample.jpg" width="570" height="200" alt="" /></p>
<h3>Saving HTTP requests</h3>
<p>Using Firebug and looking in the Net tab to see all the resources used by the page, we can see the advantage.</p>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/gradientnotloaded.jpg" width="449" height="347" alt="" /><br /> The above screenshot is Firefox 3.6. We can see that the gradient fallback images are NOT loaded, which saves an HTTP request.</div>
<p>However using Firefox 3.5.8, the fallbacks <strong>are</strong> loaded.</p>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/gradientisloaded.jpg" width="427" height="400" alt="" /><br /> We don&#8217;t save any HTTP Requests in olders version of Firefox (This is 3.5.8 on Vista). The gradient fallback images are still being loaded (and used).</div>
<p>It gets a little more iffy in WebKit browsers.</p>
<div> <img src="http://css-tricks.com/wp-content/csstricks-uploads/safariloadsgradient.jpg" width="493" height="381" alt="" /><br /> WebKit browsers WILL use the CSS3 property to render the gradient, but at the same time, still load the fallback images, so no HTTP requests are saved. The only advantage is the programatic declaration of color.</div>
<h3>Doing it by the numbers</h3>
<p>The speed gained by losing an HTTP request, to me, is the biggest advantage. The more I learn about web performance it seems to me keeping those down is the #1 way to improve page load time. However there is another advantage to using CSS3 gradients, and that is that these gradients are created programatically through numbers. Need to adjust some colors? Just adjust some numbers. No need to bring a big image editing program into the picture. This makes maintaining the site easier, as well as opens up doors for adjusting values on-the-fly. I imagine JavaScript libraries will begin to get the ability to animate these values soon enough, which will be pretty darn cool.</p>
<h3>Ooooh Stretchy</h3>
<p>When using an image for a gradient, it is declared as a CSS background-image and then repeated (you can often get away with a 1px slice, which is very efficient, size wise). The result though is that a static portion of the background is gradientized, and any overflow to that is flat color. Sometimes that works perfectly. Sometimes though it would be cool if the gradient stretched the entire height or width of the box. That is another thing CSS3 gradients can possibly be useful for:</p>
<p><img src="http://envisioncad.com/wp-content/images/stretchy.jpg" width="570" height="250" alt="" /></p>
<h3>So the big question is&#8230;</h3>
<p><strong>Is it really worth doing right now?</strong> I&#8217;m thinking it&#8217;s pretty darn close. If the numeric representation is a big deal to you, then I say yes you should start using them. If the speed is the only reason you would, then just realize that the only browser that it will help in is Firefox 3.6+, so you might wanna wait a bit on that.</p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29506/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Digging Into WordPress, v2 Back in Print</title>
		<link>http://code95.com/blog/archives/29505</link>
		<comments>http://code95.com/blog/archives/29505#comments</comments>
		<pubDate>Wed, 03 Mar 2010 04:10:27 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29505</guid>
		<description><![CDATA[ We sold out of our first batch of Digging Into WordPress books in a matter of weeks. We could have just ordered more as soon as supplies were low, but it just so happened that right about that time WordPress 2.9 was out, which has many new features. We were already working on revising [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://digwp.com/book/"><img src="http://css-tricks.com/wp-content/csstricks-uploads/v2250promo.png" width="250" height="250" alt="" style="float: left; margin: 0 10px 2px 0;" /></a> We sold out of our first batch of Digging Into WordPress books in a matter of weeks. We could have just ordered more as soon as supplies were low, but it just so happened that right about that time WordPress 2.9 was out, which has many new features. We were already working on revising the book, so we figured instead of reprint books that were 2.8.6 based, we would wait to finish all the 2.9.2 stuff and reprint the book with all that. So that&#8217;s what we did!</p>
<p>Today, the print version of the book is <a href="http://digwp.com/book/">back for sale</a>.  The book features some revised content, and <strong>two new chapters</strong>! The all-new Chapter 10 is called &#8220;Bonus Tricks&#8221; where we detail out some cool things you can add to themes. In this chapter we also introduce the <strong>two brand new themes that now come included with the book!</strong> Chapter 11 is called &#8220;WordPress Updates&#8221;, where we include what is new in 2.9.2, how to use those new features, and where we will continue to expand when new versions come out.</p>
<p>If you have already bought the book, you should already have gotten an email with a download link for the new version, which also contains the new bundled themes.</p>
<p>Not only that, but the site is sporting a <a href="http://digwp.com/">fresh new design</a>!</p>
<p><span></span></p>
<h3>Bundled Themes</h3>
<p>The best way to illustrate and explain something is often just to give someone the finished product and let them explore it. There is lots of code in the book, but it&#8217;s all removed from the context of a real design. Now you&#8217;ll get some real themes along with the book so you can see how that code is used in an actual theme. The themes do a particularly good job illustrating two big topics:</p>
<ul>
<li><strong>Theme Options Panel</strong> &#8211; Both themes have options panels for setting various theme-specific options. They are built in a &#8220;framework&#8221; style, so that adding your own or adjusting what options are there is pretty easy.</li>
<li><strong>Child Themes</strong> &#8211; Both themes come with a child theme which restyles the theme without affecting any of how it works. If you&#8217;ve always wondered how that works, you can see it with these themes.</li>
</ul>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/bundledthemes.jpg" width="570" height="480" alt="" /></p>
<h4>Plastique</h4>
<p>See theme options shine here as there is <strong>a ton</strong> of options to control your theme. Everything from how it is laid out (columns, positions) to what types of things you wish to include, to adding in markup into individual sections. <a href="http://themeclubhouse.digwp.com/index.php?wptheme=Plastique">Preview Theme</a></p>
<h4>Lines &#38; Boxes</h4>
<p>Based on the look of a wireframe, Lines &#38; Boxes could be used as-is for a minimalist look, or used as a starting point for a more fleshed out graphical theme. Some theme options including overriding the header of the site, and options on if you want the main navigation to be a category list or a page list. <a href="http://themeclubhouse.digwp.com/index.php?wptheme=Lines%20and%20Boxes">Preview Theme</a></p>
<h4>All AJAX</h4>
<p>&#8220;All Ajax&#8221;, also a bundled theme, is based off Lines &#38; Boxes but is not technically a child theme. The idea is that every internal link on the site loads without page refresh. <a href="http://themeplayground.digwp.com/index.php?wptheme=All%20AJAX">Preview Theme</a></p>
<h3>Get it</h3>
<p>Even with all the new themes and 30+ new pages, the price point for the book and PDF stay the same. $27 for the PDF and $67 + S&#38;H for the Book/PDF Combo. If you buy the print book, remember that automatically comes with the PDF which now comes as a bundle with the themes, so you don&#8217;t miss out on that action.</p>
<p><strong>What happens if you bought the PDF while the book was sold out and now want the print copy?</strong> That would be anytime between January 18th and February 28th. If that describes your situation, just forward a copy of your receipt to sales@digwp.com and ask us for a discount code. We&#8217;ll send you one you can use on the print copy good for the value of what you paid for the PDF.</p>
<p><a href="http://digwp.com/book/">Go get it</a></p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29505/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CMS Expo, Chicago, May 3rd-5th</title>
		<link>http://code95.com/blog/archives/29473</link>
		<comments>http://code95.com/blog/archives/29473#comments</comments>
		<pubDate>Fri, 26 Feb 2010 13:32:37 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://code95.com/blog/archives/29473</guid>
		<description><![CDATA[I&#8217;ll be speaking at the CMS Expo this May 3rd &#8211; 5th (I speak the 4th and 5th). It&#8217;s in Evanston, IL, basically, Chicago.


I&#8217;ll be doing two sessions, one Tuesday, on Wednesday. One of them will be on advanced theme building. We&#8217;ll start with a mockup of a site we want to build (something modern [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll be speaking at the <a href="http://www.cmsassociation.com/52.html">CMS Expo</a> this May 3rd &#8211; 5th (I speak the 4th and 5th). It&#8217;s in Evanston, IL, basically, Chicago.</p>
<p><a href="http://www.cmsassociation.com/52.html"><img src="http://css-tricks.com/wp-content/Badge-CMSX-Spkr-300x200.jpg" width="300" height="200" alt="" /></a></p>
<p><span></span></p>
<p>I&#8217;ll be doing two sessions, one Tuesday, on Wednesday. One of them will be on advanced theme building. We&#8217;ll start with a mockup of a site we want to build (something modern and cool looking) and build it into a finished theme. The other will be &#8220;Tricking out WordPress&#8221;, where we will hop around some different techniques for doing cool things with WordPress. Probably stuff like advanced custom field usage, pulling in external content, and AJAX.</p>
<p>If you aren&#8217;t into the WordPress thing, remember this is a &#8220;CMS Expo&#8221; so WordPress isn&#8217;t the only kid on the block. There will be tracks for Drupal and Joomla as well, and all kinds of interesting stuff going on. For all three days it&#8217;s $779.00.  Pretty pricey, so if you need to start greasing up your boss, you better get started now. You can <a href="http://www.cmsassociation.com/52.html">register here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://code95.com/blog/archives/29473/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
