<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>CSS-Tricks</title>
	
	<link>http://css-tricks.com</link>
	<description>Tips, Tricks, and Techniques on using Cascading Style Sheets.</description>
	<lastBuildDate>Fri, 24 May 2013 13:07:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/CssTricks" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="csstricks" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">CssTricks</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Upping Your Type Game</title>
		<link>http://jessicahische.is/talkingtype</link>
		<comments>http://css-tricks.com/upping-your-type-game/#comments</comments>
		<pubDate>Fri, 24 May 2013 13:07:49 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Link]]></category>

		<guid isPermaLink="false">http://css-tricks.com/?p=21765</guid>
		<description><![CDATA[<p><p>The ultimate primer on web type for web developers by Jessica Hische.</p>
<p><a href="http://jessicahische.is/talkingtype" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://css-tricks.com/upping-your-type-game/">Permalink</a>&#8230;</p></p><p><hr>

<p><a href="http://events.jquery.org/2013/portland/"><img src="http://cdn.css-tricks.com/images/jquery-portland.jpg"></a></p>

<p><a href="http://events.jquery.org/2013/portland/">jQuery Conference Portland 2013</a> has a limited number of regular tickets still available. Two days. Two tracks. Fresh speakers. Jun 13-14. $50 off for members of the jQuery Foundation. <a href="https://jquery.org/join/">Join today</a> and get your first year of fan dues paid for with purchase of both a training and conference ticket. Training provided by Bocoup on Jun 12. Use coupon code <strong>CSSTricks25off</strong> for $25 off.</p>

<hr>

<p><small><a href="http://css-tricks.com/upping-your-type-game/">Upping Your Type Game</a> is a post from <a href="http://css-tricks.com">CSS-Tricks</a></small></p></p>]]></description>
				<content:encoded><![CDATA[<p>The ultimate primer on web type for web developers by Jessica Hische.</p>
<p><a href="http://jessicahische.is/talkingtype" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://css-tricks.com/upping-your-type-game/">Permalink</a></p><p><hr>

<p><a href="http://events.jquery.org/2013/portland/"><img src="http://cdn.css-tricks.com/images/jquery-portland.jpg"></a></p>

<p><a href="http://events.jquery.org/2013/portland/">jQuery Conference Portland 2013</a> has a limited number of regular tickets still available. Two days. Two tracks. Fresh speakers. Jun 13-14. $50 off for members of the jQuery Foundation. <a href="https://jquery.org/join/">Join today</a> and get your first year of fan dues paid for with purchase of both a training and conference ticket. Training provided by Bocoup on Jun 12. Use coupon code <strong>CSSTricks25off</strong> for $25 off.</p>

<hr>

<p><small><a href="http://css-tricks.com/upping-your-type-game/">Upping Your Type Game</a> is a post from <a href="http://css-tricks.com">CSS-Tricks</a></small></p></p>]]></content:encoded>
			<wfw:commentRss>http://css-tricks.com/upping-your-type-game/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Just One of Those Weird Things About CSS: Background on &lt;body&gt;</title>
		<link>http://css-tricks.com/just-one-of-those-weird-things-about-css-background-on-body/</link>
		<comments>http://css-tricks.com/just-one-of-those-weird-things-about-css-background-on-body/#comments</comments>
		<pubDate>Fri, 24 May 2013 12:58:21 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Article]]></category>

		<guid isPermaLink="false">http://css-tricks.com/?p=21745</guid>
		<description><![CDATA[<p><p>So you want to make the background of your website red eh? You'll probably put this in your CSS:</p>
<p></p>
<code class="language-css">body {
  background: red;
}</code>
<p>Done!</p>
<code></code><a href="http://codepen.io/chriscoyier/pen/Ioibf">Check out this Pen!</a>
<p>You're going about your business and then all the sudden one day this happens:</p>
<code></code><a href="http://codepen.io/chriscoyier/pen/AgGKa">Check out this Pen!</a>
<p>What in the heck? Why is the red cut off like that? I put red as the background color on the body?</p>
<p>You did, but the fact that that red color floods the &#8230;</p></p><p><hr>

<p><a href="http://events.jquery.org/2013/portland/"><img src="http://cdn.css-tricks.com/images/jquery-portland.jpg"></a></p>

<p><a href="http://events.jquery.org/2013/portland/">jQuery Conference Portland 2013</a> has a limited number of regular tickets still available. Two days. Two tracks. Fresh speakers. Jun 13-14. $50 off for members of the jQuery Foundation. <a href="https://jquery.org/join/">Join today</a> and get your first year of fan dues paid for with purchase of both a training and conference ticket. Training provided by Bocoup on Jun 12. Use coupon code <strong>CSSTricks25off</strong> for $25 off.</p>

<hr>

<p><small><a href="http://css-tricks.com/just-one-of-those-weird-things-about-css-background-on-body/">Just One of Those Weird Things About CSS: Background on &lt;body></a> is a post from <a href="http://css-tricks.com">CSS-Tricks</a></small></p></p>]]></description>
				<content:encoded><![CDATA[<p>So you want to make the background of your website red eh? You'll probably put this in your CSS:</p>
<p><span id="more-21745"></span></p>
<pre rel="CSS"><code class="language-css">body {
  background: red;
}</code></pre>
<p>Done!</p>
<pre class="codepen" data-height="200" data-type="result" data-href="Ioibf" data-user="chriscoyier" data-safe="true"><code></code><a href="http://codepen.io/chriscoyier/pen/Ioibf">Check out this Pen!</a></pre>
<p>You're going about your business and then all the sudden one day this happens:</p>
<pre class="codepen" data-height="200" data-type="result" data-href="AgGKa" data-user="chriscoyier" data-safe="true"><code></code><a href="http://codepen.io/chriscoyier/pen/AgGKa">Check out this Pen!</a></pre>
<p>What in the heck? Why is the red cut off like that? I put red as the background color on the body?</p>
<p>You did, but the fact that that red color floods the background is just a strange anomaly of CSS. The body element isn't actually as tall as the browser window. It's only as tall as the content inside it, just like a div or anything else.</p>
<p>See:</p>
<figure id='post-21751 media-21751' class='align-none'><img src='http://cdn.css-tricks.com/wp-content/uploads/2013/05/body-only-tall.png' alt='' /></figure>
<p><strong>In the absence of a background on the html element, the body background will cover the page. If there is a background on the html element, the body background behaves just like any other element.</strong></p>
<p>Somewhere along the line, a <code>background-color</code> got set on the <code>html</code> element.</p>
<p>Perhaps you're using <a href="http://necolas.github.io/normalize.css/">normalize.css</a> 2.1.1, which included setting the background to white on the html element to <em>"Prevent system color scheme's background color being used in Firefox, IE, and Opera."</em> This has since been reverted, presumably because it caused this issue too widely.</p>
<p>To "fix" it, just remove the background on the html element, or move whatever you want to "flood" always to the html element as its behavior is consistant. </p>
<p><hr>

<p><a href="http://events.jquery.org/2013/portland/"><img src="http://cdn.css-tricks.com/images/jquery-portland.jpg"></a></p>

<p><a href="http://events.jquery.org/2013/portland/">jQuery Conference Portland 2013</a> has a limited number of regular tickets still available. Two days. Two tracks. Fresh speakers. Jun 13-14. $50 off for members of the jQuery Foundation. <a href="https://jquery.org/join/">Join today</a> and get your first year of fan dues paid for with purchase of both a training and conference ticket. Training provided by Bocoup on Jun 12. Use coupon code <strong>CSSTricks25off</strong> for $25 off.</p>

<hr>

<p><small><a href="http://css-tricks.com/just-one-of-those-weird-things-about-css-background-on-body/">Just One of Those Weird Things About CSS: Background on &lt;body></a> is a post from <a href="http://css-tricks.com">CSS-Tricks</a></small></p></p>]]></content:encoded>
			<wfw:commentRss>http://css-tricks.com/just-one-of-those-weird-things-about-css-background-on-body/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>This Website Brought To You By…</title>
		<link>http://www.kk.org/thetechnium/archives/2007/03/bootstrapping_t.php</link>
		<comments>http://css-tricks.com/this-website-brought-to-you-by/#comments</comments>
		<pubDate>Fri, 24 May 2013 12:56:58 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Link]]></category>

		<guid isPermaLink="false">http://css-tricks.com/?p=21761</guid>
		<description><![CDATA[<p><p>I always wanted to write something on all the technologies that a website relies on in order to have been created and work. My attempts have so far failed because it spirals out of control so quickly. Kevin Kelly sums it up:</p>
<p>A web page relies on perhaps a hundred thousand other inventions, all needed for its birth and continued existence. There is no web page anywhere without the inventions of HTML code, without computer programming, without LEDs or cathode &#8230;</p></p><p><hr>

<p><a href="http://events.jquery.org/2013/portland/"><img src="http://cdn.css-tricks.com/images/jquery-portland.jpg"></a></p>

<p><a href="http://events.jquery.org/2013/portland/">jQuery Conference Portland 2013</a> has a limited number of regular tickets still available. Two days. Two tracks. Fresh speakers. Jun 13-14. $50 off for members of the jQuery Foundation. <a href="https://jquery.org/join/">Join today</a> and get your first year of fan dues paid for with purchase of both a training and conference ticket. Training provided by Bocoup on Jun 12. Use coupon code <strong>CSSTricks25off</strong> for $25 off.</p>

<hr>

<p><small><a href="http://css-tricks.com/this-website-brought-to-you-by/">This Website Brought To You By&#8230;</a> is a post from <a href="http://css-tricks.com">CSS-Tricks</a></small></p></p>]]></description>
				<content:encoded><![CDATA[<p>I always wanted to write something on all the technologies that a website relies on in order to have been created and work. My attempts have so far failed because it spirals out of control so quickly. Kevin Kelly sums it up:</p>
<blockquote><p>A web page relies on perhaps a hundred thousand other inventions, all needed for its birth and continued existence. There is no web page anywhere without the inventions of HTML code, without computer programming, without LEDs or cathode ray tubes, without solid state computer chips, without telephone lines, without long-distance signal repeaters, without electrical generators, without high-speed turbines, without stainless steel, iron smelters, and control of fire. None of these concrete inventions would exist without the elemental inventions of writing, of an alphabet, of hypertext links, of indexes, catalogs, archives, libraries and the scientific method itself. To recapitulate a web page you have to re-create all these other functions. You might as well remake modern society.</p></blockquote>
<p>The article isn't about the web hardly at all, it's about the interconnectivity of tools and how far we'll be set back if that is disrupted. I enjoyed the term "upcreation tool." So many of the tools we use as web workers are tools in which to make more complex tools.</p>
<p><a href="http://www.kk.org/thetechnium/archives/2007/03/bootstrapping_t.php" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://css-tricks.com/this-website-brought-to-you-by/">Permalink</a></p><p><hr>

<p><a href="http://events.jquery.org/2013/portland/"><img src="http://cdn.css-tricks.com/images/jquery-portland.jpg"></a></p>

<p><a href="http://events.jquery.org/2013/portland/">jQuery Conference Portland 2013</a> has a limited number of regular tickets still available. Two days. Two tracks. Fresh speakers. Jun 13-14. $50 off for members of the jQuery Foundation. <a href="https://jquery.org/join/">Join today</a> and get your first year of fan dues paid for with purchase of both a training and conference ticket. Training provided by Bocoup on Jun 12. Use coupon code <strong>CSSTricks25off</strong> for $25 off.</p>

<hr>

<p><small><a href="http://css-tricks.com/this-website-brought-to-you-by/">This Website Brought To You By&#8230;</a> is a post from <a href="http://css-tricks.com">CSS-Tricks</a></small></p></p>]]></content:encoded>
			<wfw:commentRss>http://css-tricks.com/this-website-brought-to-you-by/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logic in Media Queries</title>
		<link>http://css-tricks.com/logic-in-media-queries/</link>
		<comments>http://css-tricks.com/logic-in-media-queries/#comments</comments>
		<pubDate>Wed, 22 May 2013 19:06:15 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Article]]></category>

		<guid isPermaLink="false">http://css-tricks.com/?p=21729</guid>
		<description><![CDATA[<p><p>Just in case you have brain farts about this constantly like I do.</p>
<p></p>
If
<p>That's what media queries are: logical <code>if</code> statements. "If" these things are true about the browser, use the CSS inside.</p>
And
<p>The keyword <code>and</code>.</p>
<code class="language-css">@media (min-width: 600px) and (max-width: 800px) {
  html { background: red; }
}</code>
Or
<p>Comma separate.</p>
<code class="language-css">@media (max-width: 600px), (min-width: 800px) {
  html { background: red; }
}</code>
<p>Technically these are treated like to separate media queries, but that is effectively &#8230;</p></p><p><hr>

<p><a href="http://events.jquery.org/2013/portland/"><img src="http://cdn.css-tricks.com/images/jquery-portland.jpg"></a></p>

<p><a href="http://events.jquery.org/2013/portland/">jQuery Conference Portland 2013</a> has a limited number of regular tickets still available. Two days. Two tracks. Fresh speakers. Jun 13-14. $50 off for members of the jQuery Foundation. <a href="https://jquery.org/join/">Join today</a> and get your first year of fan dues paid for with purchase of both a training and conference ticket. Training provided by Bocoup on Jun 12. Use coupon code <strong>CSSTricks25off</strong> for $25 off.</p>

<hr>

<p><small><a href="http://css-tricks.com/logic-in-media-queries/">Logic in Media Queries</a> is a post from <a href="http://css-tricks.com">CSS-Tricks</a></small></p></p>]]></description>
				<content:encoded><![CDATA[<p>Just in case you have brain farts about this constantly like I do.</p>
<p><span id="more-21729"></span></p>
<h3>If</h3>
<p>That's what media queries are: logical <code>if</code> statements. "If" these things are true about the browser, use the CSS inside.</p>
<h3>And</h3>
<p>The keyword <code>and</code>.</p>
<pre rel="CSS"><code class="language-css">@media (min-width: 600px) and (max-width: 800px) {
  html { background: red; }
}</code></pre>
<h3>Or</h3>
<p>Comma separate.</p>
<pre rel="CSS"><code class="language-css">@media (max-width: 600px), (min-width: 800px) {
  html { background: red; }
}</code></pre>
<p>Technically these are treated like to separate media queries, but that is effectively and <code>or</code>.</p>
<h3>Not</h3>
<p>Reverse the logic with the keyword <code>not</code>.</p>
<pre rel="CSS"><code class="language-css">@media not all and (max-width: 600px) {
  html { background: red; }
}</code></pre>
<p>Just doing <code>not (max-width: 600px)</code> doesn't seem to work for me, hence the slightly funky syntax above. Perhaps someone can explain that to me. Note that not only works for the current media query, so if you comma separate, it only affects the media query it is within. Also note that not reverses the logic for the entire media query as a whole, not individual parts of it. not x and y = not (x and y) ≠ (not x) and y</p>
<h3>Exclusive</h3>
<p>To ensure that only one media query is in effect at time, make the numbers (or whatever) such that that is possible. It may be easier to mentally manage them this way.</p>
<pre rel="CSS"><code class="language-css">@media (max-width: 400px) {
  html { background: red; }
}
@media (min-width: 401px) and (max-width: 800px) {
  html { background: green; }
}
@media (min-width: 801px) {
  html { background: blue; }
}</code></pre>
<p>Logically this is a bit like a <code>switch</code> statement, only without a simple way to do "if none of these match do this" like <code>default</code>.</p>
<h3>Overriding</h3>
<p>There is nothing preventing more than one media query from being true at the same time. It may be more efficient to use this in some cases rather than making them all exclusive.</p>
<pre rel="CSS"><code class="language-css">@media (min-width: 400px) {
  html { background: red; }
}
@media (min-width: 600px) {
  html { background: green; }
}
@media (min-width: 800px) {
  html { background: blue; }
}</code></pre>
<p>Media queries add no specificity to the selectors they contain, but source order still matters. The above will work because they are ordered correctly. Swap that order and at browser window widths above 800px the background would be red, perhaps unintuitively.</p>
<h3>Mobile First</h3>
<p>Your small screen styles are in your regular screen CSS and then as the screen gets larger you override what you need to. So, <code>min-width</code> media queries in general.</p>
<pre rel="CSS"><code class="language-css">html { background: red; }

@media (min-width: 600px) {
  html { background: green; }
}</code></pre>
<h3>Desktop First</h3>
<p>Your large screen styles are in your regular screen CSS and then as the screen gets smaller you override what you need to. So, <code>max-width</code> media queries in general.</p>
<pre rel="CSS"><code class="language-css">html { background: red; }

@media (max-width: 600px) {
  html { background: green; }
}</code></pre>
<h3>Gettin Wacky</h3>
<p>You can be as complex as you want with this.</p>
<pre rel="CSS"><code class="language-css">@media 
  only screen and (min-width: 100px),
  not all and (min-width: 100px),
  not print and (min-height: 100px),
  (color),
  (min-height: 100px) and (max-height: 1000px),
  handheld and (orientation: landscape)
{
  html { background: red; }
}</code></pre>
<p>Note the <code>only</code> keyword was intended to prevent non-media-query supporting browsers to not load the stylesheet or use the styles. Not sure how useful that ever was / still is.</p>
<p><hr>

<p><a href="http://events.jquery.org/2013/portland/"><img src="http://cdn.css-tricks.com/images/jquery-portland.jpg"></a></p>

<p><a href="http://events.jquery.org/2013/portland/">jQuery Conference Portland 2013</a> has a limited number of regular tickets still available. Two days. Two tracks. Fresh speakers. Jun 13-14. $50 off for members of the jQuery Foundation. <a href="https://jquery.org/join/">Join today</a> and get your first year of fan dues paid for with purchase of both a training and conference ticket. Training provided by Bocoup on Jun 12. Use coupon code <strong>CSSTricks25off</strong> for $25 off.</p>

<hr>

<p><small><a href="http://css-tricks.com/logic-in-media-queries/">Logic in Media Queries</a> is a post from <a href="http://css-tricks.com">CSS-Tricks</a></small></p></p>]]></content:encoded>
			<wfw:commentRss>http://css-tricks.com/logic-in-media-queries/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>CSS-Tricks Chronicle XIII</title>
		<link>http://css-tricks.com/css-tricks-chronicle-xiii/</link>
		<comments>http://css-tricks.com/css-tricks-chronicle-xiii/#comments</comments>
		<pubDate>Tue, 21 May 2013 21:24:29 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Article]]></category>

		<guid isPermaLink="false">http://css-tricks.com/?p=21717</guid>
		<description><![CDATA[<p>> go east
> You see a beautiful grassy field.
> set up camper
> You camper is now set up [roundtime: 18 seconds]
> sit down</p><p><hr>

<p><a href="http://events.jquery.org/2013/portland/"><img src="http://cdn.css-tricks.com/images/jquery-portland.jpg"></a></p>

<p><a href="http://events.jquery.org/2013/portland/">jQuery Conference Portland 2013</a> has a limited number of regular tickets still available. Two days. Two tracks. Fresh speakers. Jun 13-14. $50 off for members of the jQuery Foundation. <a href="https://jquery.org/join/">Join today</a> and get your first year of fan dues paid for with purchase of both a training and conference ticket. Training provided by Bocoup on Jun 12. Use coupon code <strong>CSSTricks25off</strong> for $25 off.</p>

<hr>

<p><small><a href="http://css-tricks.com/css-tricks-chronicle-xiii/">CSS-Tricks Chronicle XIII</a> is a post from <a href="http://css-tricks.com">CSS-Tricks</a></small></p></p>]]></description>
				<content:encoded><![CDATA[<p>I'll be speaking at the upcoming Front End Design Conference in Florida. If you have tickets, see you there! If not, sorry, this one is sold out.</p>
<p>I recently spoke at TXJS, and they recorded the talks, so mine and a bunch of others are available <a href="https://vimeo.com/channels/txjs2013">on their Vimeo channel</a>.</p>
<hr />
<p>Next week I head out for <a href="http://www.gravesmountain.com/events-calendar/festival-of-music/">Graves Mountain</a>, as I do every year. So this week I'm planning for that, both getting ready for it as well as getting ready to be unplugged for the week.</p>
<hr />
<p><a href="http://shoptalkshow.com/">ShopTalk</a> is going strong! We have lots of great guests lined up. We've recorded a show in advance to air while I'm away at Graves. I'm sure we'll have a show every week for a very long time to come. </p>
<p>Recent shows include <a href="http://shoptalkshow.com/episodes/056-with-ben-frain/">Ben Frain</a>, <a href="http://shoptalkshow.com/episodes/067-with-pam-selle/">Pam Selle</a>, and <a href="http://shoptalkshow.com/episodes/068-with-ben-schwarz/">Ben Schwarz</a>.</p>
<hr />
<p>CodePen is going strong as well. The team has made the huge leap of <a href="http://blog.codepen.io/2013/05/06/codepen-full-time/">taking it full time</a>. It's been a touch slow, but it's because both Tim and I moved across the country (me to Milwaukee, WI) and we've been settling in a bit. We're also working on big new features. There will be little new stuff coming here and there, but a lot of time has been sunk into big stuff that'll take a bit to get out.</p>
<p>The Patten Rodeo is back as well, in <a href="http://blog.codepen.io/rodeo/season-two/">Season Two</a>.</p>
<p>There are also CodePen PENS now, as well as stickers, and get get both if you <a href="http://blog.codepen.io/store/">order a T-Shirt</a>.</p>
<hr />
<p>Kern and Burn have a book called <a href="http://www.kernandburnbook.com/">Conversations With Design Entrepreneurs</a> and there is a bit of an interview with me in there. I got the book and it is super nice. One of the nicest feeling and reading books I have.</p>
<hr />
<p>I have a few new articles on The Pastry Box Project. One is a story of a person <a href="http://the-pastry-box-project.net/chris-coyier/2013-may-3/">opening a mustard packet</a> and... well just take of that one what you will. The other is the only bit of <a href="http://the-pastry-box-project.net/chris-coyier/2013-may-18/">life advice</a> I have to offer.</p>
<hr />
<p>I have some ideas burning for new stuff for <a href="http://css-tricks.com/lodge/">The Lodge</a> so I'll be launching into that the next few months. Nothing to share yet, but I'll let you know. I also have a nice list cooking for CSS-Tricks v11. It probably won't be a huge redesign, but more re-align-y focusing on enhanced functionality.</p>
<p><hr>

<p><a href="http://events.jquery.org/2013/portland/"><img src="http://cdn.css-tricks.com/images/jquery-portland.jpg"></a></p>

<p><a href="http://events.jquery.org/2013/portland/">jQuery Conference Portland 2013</a> has a limited number of regular tickets still available. Two days. Two tracks. Fresh speakers. Jun 13-14. $50 off for members of the jQuery Foundation. <a href="https://jquery.org/join/">Join today</a> and get your first year of fan dues paid for with purchase of both a training and conference ticket. Training provided by Bocoup on Jun 12. Use coupon code <strong>CSSTricks25off</strong> for $25 off.</p>

<hr>

<p><small><a href="http://css-tricks.com/css-tricks-chronicle-xiii/">CSS-Tricks Chronicle XIII</a> is a post from <a href="http://css-tricks.com">CSS-Tricks</a></small></p></p>]]></content:encoded>
			<wfw:commentRss>http://css-tricks.com/css-tricks-chronicle-xiii/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Prepros</title>
		<link>http://alphapixels.com/prepros/</link>
		<comments>http://css-tricks.com/prepros/#comments</comments>
		<pubDate>Mon, 20 May 2013 14:14:03 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Link]]></category>

		<guid isPermaLink="false">http://css-tricks.com/?p=21695</guid>
		<description><![CDATA[<p><p>Is an open-source app modeled after <a href="http://incident57.com/codekit/">CodeKit</a>. Prepros runs on Windows where CodeKit is Mac only. From people who have <a href="http://shoogledesigns.com/blog/blog/2013/05/18/codekit-for-windows-prepros/">tried it</a>, it seems good.</p>
<p><a href="http://alphapixels.com/prepros/" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://css-tricks.com/prepros/">Permalink</a>&#8230;</p></p><p><hr>

<p><a href="http://events.jquery.org/2013/portland/"><img src="http://cdn.css-tricks.com/images/jquery-portland.jpg"></a></p>

<p><a href="http://events.jquery.org/2013/portland/">jQuery Conference Portland 2013</a> has a limited number of regular tickets still available. Two days. Two tracks. Fresh speakers. Jun 13-14. $50 off for members of the jQuery Foundation. <a href="https://jquery.org/join/">Join today</a> and get your first year of fan dues paid for with purchase of both a training and conference ticket. Training provided by Bocoup on Jun 12. Use coupon code <strong>CSSTricks25off</strong> for $25 off.</p>

<hr>

<p><small><a href="http://css-tricks.com/prepros/">Prepros</a> is a post from <a href="http://css-tricks.com">CSS-Tricks</a></small></p></p>]]></description>
				<content:encoded><![CDATA[<p>Is an open-source app modeled after <a href="http://incident57.com/codekit/">CodeKit</a>. Prepros runs on Windows where CodeKit is Mac only. From people who have <a href="http://shoogledesigns.com/blog/blog/2013/05/18/codekit-for-windows-prepros/">tried it</a>, it seems good.</p>
<p><a href="http://alphapixels.com/prepros/" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://css-tricks.com/prepros/">Permalink</a></p><p><hr>

<p><a href="http://events.jquery.org/2013/portland/"><img src="http://cdn.css-tricks.com/images/jquery-portland.jpg"></a></p>

<p><a href="http://events.jquery.org/2013/portland/">jQuery Conference Portland 2013</a> has a limited number of regular tickets still available. Two days. Two tracks. Fresh speakers. Jun 13-14. $50 off for members of the jQuery Foundation. <a href="https://jquery.org/join/">Join today</a> and get your first year of fan dues paid for with purchase of both a training and conference ticket. Training provided by Bocoup on Jun 12. Use coupon code <strong>CSSTricks25off</strong> for $25 off.</p>

<hr>

<p><small><a href="http://css-tricks.com/prepros/">Prepros</a> is a post from <a href="http://css-tricks.com">CSS-Tricks</a></small></p></p>]]></content:encoded>
			<wfw:commentRss>http://css-tricks.com/prepros/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chrome’s requestAutocomplete()</title>
		<link>http://blog.alexmaccaw.com/requestautocomplete</link>
		<comments>http://css-tricks.com/chromes-requestautocomplete/#comments</comments>
		<pubDate>Mon, 20 May 2013 14:09:55 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Link]]></category>

		<guid isPermaLink="false">http://css-tricks.com/?p=21693</guid>
		<description><![CDATA[<p><p>Auto-filling forms is nice because it saves time and is less prone to user error. Even better is not even needing to see a form in the first place.</p>
<p><a href="http://blog.alexmaccaw.com/requestautocomplete" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://css-tricks.com/chromes-requestautocomplete/">Permalink</a>&#8230;</p></p><p><hr>

<p><a href="http://events.jquery.org/2013/portland/"><img src="http://cdn.css-tricks.com/images/jquery-portland.jpg"></a></p>

<p><a href="http://events.jquery.org/2013/portland/">jQuery Conference Portland 2013</a> has a limited number of regular tickets still available. Two days. Two tracks. Fresh speakers. Jun 13-14. $50 off for members of the jQuery Foundation. <a href="https://jquery.org/join/">Join today</a> and get your first year of fan dues paid for with purchase of both a training and conference ticket. Training provided by Bocoup on Jun 12. Use coupon code <strong>CSSTricks25off</strong> for $25 off.</p>

<hr>

<p><small><a href="http://css-tricks.com/chromes-requestautocomplete/">Chrome’s requestAutocomplete()</a> is a post from <a href="http://css-tricks.com">CSS-Tricks</a></small></p></p>]]></description>
				<content:encoded><![CDATA[<p>Auto-filling forms is nice because it saves time and is less prone to user error. Even better is not even needing to see a form in the first place.</p>
<p><a href="http://blog.alexmaccaw.com/requestautocomplete" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://css-tricks.com/chromes-requestautocomplete/">Permalink</a></p><p><hr>

<p><a href="http://events.jquery.org/2013/portland/"><img src="http://cdn.css-tricks.com/images/jquery-portland.jpg"></a></p>

<p><a href="http://events.jquery.org/2013/portland/">jQuery Conference Portland 2013</a> has a limited number of regular tickets still available. Two days. Two tracks. Fresh speakers. Jun 13-14. $50 off for members of the jQuery Foundation. <a href="https://jquery.org/join/">Join today</a> and get your first year of fan dues paid for with purchase of both a training and conference ticket. Training provided by Bocoup on Jun 12. Use coupon code <strong>CSSTricks25off</strong> for $25 off.</p>

<hr>

<p><small><a href="http://css-tricks.com/chromes-requestautocomplete/">Chrome’s requestAutocomplete()</a> is a post from <a href="http://css-tricks.com">CSS-Tricks</a></small></p></p>]]></content:encoded>
			<wfw:commentRss>http://css-tricks.com/chromes-requestautocomplete/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Replace the Image in an &lt;img&gt; with CSS</title>
		<link>http://css-tricks.com/replace-the-image-in-an-img-with-css/</link>
		<comments>http://css-tricks.com/replace-the-image-in-an-img-with-css/#comments</comments>
		<pubDate>Mon, 20 May 2013 12:43:13 +0000</pubDate>
		<dc:creator>Guest Author</dc:creator>
				<category><![CDATA[Article]]></category>

		<guid isPermaLink="false">http://css-tricks.com/?p=21673</guid>
		<description><![CDATA[<p><p><em class="explanation">The following is a guest post by <a href="https://twitter.com/marcelshields">Marcel Shields</a>. Marcel in a difficult place where he needed to change the image on a page but didn't have access to the HTML. Rare, but I'm sure we've all be in weird situations like this. He explains how he managed to replace that image without needing to access the HTML or JavaScript. Also turns out to be a pretty good way to replace <strong>anything</strong> with an image.</em></p>
<p></p>
<p>I just wanted to &#8230;</p></p><p><hr>

<p><a href="http://events.jquery.org/2013/portland/"><img src="http://cdn.css-tricks.com/images/jquery-portland.jpg"></a></p>

<p><a href="http://events.jquery.org/2013/portland/">jQuery Conference Portland 2013</a> has a limited number of regular tickets still available. Two days. Two tracks. Fresh speakers. Jun 13-14. $50 off for members of the jQuery Foundation. <a href="https://jquery.org/join/">Join today</a> and get your first year of fan dues paid for with purchase of both a training and conference ticket. Training provided by Bocoup on Jun 12. Use coupon code <strong>CSSTricks25off</strong> for $25 off.</p>

<hr>

<p><small><a href="http://css-tricks.com/replace-the-image-in-an-img-with-css/">Replace the Image in an &lt;img> with CSS</a> is a post from <a href="http://css-tricks.com">CSS-Tricks</a></small></p></p>]]></description>
				<content:encoded><![CDATA[<p><em class="explanation">The following is a guest post by <a href="https://twitter.com/marcelshields">Marcel Shields</a>. Marcel in a difficult place where he needed to change the image on a page but didn't have access to the HTML. Rare, but I'm sure we've all be in weird situations like this. He explains how he managed to replace that image without needing to access the HTML or JavaScript. Also turns out to be a pretty good way to replace <strong>anything</strong> with an image.</em></p>
<p><span id="more-21673"></span></p>
<p>I just wanted to share something I found really cool about using CSS <a href="http://css-tricks.com/almanac/properties/b/box-sizing/">box-sizing</a>. Chris wrote a <a href="http://css-tricks.com/box-sizing/">really good introduction</a> a few years back if you're not familiar with the property. It makes things a lot more sane when thinking about layout. People love it so much, they <a href="http://paulirish.com/2012/box-sizing-border-box-ftw/">put it on everything</a> like hot sauce. I wanted to share how I found it useful as (yet) another image replacement technique.</p>
<p>A few days ago at work, I was asked to replace an <code>&lt;img&gt;</code> on our site with another image hosted elsewhere. Simple right? But the catch was I would not be able to replace the markup as it was already deployed to production, but could inject CSS or JS through our CMS. For whichever technology I chose, it would be inserted on all site pages. I only needed on one specific page, and the attributes of parent containers were non-specific to the desired page.</p>
<pre rel="HTML"><code class="language-markup">&lt;head&gt;
  &lt;title&gt;Really Cool Page&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;!-- .header would be across site on other pages with different children, so no background image adding --&gt;
  &lt;div class="header"&gt;
    &lt;img class="banner" src="http://notrealdomain1.com/banner.png"&gt;
  &lt;/div&gt;
&lt;/body&gt;</code></pre>
<p>This is simple to do with JavaScript, but I wanted to see if there was another, even simpler, way. After a few iterations in Chrome Dev Tools, I thought to use the <code>box-sizing</code> property to keep dimensions strict, add the new image as a background image, and just push the inline image out of the way with padding and see what happened.</p>
<pre rel="CSS"><code class="language-css">/* All in one selector */
.banner {
  display: block;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  background: url(http://notrealdomain2.com/newbanner.png) no-repeat;
  width: 180px; /* Width of new image */
  height: 236px; /* Height of new image */
  padding-left: 180px; /* Equal to width of new image */
}</code></pre>
<p>It worked beautifully. Here's what's cool:</p>
<ul>
<li>It works on just about any element, even empty ones like <code>&lt;img&gt;</code> or <code>&lt;hr&gt;</code></li>
<li>Browser support is excellent (Chrome, Firefox, Opera, Safari, IE8+) <a href="http://caniuse.com/#feat=css3-boxsizing">http://caniuse.com/#feat=css3-boxsizing</a></li>
<li>Refrains from using SEO unfriendly <code>display: none</code> or other properties</li>
</ul>
<p>That last point seemed important, as it works really well for text replacement too without any adjustment. Check it out!</p>
<pre class="codepen" data-height="300" data-type="result" data-href="cJEjs" data-user="chriscoyier" data-safe="true"><code></code><a href="http://codepen.io/chriscoyier/pen/cJEjs">Check out this Pen!</a></pre>
<p><hr>

<p><a href="http://events.jquery.org/2013/portland/"><img src="http://cdn.css-tricks.com/images/jquery-portland.jpg"></a></p>

<p><a href="http://events.jquery.org/2013/portland/">jQuery Conference Portland 2013</a> has a limited number of regular tickets still available. Two days. Two tracks. Fresh speakers. Jun 13-14. $50 off for members of the jQuery Foundation. <a href="https://jquery.org/join/">Join today</a> and get your first year of fan dues paid for with purchase of both a training and conference ticket. Training provided by Bocoup on Jun 12. Use coupon code <strong>CSSTricks25off</strong> for $25 off.</p>

<hr>

<p><small><a href="http://css-tricks.com/replace-the-image-in-an-img-with-css/">Replace the Image in an &lt;img> with CSS</a> is a post from <a href="http://css-tricks.com">CSS-Tricks</a></small></p></p>]]></content:encoded>
			<wfw:commentRss>http://css-tricks.com/replace-the-image-in-an-img-with-css/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>Slider with Sliding Backgrounds</title>
		<link>http://css-tricks.com/slider-with-sliding-backgrounds/</link>
		<comments>http://css-tricks.com/slider-with-sliding-backgrounds/#comments</comments>
		<pubDate>Fri, 17 May 2013 15:14:52 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Article]]></category>

		<guid isPermaLink="false">http://css-tricks.com/?p=21656</guid>
		<description><![CDATA[<p><p>Among the many super nice design features of the <a href="https://itunes.apple.com/us/app/yahoo!-weather/id628677149?mt=8">Yahoo! Weather app for iOS</a> is the transition between city screens. The background image doesn't just move away as the screen moves from one screen to the next, the background image itself slides. It appears to be hiding some of the "old" screen and revealing more of the "new" screen those closer you have it to being in full view. </p>
<p>Let's try and pull it off on the web.</p>
<p>&#8230;</p>
The HTML</p><p><hr>

<p><a href="http://events.jquery.org/2013/portland/"><img src="http://cdn.css-tricks.com/images/jquery-portland.jpg"></a></p>

<p><a href="http://events.jquery.org/2013/portland/">jQuery Conference Portland 2013</a> has a limited number of regular tickets still available. Two days. Two tracks. Fresh speakers. Jun 13-14. $50 off for members of the jQuery Foundation. <a href="https://jquery.org/join/">Join today</a> and get your first year of fan dues paid for with purchase of both a training and conference ticket. Training provided by Bocoup on Jun 12. Use coupon code <strong>CSSTricks25off</strong> for $25 off.</p>

<hr>

<p><small><a href="http://css-tricks.com/slider-with-sliding-backgrounds/">Slider with Sliding Backgrounds</a> is a post from <a href="http://css-tricks.com">CSS-Tricks</a></small></p></p>]]></description>
				<content:encoded><![CDATA[<p>Among the many super nice design features of the <a href="https://itunes.apple.com/us/app/yahoo!-weather/id628677149?mt=8">Yahoo! Weather app for iOS</a> is the transition between city screens. The background image doesn't just move away as the screen moves from one screen to the next, the background image itself slides. It appears to be hiding some of the "old" screen and revealing more of the "new" screen those closer you have it to being in full view. </p>
<p>Let's try and pull it off on the web.</p>
<p><span id="more-21656"></span></p>
<h3>The HTML</h3>
<p>Like any slider, there are three main components:</p>
<ul>
<li>The container that holds everything into shape</li>
<li>A sliding container that is as wide as all the slides in a row</li>
<li>Each individual side container</li>
</ul>
<p>We won't bother too much with content inside the slide. I'll just add the temperature to show each slide can indeed hold content on top.</p>
<pre rel="HTML"><code class="language-markup">&lt;div class="slider" id="slider"&gt;
  &lt;div class="holder"&gt;
    &lt;div class="slide" id="slide-0"&gt;&lt;span class="temp"&gt;74°&lt;/span&gt;&lt;/div&gt;
    &lt;div class="slide" id="slide-1"&gt;&lt;span class="temp"&gt;64°&lt;/span&gt;&lt;/div&gt;
    &lt;div class="slide" id="slide-2"&gt;&lt;span class="temp"&gt;82°&lt;/span&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;</code></pre>
<p>The container might be a <code>&lt;section&gt;</code>, slides might be <code>&lt;article&gt;</code>. It really depends. I'll let you make the semantic choices for your own needs.</p>
<p>The layout plan is like this:</p>
<figure id='post-21657 media-21657' class='align-none'><img src='http://cdn.css-tricks.com/wp-content/uploads/2013/05/layout.png' alt='' /></figure>
<h3>The CSS</h3>
<p>The "slider" (visual container) and the slides need to have explicity the same size. We'll use pixels here but you could make it work with anything.</p>
<pre rel="CSS"><code class="language-css">.slider {
  width: 300px;
  height: 500px;
  overflow-x: scroll;
}
.slide {
  float: left;
  width: 300px;
  height: 500px;
}</code></pre>
<p>Floating those slides to the left isn't going to make them line up in a row, because the parent element of the slides isn't wide enough to let them do that. That's one of the reasons we need the holder element. It will be 300% wide (Num. of slides × 100%) which will fit three slides exactly.</p>
<pre rel="CSS"><code class="language-css">.holder {
  width: 300%;
}</code></pre>
<p>Each one of our slides has a unique ID. This is useful because, if we choose, we can create anchor links that link to those ID's and the slider will "jump" to those slides. We'll add JavaScript to do some actual "sliding", but our slider will work even without that. ID's make that possible, so let's use them here to drop in some lovely background images.</p>
<pre rel="CSS"><code class="language-css">#slide-0 {
  background-image: url(http://farm8.staticflickr.com/7347/8731666710_34d07e709e_z.jpg);
}
#slide-1 {
  background-image: url(http://farm8.staticflickr.com/7384/8730654121_05bca33388_z.jpg);
}
#slide-2 {
  background-image: url(http://farm8.staticflickr.com/7382/8732044638_9337082fc6_z.jpg);
}</code></pre>
<p>With all this in place, our layout comes into shape:</p>
<figure id='post-21658 media-21658' class='align-none'><img src='http://cdn.css-tricks.com/wp-content/uploads/2013/05/css-layout.jpg' alt='' /></figure>
<p>The CSS (black fading)</p>
<p>Just as a small detail, the temperature set in white may be in danger of not being visible depending on the photo behind it. To ensure that it is, we can make the photo subtly fade to black toward the bottom. A pseudo element will do nicely.</p>
<pre rel="CSS"><code class="language-css">.slide:before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: linear-gradient(transparent, black);
}</code></pre>
<p>A picture explanation is in order here:</p>
<figure id='post-21663 media-21663' class='align-none'><img src='http://cdn.css-tricks.com/wp-content/uploads/2013/05/white-text.jpg' alt='' /></figure>
<h3>The JavaScript (background sliding)</h3>
<p>We're going to use jQuery here because we love life. Our goal is the adjust the background-position of the slides as we scroll. We can set background-position in percentages in CSS, but that alone doesn't do the cool hide/reveal more effect we're looking for. Based the amount scrolled (which we can measure in JavaScript), we'll adjust the background-position. Alone, that would look something like this:</p>
<pre rel="jQuery"><code class="language-javascript">$("#slider").on("scroll", function() {
  $(".slides").css({
    "background-position": $(this).scrollLeft()/6-100+ "px 0"
  });  
});</code></pre>
<p>The "6" and "-100" in there are magic numbers. Not <a href="http://css-tricks.com/magic-numbers-in-css/">CSS magic numbers</a> that are prone to frailty, but traditional magic numbers. Just some numbers that happen to make the effect work. A bummer, perhaps, but not that big of a deal. Design-y things are sometimes like that. Perhaps best to leave a comment in the code to that effect. These particular numbers are based on the images I used and their size and what looked good.</p>
<p>The effect here is the background shifting we're after:</p>
<figure id='post-21662 media-21662' class='align-none'><img src='http://cdn.css-tricks.com/wp-content/uploads/2013/05/slideeffect.jpg' alt='' /></p>
<figcaption>Notice the less of the yellow streetcar is visible when the slide is almost out of view.</figcaption>
</figure>
<h3>The JavaScript (imparting structure)</h3>
<p>That little snippet of JavaScript looks lonely up there without any structure behind it. A slider is a great excuse to look at a simple way to structure JavaScript.</p>
<p>We can make everything slider-related one object.</p>
<pre rel="JavaScript"><code class="language-javascript">var slider = {

};</code></pre>
<p>Then we'll group up the related elements into one area, bind our events together, and write little functions that do very specific things.</p>
<pre rel="jQuery"><code class="language-javascript">var slider = {
  
  el: {
    slider: $("#slider"),
    allSlides: $(".slide")
  },
 
  init: function() {
    // manual scrolling
    this.el.slider.on("scroll", function(event) {
      slider.moveSlidePosition(event);
    });
  },
  
  moveSlidePosition: function(event) {
    // Magic Numbers
    this.el.allSlides.css({
      "background-position": $(event.target).scrollLeft()/6-100+ "px 0"
    });  
  }
  
};

slider.init();</code></pre>
<h3>The HTML (adding navigation)</h3>
<p>Adding swipe stuff would be super (super) sweet (hint). But for now let's add little press-able links to change slides, rather than relying on the scrollbar. You might even remove the scrollbar in real life (straight up overflow: hidden; on the container). What we need is anchor links that link to the ID's of the individual slides.</p>
<pre rel="HTML"><code class="language-markup">&lt;nav class="slider-nav"&gt;
  &lt;a href="#slide-0" class="active"&gt;Slide 0&lt;/a&gt; 
  &lt;a href="#slide-1"&gt;Slide 1&lt;/a&gt; 
  &lt;a href="#slide-2"&gt;Slide 2&lt;/a&gt; 
&lt;/nav&gt;</code></pre>
<p>Style those as you will. For <a href="http://codepen.io/chriscoyier/pen/Fkczq">the demo</a>, I make them little tiny gray circles with the text hidden.</p>
<h3>The JavaScript (adding navigation)</h3>
<p>Our structure is more useful now. We simply add a few more elements we're dealing with, add a new event we're watching for (clicks on nav), and write a little function to deal with that event.</p>
<p>We know how far to animate the scroll position when a nav link is clicked from the ID on the link itself. The link might be href="#slide-1", which we can get "1" from easily. Then the position we need to scroll to is (1 × width of slide), so 300 in our case. We'll store that 300 value right in the JavaScript.</p>
<pre rel="jQuery"><code class="language-javascript">var slider = {
  
  el: {
    slider: $("#slider"),
    allSlides: $(".slide"),
    sliderNav: $(".slider-nav"),
    allNavButtons: $(".slider-nav &gt; a")
  },
  
  timing: 800,
  slideWidth: 300, // could measure this
  
  init: function() {
    // You can either manually scroll...
    this.el.slider.on("scroll", function(event) {
      slider.moveSlidePosition(event);
    });
    // ... or click a thing
    this.el.sliderNav.on("click", "a", function(event) {
      slider.handleNavClick(event, this);
    });
  },
  
  moveSlidePosition: function(event) {
    // Magic Numbers
    this.el.allSlides.css({
      "background-position": $(event.target).scrollLeft()/6-100+ "px 0"
    });  
  },
  
  handleNavClick: function(event, el) {
    // Don't change URL to a hash, remove if you want that
    event.preventDefault();

    // Get "1" from "#slide-1", for example
    var position = $(el).attr("href").split("-").pop();
    
    this.el.slider.animate({
      scrollLeft: position * this.slideWidth
    }, this.timing);
    
    this.changeActiveNav(el);
  },
  
  changeActiveNav: function(el) {
    // Remove active from all links
    this.el.allNavButtons.removeClass("active");
    // Add back to the one that was pressed
    $(el).addClass("active");
  }
  
};

slider.init();</code></pre>
<p>We have an "active" class on the nav links just to use in CSS to visually indicate which slide is active. We handle that by removing "active" from all links and then adding it back to the one that was clicked.</p>
<h3>Demo!</h3>
<pre class="codepen" data-height="630" data-type="result" data-href="Fkczq" data-user="chriscoyier" data-safe="true"><code></code><a href="http://codepen.io/chriscoyier/pen/Fkczq">Check out this Pen!</a></pre>
<p><script async src="http://codepen.io/assets/embed/ei.js"></script></p>
<p><hr>

<p><a href="http://events.jquery.org/2013/portland/"><img src="http://cdn.css-tricks.com/images/jquery-portland.jpg"></a></p>

<p><a href="http://events.jquery.org/2013/portland/">jQuery Conference Portland 2013</a> has a limited number of regular tickets still available. Two days. Two tracks. Fresh speakers. Jun 13-14. $50 off for members of the jQuery Foundation. <a href="https://jquery.org/join/">Join today</a> and get your first year of fan dues paid for with purchase of both a training and conference ticket. Training provided by Bocoup on Jun 12. Use coupon code <strong>CSSTricks25off</strong> for $25 off.</p>

<hr>

<p><small><a href="http://css-tricks.com/slider-with-sliding-backgrounds/">Slider with Sliding Backgrounds</a> is a post from <a href="http://css-tricks.com">CSS-Tricks</a></small></p></p>]]></content:encoded>
			<wfw:commentRss>http://css-tricks.com/slider-with-sliding-backgrounds/feed/</wfw:commentRss>
		<slash:comments>40</slash:comments>
		</item>
		<item>
		<title>Photo Swivel</title>
		<link>http://css-tricks.com/photo-swivel/</link>
		<comments>http://css-tricks.com/photo-swivel/#comments</comments>
		<pubDate>Wed, 15 May 2013 12:06:33 +0000</pubDate>
		<dc:creator>Guest Author</dc:creator>
				<category><![CDATA[Article]]></category>

		<guid isPermaLink="false">http://css-tricks.com/?p=21627</guid>
		<description><![CDATA[<p><p><em class="explanation">The following is a guest post by <a href="http://www.alexandery.net/">Alex Young</a> (<a href="http://twitter.com/the_alexyoung">@the_alexyoung</a>). Alex has created a simple technique to "rotate" the subject of a photo simply by hiding and showing multiple stacked photographs taken at different angles. Enjoy!</em></p>
<p></p>
<p>Web designers and developers have always fascinated us with fun and engaging ways we interact with their websites. I love discovering new techniques that these designers/developers have come up with. One technique in particular that sparked my interest is something that I &#8230;</p></p><p><hr>

<p><a href="http://events.jquery.org/2013/portland/"><img src="http://cdn.css-tricks.com/images/jquery-portland.jpg"></a></p>

<p><a href="http://events.jquery.org/2013/portland/">jQuery Conference Portland 2013</a> has a limited number of regular tickets still available. Two days. Two tracks. Fresh speakers. Jun 13-14. $50 off for members of the jQuery Foundation. <a href="https://jquery.org/join/">Join today</a> and get your first year of fan dues paid for with purchase of both a training and conference ticket. Training provided by Bocoup on Jun 12. Use coupon code <strong>CSSTricks25off</strong> for $25 off.</p>

<hr>

<p><small><a href="http://css-tricks.com/photo-swivel/">Photo Swivel</a> is a post from <a href="http://css-tricks.com">CSS-Tricks</a></small></p></p>]]></description>
				<content:encoded><![CDATA[<p><em class="explanation">The following is a guest post by <a href="http://www.alexandery.net/">Alex Young</a> (<a href="http://twitter.com/the_alexyoung">@the_alexyoung</a>). Alex has created a simple technique to "rotate" the subject of a photo simply by hiding and showing multiple stacked photographs taken at different angles. Enjoy!</em></p>
<p><span id="more-21627"></span></p>
<p>Web designers and developers have always fascinated us with fun and engaging ways we interact with their websites. I love discovering new techniques that these designers/developers have come up with. One technique in particular that sparked my interest is something that I saw on <a href="http://www.warbyparker.com/">Warby Parker’s website</a>. They were able to create a cool effect where model follows the user’s mouse, showing off the different angles of the frames. </p>
<p>I’ve seen this technique mainly used for showing off sunglasses, but I’m interested to see what you guys can come up with for other real-world applications.</p>
<p>Before we begin, you will need a few things. Well, seven things to be exact. You are going to need seven photos of something taken at seven different angles. </p>
<h3>HTML Setup</h3>
<p>What we are setting up is a container called “faces”, then have created an area that we are going to use to display the photos – “face-area”.  We also have a <code>div</code> to hold each of the seven individual images. </p>
<pre rel="HTML"><code class="language-markup">&lt;div id="faces"&gt;

  &lt;div id="face-area"&gt;

    &lt;div id="image-1" style="display: none;"&gt;
      &lt;img src="http://cdn.css-tricks.com/images/look-left-3.jpg"&gt;
    &lt;/div&gt;

    &lt;div id="image-2" style="display: none;"&gt;
      &lt;img src="http://cdn.css-tricks.com/images/look-left-2.jpg"&gt;
    &lt;/div&gt;

    &lt;div id="image-3" style="display: none;"&gt;
      &lt;img src="http://cdn.css-tricks.com/images/look-left-1.jpg"&gt;
    &lt;/div&gt;

    &lt;div id="image-4" style="display: none;"&gt;
      &lt;img src="http://cdn.css-tricks.com/images/look-center.jpg"&gt;
    &lt;/div&gt;

    &lt;div id="image-5" style="display: none;"&gt;
      &lt;img src="http://cdn.css-tricks.com/images/look-right-1.jpg"&gt;
    &lt;/div&gt;

    &lt;div id="image-6" style="display: none;"&gt;
      &lt;img src="http://cdn.css-tricks.com/images/look-right-2.jpg"&gt;
    &lt;/div&gt;

    &lt;div id="image-7" style="display: none;"&gt;
      &lt;img src="http://cdn.css-tricks.com/images/look-right-3.jpg"&gt;
    &lt;/div&gt;</code></pre>
<p>Now we'll create a <code>div</code> that is going to do exactly what the name implies. It is going to lay on top of the other <code>div</code>. We can divide this <code>div</code> into 7 small columns and divide them equally across it. These 7 columns will be used to listen for when the mouse is hovering over that specific one. Adding “data-number” to each <code>div</code> will allow us to refer to each in jQuery later on.</p>
<pre rel="HTML"><code class="language-markup">    &lt;div id="the_faces_overlay"&gt;
      &lt;div class="the_faces" data-number="1"&gt;&lt;/div&gt;
      &lt;div class="the_faces" data-number="2"&gt; &lt;/div&gt;
      &lt;div class="the_faces" data-number="3"&gt;&lt;/div&gt;
      &lt;div class="the_faces" data-number="4"&gt;&lt;/div&gt;
      &lt;div class="the_faces" data-number="5"&gt;&lt;/div&gt;
      &lt;div class="the_faces" data-number="6"&gt;&lt;/div&gt;
      &lt;div class="the_faces" data-number="7"&gt;&lt;/div&gt;
    &lt;/div&gt; 

  &lt;/div&gt;&lt;!-- END #face-area --&gt;

&lt;/div&gt; &lt;!-- END #faces --&gt; </code></pre>
<h3>CSS Setup</h3>
<p>Most of the CSS is pretty self-explanatory. There is one thing I need to mention that is important, make sure that the 7 columns fit perfectly together across the <code>span</code> of the <code>div</code>.</p>
<pre rel="CSS"><code class="language-css">body {
  background: #333 
}

#faces {
  height: 333px;
  width: 500px;
  margin: 0 auto;
  border: 8px solid white;
}

#face-area {
  height: 500px;
  width: 333px;
  position: relative;
}

