<?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>Aaron As a Chimp &#187; CSS</title>
	<atom:link href="http://sachimp.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://sachimp.com</link>
	<description>with a typewriter</description>
	<lastBuildDate>Sat, 18 Jun 2011 15:26:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Why width: 100% doesn&#8217;t do what you think it does</title>
		<link>http://sachimp.com/2010/06/13/why-width-100-doesnt-do-what-you-think-it-does/</link>
		<comments>http://sachimp.com/2010/06/13/why-width-100-doesnt-do-what-you-think-it-does/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 00:24:16 +0000</pubDate>
		<dc:creator>AaronAsAChimp</dc:creator>
				<category><![CDATA[Quickies]]></category>
		<category><![CDATA[box-model]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://sachimp.com/2010/06/13/why-width-100-doesnt-do-what-you-think-it-does/</guid>
		<description><![CDATA[Something I run across every so often when fixing bugs is a problem of content overflowing its parent element. The child has padding, margins, or a border, and a width set to 100%. This seems like it should fill the available space, but it protrudes out instead. The weird behavior comes from the standard box [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>Something I run across every so often when fixing bugs is a problem of content overflowing its parent element. The child has padding, margins, or a border, and a width set to 100%. This seems like it should fill the available space, but it protrudes out instead.</p>
<p>The weird behavior comes from the standard box model. According to the standard box model, when you set the width, it sets the width of the content area. The padding, border, and margin get wrapped around it. Meaning that the box, which is already the full width of it&#8217;s parent, gets pushed out beyond the edge.</p>
<p>The fix is painfully simple. Simply set width of the chid element to auto, or remove it entirely. Block level elements automatically fill the available space, and that calculation takes into account the borders, margin, and padding.  </p>
<div class="shr-publisher-226"></div><!-- Start Shareaholic LikeButtonSetBottom --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fsachimp.com%2F2010%2F06%2F13%2Fwhy-width-100-doesnt-do-what-you-think-it-does%2F' data-shr_title='Why+width%3A+100%25+doesn%27t+do+what+you+think+it+does'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fsachimp.com%2F2010%2F06%2F13%2Fwhy-width-100-doesnt-do-what-you-think-it-does%2F' data-shr_title='Why+width%3A+100%25+doesn%27t+do+what+you+think+it+does'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://sachimp.com/2010/06/13/why-width-100-doesnt-do-what-you-think-it-does/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Stacking the Deck</title>
		<link>http://sachimp.com/2010/05/23/stacking-the-deck-2/</link>
		<comments>http://sachimp.com/2010/05/23/stacking-the-deck-2/#comments</comments>
		<pubDate>Sun, 23 May 2010 23:38:47 +0000</pubDate>
		<dc:creator>AaronAsAChimp</dc:creator>
				<category><![CDATA[Ideas]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[heierarchy]]></category>
		<category><![CDATA[stylesheets]]></category>

		<guid isPermaLink="false">http://sachimp.com/?p=199</guid>
		<description><![CDATA[Managing styles can be frustrating. Most people just stuff everything into one stylesheet. This works for smaller sites really well, but it doesn&#8217;t scale to larger sites. The stylesheet gets so large that it&#8217;s difficult to know what is going to override what. You end up relying in tools like Firebug to find out how [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>Managing styles can be frustrating. Most people just stuff everything into one stylesheet. This works for smaller sites really well, but it doesn&#8217;t scale to larger sites. The stylesheet gets so large that it&#8217;s difficult to know what is going to override what. You end up relying in tools like Firebug to find out how adding a new style is going to affect the site.</p>
<h3>She&#8217;s a brick house</h3>
<p>You can&#8217;t really get rid of that global stylesheet because defining styles that apply to the whole site incredibly useful. You don&#8217;t want have the same styles duplicated across multiple stylesheets. That causes bloat. It makes updating the styles difficult too, but it would be great to have page level granularity. So when the creative department comes down on you like a ton of bricks, you can change the blue to gold in a flash. (actually it was more of a amber-canary with a splash of wheat).</p>
<p>The trick is to do both. Start with a global stylesheet and define the most commonly used styles. Use good defaults: define all your font families and sizes; create classes for all of your sprites; and create all of the utility classes for floating and clearing elements. This will be the foundation for all of your future work.</p>
<p>Then create a set mid-level of stylesheets. You would include this one immediately after your global sheet.  One for each section of your site. These stylesheets will be your work horses. This is where you setup your layout fundamentals for section.</p>
<h3>And finally</h3>
<p>On the pages that need it. Create page specific stylesheets. Included after your section stylesheet. So, now, when the client says that they actually liked the blue better. It&#8217;s now a 5 second change. </p>
<div class="shr-publisher-199"></div><!-- Start Shareaholic LikeButtonSetBottom --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fsachimp.com%2F2010%2F05%2F23%2Fstacking-the-deck-2%2F' data-shr_title='Stacking+the+Deck'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fsachimp.com%2F2010%2F05%2F23%2Fstacking-the-deck-2%2F' data-shr_title='Stacking+the+Deck'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://sachimp.com/2010/05/23/stacking-the-deck-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

