<?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>Design Without Frontiers &#187; CSS</title>
	<atom:link href="http://www.designwithoutfrontiers.com/category/articles/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.designwithoutfrontiers.com</link>
	<description>Web Design, CSS, Flash, Tutorials and Hot Trends</description>
	<lastBuildDate>Mon, 19 Apr 2010 15:45:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>Reset your CSS</title>
		<link>http://www.designwithoutfrontiers.com/reset-your-css/</link>
		<comments>http://www.designwithoutfrontiers.com/reset-your-css/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 12:29:19 +0000</pubDate>
		<dc:creator>Kostas Mavropalias</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[reset]]></category>

		<guid isPermaLink="false">http://www.designwithoutfrontiers.com/?p=125</guid>
		<description><![CDATA[What is one of the most annoying problems when developing a CSS based website? The inconsistencies among different browsers. You try to define every little details in your style sheet, only to see your site behave differently in Firefox, Internet Explorer, Opera, etc. So what can you do about this? Continue creating additional styles for [...]]]></description>
			<content:encoded><![CDATA[<p>What is one of the most annoying problems when developing a CSS based website? The inconsistencies among different browsers. You try to define every little details in your style sheet, only to see your site behave differently in Firefox, Internet Explorer, Opera, etc.</p>
<p>So what can you do about this? Continue creating additional styles for every html element, which results into a bloated CSS file, and <em>hope </em>everything works ok?</p>
<p>Well, there is something you can do! Stop bloating your style sheet, step back a bit and reset your CSS before you move on with your design.<span id="more-125"></span></p>
<h3>What is CSS reset?</h3>
<p>The concept of resetting your CSS comes to address this specific problem with inconsistencies across different browsers.</p>
<p>For example, since Internet Explorer adds different spacing at <em>&lt;p&gt;</em> elements than Firefox, what we want to do is eliminate this difference (and all other differences) and create a level playing field.</p>
<p>Essentially, CSS reset is not a complex process or hard to implement. In fact, it&#8217;s very simple.</p>
<h3>So how do we reset our CSS?</h3>
<p>To get to the point, here is a simple piece of <em>css reset code</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">h1<span style="color: #00AA00;">,</span>h2<span style="color: #00AA00;">,</span>h3<span style="color: #00AA00;">,</span>h4<span style="color: #00AA00;">,</span>h5<span style="color: #00AA00;">,</span>h6<span style="color: #00AA00;">,</span>ul<span style="color: #00AA00;">,</span>li<span style="color: #00AA00;">,</span>em<span style="color: #00AA00;">,</span>strong<span style="color: #00AA00;">,</span>pre<span style="color: #00AA00;">,</span>code <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">1em</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><em>Padding</em>, <em>margin</em>, <em>line-height</em> and <em>font-size</em> are the obvious attributes that are rendered in a different way across various browsers, and we want to fix that.</p>
<p>What we did in the previous CSS code example, is to set all these attributes to 0 or to a default value. Now we can take it on and style every element in our page the way we want it to be.</p>
<h3>That was it?</h3>
<p>Yeah, that was (almost) it! With only a few lines of CSS, you can make your websites render consistently across browsers.</p>
<p>Now, before going ahead and adding this code to your style sheet, you need to decide how far you&#8217;re going to go in resetting things.</p>
<p>If you google for &#8220;<em>reset.css</em>&#8221; you&#8217;ll get lots of results and lots of sample <em>reset.css</em> files, each trying to cater to different needs.</p>
<p>If you use only some basic tags, you don&#8217;t need to reset everything. While if you have a complex site with lots of tags, then you may need to reset more tags.</p>
<p>As a start, I would suggest the following code. It&#8217;s simple, clean and resets the most used tags. If you need additional definitions, just add your tag in the list.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">body <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
h1<span style="color: #00AA00;">,</span>h2<span style="color: #00AA00;">,</span>h3<span style="color: #00AA00;">,</span>h4<span style="color: #00AA00;">,</span>h5<span style="color: #00AA00;">,</span>h6<span style="color: #00AA00;">,</span>ul<span style="color: #00AA00;">,</span>li<span style="color: #00AA00;">,</span>em<span style="color: #00AA00;">,</span>strong<span style="color: #00AA00;">,</span>pre<span style="color: #00AA00;">,</span>code <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">1em</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
ul<span style="color: #00AA00;">,</span>ol<span style="color: #00AA00;">,</span>li <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
img <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>You can add this code directly into your default style sheet, or just create an additional <em>reset.css</em> file, which you can then re-use it for all your sites.</p>
  ]]></content:encoded>
			<wfw:commentRss>http://www.designwithoutfrontiers.com/reset-your-css/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