#the_faces_overlay {
  position: absolute;
  width: 500px;
  top: 0;
  left: 0;
}

#faces .the_faces {
  height: 333px;
  width: 14.2857143%;
  float: left;
  margin: 0;
  padding: 0;
}</code></pre>
<h3>jQuery Setup</h3>
<p>We need to listen for when each of the columns are hovered over. This is where those “data-numbers” come in handy. If we wanted to add more columns down the road we wouldn't have to add any more JavaScript.</p>
<pre rel="jQuery"><code class="language-javascript">// Reveal the "center" image
var centerImage = $("#image-4").show();

// Bind hovers to each column
$(".the_faces").each(function() {

  $(this).on("mouseover", function() {
  
    $("#image-" + $(this).attr("data-number")).show();
  
  }).on("mouseout",function() {
  
    $("#image-" + $(this).attr("data-number")).hide();

  });
  
});

// Reset center image
$("#face-area").on("mouseleave", function() {
  centerImage.show();
}).on("mouseenter", function() {
  centerImage.hide();
});</code></pre>
<h3>Tada!</h3>
<pre class="codepen" data-height="600" data-type="result" data-href="IJGxk" data-user="AlexanderY" data-safe="false"><code></code><a href="http://codepen.io/AlexanderY/pen/IJGxk">Check out this Pen!</a></pre>
<p>There you have it! Now you have your very own, head turning model. Use it to show off your very own products. There are tons of uses for this out there. Let me know what you come up with.</p>
<p><strong>Editor's note:</strong> this would be a fun demo to work on adding touch support, wouldn't it? Follows a swipe or something.</p>
<p><hr>

<p><a href="http://events.jquery.org/2013/portland/"><img src="http://cdn.css-tricks.com/images/jquery-portland.jpg"></a></p>

<p><a href="http://events.jquery.org/2013/portland/">jQuery Conference Portland 2013</a> has a limited number of regular tickets still available. Two days. Two tracks. Fresh speakers. Jun 13-14. $50 off for members of the jQuery Foundation. <a href="https://jquery.org/join/">Join today</a> and get your first year of fan dues paid for with purchase of both a training and conference ticket. Training provided by Bocoup on Jun 12. Use coupon code <strong>CSSTricks25off</strong> for $25 off.</p>

<hr>

<p><small><a href="http://css-tricks.com/photo-swivel/">Photo Swivel</a> is a post from <a href="http://css-tricks.com">CSS-Tricks</a></small></p></p>]]></content:encoded>
			<wfw:commentRss>http://css-tricks.com/photo-swivel/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
	</channel>
</rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk
Content Delivery Network via cdn.css-tricks.com

 Served from: css-tricks.com @ 2013-05-24 06:11:17 by W3 Total Cache -->
