<?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>Refresh &#187; CSS and styling</title>
	<atom:link href="http://www.refresh.dk/topic/css-and-styling/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.refresh.dk</link>
	<description>Web programming for practitioners</description>
	<lastBuildDate>Sun, 02 May 2010 16:25:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Recap of CSS techniques [Link]</title>
		<link>http://www.refresh.dk/recap-of-css-techniques-link/</link>
		<comments>http://www.refresh.dk/recap-of-css-techniques-link/#comments</comments>
		<pubDate>Fri, 04 Jan 2008 16:30:55 +0000</pubDate>
		<dc:creator>Steffen Tiedemann Christensen</dc:creator>
				<category><![CDATA[CSS and styling]]></category>
		<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://www.refresh.dk/recap-of-css-techniques-link/</guid>
		<description><![CDATA[Smashing Magazine has an absolutely wonderful list of CSS techniques vital for any web programmer.
]]></description>
			<content:encoded><![CDATA[<p>Smashing Magazine has an <a href="http://www.smashingmagazine.com/2007/01/19/53-css-techniques-you-couldnt-live-without/">absolutely wonderful list</a> of CSS techniques vital for any web programmer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.refresh.dk/recap-of-css-techniques-link/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Efficient stylesheets [Link]</title>
		<link>http://www.refresh.dk/efficient-css-link/</link>
		<comments>http://www.refresh.dk/efficient-css-link/#comments</comments>
		<pubDate>Tue, 11 Dec 2007 11:16:01 +0000</pubDate>
		<dc:creator>Steffen Tiedemann Christensen</dc:creator>
				<category><![CDATA[CSS and styling]]></category>
		<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://www.refresh.dk/efficient-css-link/</guid>
		<description><![CDATA[This blog post provides a few simple tricks for coding efficient stylesheets &#8212; in the sense of having an organised structure which is easy to navigate and to modify. The color grouping seems like the most useful tip.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://designadaptations.com/notebook/coding-efficient-style-sheets/">This blog post</a> provides a few simple tricks for coding efficient stylesheets &#8212; in the sense of having an organised structure which is easy to navigate and to modify. The color grouping seems like the most useful tip.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.refresh.dk/efficient-css-link/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Styling from scratch [Howto]</title>
		<link>http://www.refresh.dk/howto-styling-from-scratch/</link>
		<comments>http://www.refresh.dk/howto-styling-from-scratch/#comments</comments>
		<pubDate>Fri, 07 Dec 2007 14:04:28 +0000</pubDate>
		<dc:creator>Steffen Tiedemann Christensen</dc:creator>
				<category><![CDATA[CSS and styling]]></category>

		<guid isPermaLink="false">http://www.refresh.dk/howto-styling-from-scratch/</guid>
		<description><![CDATA[A while back Dustin Diaz did a nice explainer on pieces needed for your own personal JavaScript and AJAX interface &#8212; if you&#8217;re not using a prefrabricated one, that is. The basic idea was that you&#8217;ll save both time, bandwidth and debugging troubles by getting the foundation right. And the same thing goes for the [...]]]></description>
			<content:encoded><![CDATA[<p>A while back <a href="http://www.dustindiaz.com/roll-out-your-own-interface/">Dustin Diaz</a> did <a href="http://www.dustindiaz.com/roll-out-your-own-interface/">a nice explainer</a> on pieces needed for your own personal JavaScript and AJAX interface &#8212; if you&#8217;re not using a prefrabricated one, that is. The basic idea was that you&#8217;ll save both time, bandwidth and debugging troubles by getting the foundation right. And the same thing goes for the CSS foundation.</p>
<h3>Reset for a level playing field</h3>
<p>First of all, your basic stylesheet should include a few lines to void browser-specific stylesheets and to reset padding and margin on all elements. This means that all browsers will behave the same when you add your own styling, and that you know that you&#8217;ll be responsible for all padding, margins, colors, borders and size in the final layout.</p>
<p>There are <a href="http://www.google.dk/search?q=css+reset">plenty of examples</a> of such reset stylesheets that you can steal from. Usually, I go for <a href="http://developer.yahoo.com/yui/build/reset/reset.css">YUI&#8217;s version</a>. Along the same lines, have a look at <a href="http://developer.yahoo.com/yui/fonts/">YUI&#8217;s Font CSS</a>, which provides similar normalization for font support across different browsers.</p>
<h3>Your own common styles</h3>
<p>Apart from the resets you&#8217;ll want to include a list of the styles that you commonly use. Such as <span class="tt bold">bold</span>, <span class="tt underline">underline</span> or <span class="tt highlightbackground">highlightbackground</span>. When you get used to using the same class names over and over, it&#8217;ll save you a lot of <span class="tt">style=&#8221;text-decoration:none;&#8221;</span> and so on.</p>
<p>But the main advantage is that you&#8217;ll be using one common convention on all pages and on all sites. This saves a lot of cleaning-up when the design is finalized. For example, most sites have boxes with a light background, and you&#8217;ll usually want to keep those backgrounds similar. But that background colour can change color as the design develops. Vowing to keep to convenstion from the start means that this is not a problem. And having long-established conventions makes this even easier. I&#8217;ll usually go for something like this:</p>
<pre><code class="css">.clear {clear:both;}
.clearleft {clear:left;}
.clearright {clear:right;}
.discrete {color:#7F7F7F; font-size:.95em;}
.discrete a {color:#7F7F7F;}
.small {font-size:.95em;}
.verysmall {font-size:.90em;}
.big {font-size:1.2em;}
.verybig {font-size:1.6em;}
.gray {color:#666;}
.jumptop {margin-top:15px;}
.jumpbottom {margin-bottom:15px;}
.jumpright {padding-right:10px;}
.jumpleft {padding-left:10px;}
.bigjumptop {margin-top:40px;}
.bigjumpbottom {margin-bottom:40px;}
.bordered {border:1px solid #666;}
.borderedtop {margin-top:15px;
    padding-top:15px; border-top:1px solid #666;}
.borderedbottom {margin-bottom:15px;
    padding-bottom:15px; border-bottom:1px solid #666;}
.center {text-align:center;}
.floatleft {float:left;}
.floatright {float:right;}
.left {text-align:left;}
.right {text-align:right;}
.bold {font-weight:bold;}
.nobold {font-weight:normal;}
.italic {font-style:italic;}
.uppercase {text-transform:uppercase;}
.nouppercase {text-transform:none;}
.underline {text-decoration:underline;}
.nounderline {text-decoration:none;}
.opaque {filter:alpha(opacity=40);
    -moz-opacity:.40; opacity:.40;}
.lightbackground {background-color:#F4FBF2;}
.highlightbackground {background-color:#FFFFCC !important;}</code></pre>
<p>(By the way, the <span class="tt">jumptop</span>, <span class="tt">jumpbottom</span>, <span class="tt">bigjumptop</span> and <span class="tt">bigjumpbottom</span> have turned out to be particularly useful because it allows for easy and consistent margins. And if you want to modify margins for a particular section, it&#8217;s as easy as this: <span class="tt">#sidebar .jumptop {margin-top:8px;}</span>)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.refresh.dk/howto-styling-from-scratch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A simple guide to CSS positioning</title>
		<link>http://www.refresh.dk/navigating-through-css-positioning/</link>
		<comments>http://www.refresh.dk/navigating-through-css-positioning/#comments</comments>
		<pubDate>Tue, 27 Nov 2007 22:43:04 +0000</pubDate>
		<dc:creator>Steffen Tiedemann Christensen</dc:creator>
				<category><![CDATA[CSS and styling]]></category>
		<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://praxis.refresh.dk/navigating-through-css-positioning/</guid>
		<description><![CDATA[BarelyFitz Design has written up a very nice explainer on how to position elements through CSS. Their step four is probably the one that is most easily forgotten: Combining position:relative with position:absolute. In a nutshell, setting a &#8216;relative&#8217; position on the container element will allow you to position subelements absolutely within that element. And the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.barelyfitz.com/">BarelyFitz Design</a> has written up a <a href="http://www.barelyfitz.com/screencast/html-training/css/positioning/">very nice explainer</a> on how to position elements through CSS. Their step four is probably the one that is most easily forgotten: Combining <tt>position:relative</tt> with <tt>position:absolute</tt>. In a nutshell, setting a &#8216;relative&#8217; position on the container element will allow you to position subelements absolutely within that element. And the explainer goes to show how this method can be used for two- or three-column layouts that rival the traditional methods of floating elements.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.refresh.dk/navigating-through-css-positioning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
