<?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>SixCrayons &#187; CSS</title>
	<atom:link href="http://sixcrayons.com/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://sixcrayons.com</link>
	<description>non-toxic designing</description>
	<lastBuildDate>Tue, 25 May 2010 16:19:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Creating CSS based Tooltips</title>
		<link>http://sixcrayons.com/2009/11/05/creating-definition-pop-ups-just-using-css/</link>
		<comments>http://sixcrayons.com/2009/11/05/creating-definition-pop-ups-just-using-css/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 20:04:53 +0000</pubDate>
		<dc:creator>Rob Such</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[tooltips]]></category>

		<guid isPermaLink="false">http://sixcrayons.com/?p=1620</guid>
		<description><![CDATA[Have you ever wanted to have definition pop-ups on your website but have never been brave enough to attempt the jQuery that would be [...]]]></description>
			<content:encoded><![CDATA[<p class="first">Have you ever wanted to have definition pop-ups on your website but have never been brave enough to attempt the jQuery that would be needed? Well I needed to do this just yesterday and thought there must be an easier way&#8230;</p>
<p>Well I have found a way to achieve this by <strong>just using CSS</strong>! Yep, just CSS. This is done by having a span that is hidden inside your &#8216;a&#8217; element. Then on hover of your &#8216;a&#8217; you just simply show the content of the span. All you then have left to do is position your span on your page and style it up however you like. Below is the code to achieve this&#8230;</p>
<p>Your &#8216;a&#8217; element needs to look like this :</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Title <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span>&gt;</span>This is the tooltip<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></pre></div></div>

<p>And the style needs to look something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">a <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">10</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">100</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
a span <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
a<span style="color: #3333ff;">:hover </span>span <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">white-space</span><span style="color: #00AA00;">:</span><span style="color: #993333;">nowrap</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">.5em</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">.5em</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#fffcd1</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#444</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#444</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">10</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<div id="attachment_1627" class="wp-caption alignleft" style="width: 205px"><img class="size-full wp-image-1627 " src="http://sixcrayons.com/files/2009/11/tooltip.jpg" alt="Tool Tip" width="195" height="156" /><p class="wp-caption-text">CSS Tooltip</p></div>
<p>Although the negative to using this technique is that Google would see this as anchor text so it would associate this with the link. This could potentially water down your keywords on the page this is running on! So as with all techniques this needs to be used with consideration to whether it is the right solution for the situation?</p>
<p>Well guys I hope this helps solve a problem as it really did help me out.</p>
<p><em>PS &#8211; Please be nice as this is my first post on Six Crayons!</em></p>
<p>Toodles&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://sixcrayons.com/2009/11/05/creating-definition-pop-ups-just-using-css/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The Power of Positioning &#8211; Absolute and Relative</title>
		<link>http://sixcrayons.com/2009/11/04/the-power-of-positioning-absolute-and-relative/</link>
		<comments>http://sixcrayons.com/2009/11/04/the-power-of-positioning-absolute-and-relative/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 10:22:54 +0000</pubDate>
		<dc:creator>Ollie Wells</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[absolute]]></category>
		<category><![CDATA[fixed]]></category>
		<category><![CDATA[position]]></category>
		<category><![CDATA[relative]]></category>

		<guid isPermaLink="false">http://sixcrayons.com/?p=1534</guid>
		<description><![CDATA[One of the most confusing things when first starting CSS is positioning.  I&#8217;m going to explain the differences between the 2 main positioning techniques, [...]]]></description>
			<content:encoded><![CDATA[<p class="first">One of the most confusing things when first starting CSS is positioning.  I&#8217;m going to explain the differences between the 2 main positioning techniques, absolute and relative.</p>
<p>Once you’ve grasped how to use these two positioning techniques, you&#8217;ll wonder how you ever build a site without them.</p>
<p>There are in fact 4 separate positions for content :</p>
<p><em>Static </em>(the default), <em>Fixed, Relative </em>and<em> Absolute.</em></p>
<p>Static is the default, which means if you don’t specify any positioning through CSS, your content will automatically be statically positioned. All this really means is that it behaves as you’d expect, in the normal flow of the content on the page. Fixed means the content is fixed at a stated position, such as the bottom of the page.</p>
<p>But lets look at the more wildly used Relative and Absolute positioning :</p>
<h3 class="title">Relative positioning</h3>
<p>Think of relative positioning as a rooting system. Setting an element&#8217;s position to relative sets roots where it is. You can then move the element &#8220;relative&#8221; to where its roots are by using horizontal and vertical positions. So you can tell a box to be 50px from the left and 50px from the top of where it originally was.</p>
<p><img class="alignleft size-full wp-image-1581" src="http://sixcrayons.com/files/2009/11/olliewells-post1-img12.jpg" alt="olliewells-post1-img1" width="579" height="300" /></p>
<p>But because the elements roots are where you first put it, the space taken up by these roots remains. So if you had 3 boxes, and moved the middle one, the other 2 would stay exactly where they are, separated by the space taken up by the middle one.</p>
<h3 class="title">Absolute Positioning</h3>
<p>Absolute positioning has no roots. The element is in its own pot, and you are moving the pot around. Again you move the element around using horizontal and vertical positions, but this time other elements will fall into the gap that was left by the pot, as if it was never there in the first place.</p>
<p><img class="alignleft size-full wp-image-1585" src="http://sixcrayons.com/files/2009/11/olliewells-post1-img2.jpg" alt="olliewells-post1-img2" width="579" height="300" />So this time, moving a box 50px from the left and 50px from the top, is moving it from the edges of its container, not where it was originally.</p>
<p>Absolutely positioned elements use the edges of its nearest positioned container. What that means is that if the element is inside a div with position applied to it, it will be offset from the edges of that div.</p>
<p>If its not in any container with any positioning applied, it will default to the page container, which is basically the browser window.</p>
<h3 class="title">The good part</h3>
<p>The most powerful part of positioning is when you combine relative and absolute.</p>
<p>You set the container&#8217;s position to relative, then the element you are positioning to absolute, and set the horizontal and vertical positions of that element.</p>
<p>One of my next posts will be a tutorial to follow, using the various techniques in positioning, so make sure you check back here often!</p>
<p>But for now, have a go at positioning some elements all over the place. Once you get the hang of it, its a very accurate way to arrange your content.</p>
]]></content:encoded>
			<wfw:commentRss>http://sixcrayons.com/2009/11/04/the-power-of-positioning-absolute-and-relative/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove Safari input highlight / glow</title>
		<link>http://sixcrayons.com/2009/09/29/remove-safari-input-highlight-glow/</link>
		<comments>http://sixcrayons.com/2009/09/29/remove-safari-input-highlight-glow/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 17:03:57 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[glow]]></category>
		<category><![CDATA[input]]></category>
		<category><![CDATA[safari]]></category>

		<guid isPermaLink="false">http://sixcrayons.com/?p=827</guid>
		<description><![CDATA[By default Safari will render a glow effect around input elements when the input receives focus. In certain situation, this behaviour can be quite [...]]]></description>
			<content:encoded><![CDATA[<p class="first"><strong>By default Safari will render a glow effect around input elements when the input receives focus.</strong></p>
<p>In certain situation, this behaviour can be quite irritating, especially if you are customising the appearance of your inputs so that that differ greatly from the standard look.</p>
<p>In this example, we were opting for an Apple like rounded input element using background images and a transparent input.</p>
<p><img class="aligncenter size-full wp-image-841" src="http://sixcrayons.com/files/2009/09/input.gif" alt="Plain Input" width="600" height="100" />All appears to be fine until the input receives focus when browsing using Safari and you are presented with the following outer glow effect around the original input element.</p>
<p><img class="aligncenter size-full wp-image-842" src="http://sixcrayons.com/files/2009/09/inputfocus.gif" alt="Input with Focus" width="600" height="100" />The solution to removing this effect is a very simple one. Set the outline property of the element to none in your CSS file.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">input <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>You may want to be more specific and target a single element, but here we are setting the value for all input elements.</p>
]]></content:encoded>
			<wfw:commentRss>http://sixcrayons.com/2009/09/29/remove-safari-input-highlight-glow/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Simple Tips to Organise your CSS</title>
		<link>http://sixcrayons.com/2009/09/10/simple-tips-to-organise-your-css/</link>
		<comments>http://sixcrayons.com/2009/09/10/simple-tips-to-organise-your-css/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 15:04:42 +0000</pubDate>
		<dc:creator>Dave Cartledge</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[best practises]]></category>

		<guid isPermaLink="false">http://sixcrayons.com/?p=357</guid>
		<description><![CDATA[Stylesheets can easily become large and unorganised if not properly structured. Planning ahead and careful organising is important to create a fast, manageable stylesheet. [...]]]></description>
			<content:encoded><![CDATA[<p class="first">Stylesheets can easily become large and unorganised if not properly structured. Planning ahead and careful organising is important to create a fast, manageable stylesheet. By sticking to these basic rules, you can write CSS that is leaner, faster and less likely to give you a headache.</p>
<h3 class="title">Plan ahead and keep organised</h3>
<p>Declare your main structural elements nearer to the top of the document, and then the less important elements further down. Use a structure that works best for you, and save a template for future use.</p>
<ol>
<li>Resets</li>
<li>Main Layout</li>
<li>Secondary Layout</li>
<li>Miscellaneous</li>
</ol>
<p>Break your stylesheet into modules:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@import &quot;/css/layout.css&quot;;</span>
<span style="color: #a1a100;">@import &quot;/css/print.css&quot;;</span>
<span style="color: #a1a100;">@import &quot;/css/typography.css&quot;;</span>
<span style="color: #a1a100;">@import &quot;/css/forms.css&quot;;</span></pre></div></div>

<h3 class="title">Use Comments</h3>
<p>Each CSS file should have a commented area at the beginning of the document, which includes the date it was written, updated date and the author. Use comments to clearly define each section of code.</p>
<h3 class="title">Use Consistent and meaningful naming conventions</h3>
<p>Try to use names that will remain relevant over time. The ability to redesign your entire website by just modifying the CSS will be much harder if you use limiting names. Use versatile naming and stay consistent – use hyphens instead of underscores (some older browsers don’t like underscores) but use it consistently, eg:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#Sub-Content</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">500px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#f2f2f2</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#Advert-One</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">100px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#f2f2f2</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Not this:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#SubContent</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">500px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#f2f2f2</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#Advert-one</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">100px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#f2f2f2</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>If you capitalise the first letter of each word, and separate with a hyphen – do this for <em>all</em> elements.</p>
<h3 class="title">Group elements and use shorthand</h3>
<p>Use groups to re-use attributes instead of declaring the styles again. This technique allows you to create compact yet powerful CSS rules.</p>
<p>So this:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">h3 <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> arial<span style="color: #00AA00;">,</span> helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
p <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> arial<span style="color: #00AA00;">,</span> helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Becomes this:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">h3<span style="color: #00AA00;">,</span> p <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> arial<span style="color: #00AA00;">,</span> helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Use shorthand to create optimised CSS:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">h3<span style="color: #00AA00;">,</span> p <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">font</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span> arial<span style="color: #00AA00;">,</span> helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<h3 class="title">Validate</h3>
<p>Every stylesheet should be fully validated using the free <a href="http://jigsaw.w3.org/css-validator/">W3C CSS Validator</a>, and if you’ve got issues with your CSS not doing what you want it to, this can be a big help in rectifying any errors in your code.</p>
]]></content:encoded>
			<wfw:commentRss>http://sixcrayons.com/2009/09/10/simple-tips-to-organise-your-css/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
