<?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>Hale Interactive &#187; CSS</title>
	<atom:link href="http://www.haleinteractive.com/category/blog/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.haleinteractive.com</link>
	<description>one developers brain dump on the world</description>
	<lastBuildDate>Thu, 27 May 2010 23:04:51 +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>Common CSS Mistakes</title>
		<link>http://www.haleinteractive.com/2009/07/common-css-mistakes/</link>
		<comments>http://www.haleinteractive.com/2009/07/common-css-mistakes/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 20:28:50 +0000</pubDate>
		<dc:creator>Jason Hale</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[css organization]]></category>
		<category><![CDATA[make it right]]></category>
		<category><![CDATA[negative margins]]></category>
		<category><![CDATA[positioning]]></category>

		<guid isPermaLink="false">http://www.haleinteractive.com/?p=65</guid>
		<description><![CDATA[Here are a few common CSS mistakes I come across all the time. Yes these solutions might work when first developing in Firefox but these can cause major headaches when doing IE testing, debugging or making edits to the code in the future. 
Don&#8217;t over use negative margins
Yes there is a time and place for [...]]]></description>
			<content:encoded><![CDATA[<p>Here are a few common CSS mistakes I come across all the time. Yes these solutions might work when first developing in Firefox but these can cause major headaches when doing IE testing, debugging or making edits to the code in the future. </p>
<h3>Don&#8217;t over use negative margins</h3>
<p>Yes there is a time and place for negative margins. But if your find yourself using these on a daily basis then there&#8217;s probably and easier and better way to fix what you&#8217;re doing. Most likely a padding or margin on a parent element that can be adjusted. Use the <a href="http://css-tricks.com/the-css-box-model/">box model</a> properly, it makes debugging and editing the css later on much easier.</p>
<p><span id="more-65"></span></p>
<h3>Don&#8217;t position every element</h3>
<p>When trying to make a design pixel perfect I&#8217;ve seen developers relatively position every paragraph, link and heading in a div and change their top and left properties to line up with the flats. Not only is this a bad practice it is actually more work and causes more cross browser problems than adjusting padding and margins properly. Once again, the box model is your friend.</p>
<h3>Don&#8217;t float every element</h3>
<p>As with the positioning statement there&#8217;s rarely a time when floating every element is needed. Float only what&#8217;s needed and never declare a float globally. Ex:</p>
<p><code>#content div { float: left; }</code></p>
<p>This may be a quick fix when first starting a layout but what if you have other divs inside your #content that are not supposed to be floated. You&#8217;ll end up adding float:none for every div that shouldn&#8217;t be floated. The css above is also the perfect recipe for the <a href="http://www.positioniseverything.net/explorer/doubled-margin.html">IE6 double margin bug</a>.</p>
<h3>Don&#8217;t use !important</h3>
<p>If you&#8217;re using !important it&#8217;s usually because something else is wrong in your code and you&#8217;re not using the cascade properly. Remember that !important is also inherited so in order to override an !important value you&#8217;ll need to use another !important! So the next time you go to add !important to your css take a good look at your parent elements and fix your code properly.</p>
<h3>Group your css properly</h3>
<p>The most common reason people use !important is because their cascade isn&#8217;t working properly and they need to overwrite a value. By keeping your CSS organized properly and keeping the cascade in mind when writing your code you&#8217;ll soon be writing better code, faster and easier. The basics of keeping your css organized are to declare global elements at the top and then getting more and more specific further down your css. This is not a small concept and definitely deserves it&#8217;s own blog post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.haleinteractive.com/2009/07/common-css-mistakes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
