<?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>CoffeePowered &#187; CSS</title>
	<atom:link href="http://coffeepowered.co.uk/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://coffeepowered.co.uk</link>
	<description>The online ramblings of Paul Stanton</description>
	<lastBuildDate>Wed, 30 Jun 2010 19:46:33 +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>CSS coding standards</title>
		<link>http://coffeepowered.co.uk/2010/01/css-coding-standards/</link>
		<comments>http://coffeepowered.co.uk/2010/01/css-coding-standards/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 20:04:58 +0000</pubDate>
		<dc:creator>Stanton</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tips and tricks]]></category>
		<category><![CDATA[p52]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[maintainable css]]></category>
		<category><![CDATA[standards]]></category>

		<guid isPermaLink="false">http://coffeepowered.co.uk/blog/?p=182</guid>
		<description><![CDATA[Well, it&#8217;s now 2010 and as usual, January brings with it many self-made promises and resolutions, one of mine is to write more, even if it&#8217;s just quick tips &#038; tricks rather than lengthy diatribes which I always want to write, but never seem to find the time. During the back end of last year [...]]]></description>
			<content:encoded><![CDATA[<p>Well, it&#8217;s now 2010 and as usual, January brings with it many self-made promises and resolutions, one of mine is to write more, even if it&#8217;s just quick tips &#038; tricks rather than lengthy diatribes which I always want to write, but never seem to find the time.</p>
<p>During the back end of last year I started to experiment with one of the more boring aspects of CSS, but one of the most rewarding in the long-term: How I actually write, organise and maintain my CSS files. These are relatively minor tweaks, but I thought I&#8217;d share them in case anyone finds them useful.</p>
<p>I&#8217;d just like to note that these are my personal preferences, you may disagree entirely with the way I do things and that&#8217;s fine, feel free to drop a comment below if you&#8217;d like!</p>
<h3>Single vs. Multi-line</h3>
<p>So lets get this out of the way, I hate single line CSS rules, they&#8217;re a pain-in-the-ass to navigate and can cause problems with some source control tools which may only tell you which line has changed and not which property has changed specifically or when running your code through the validator and getting errors which refer to specific line numbers as well as times when you might not have syntax highlighting to help you quickly visually identify properties and values (such as viewing CSS in Firebug).</p>
<p>I&#8217;ve never written my CSS rules as single-line and I doubt I&#8217;ll ever start.</p>
<h3>Ordering of declarations</h3>
<p>One of my most common bugbears is with the ordering of declarations, a lot of the CSS files I come across in my &#8216;day job&#8217; are simply not ordered in any meaningful way, some have a semblance of ordering based on the personal preferences of the designer and may have width &#038; height rules together, floats and positions together for example, this always differs from designer to designer.</p>
<p>The best way to order declarations is alphabetically, it makes it far easier to scan through and visually locate a specific declaration, especially in large rules. Also, for teams of multiple designers it&#8217;s far easier to add declarations to an existing rule as they simply slot in alphabetically.</p>
<div class="codecolorer-container css default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ul<span style="color: #cc00cc;">#nav_primary</span> li a <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <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><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#999</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <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><br />
&nbsp; &nbsp; <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><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.2em</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span>0 <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">text-transform</span><span style="color: #00AA00;">:</span><span style="color: #993333;">uppercase</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p></p>
<h3>Curly braces</h3>
<p>This might be one of those decisions where people think &#8220;Does that *really* matter?&#8221;, but I&#8217;ve started to place my closing brace on the same line as the last declaration. The reason behind this is to improve the visual distinction between rules which helps when scanning quickly through a large CSS document.</p>
<p>Previously, I&#8217;d place the closing brace on it&#8217;s own line, like this:</p>
<div class="codecolorer-container css default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">h1 <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">2em</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.5em</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span>0 0 <span style="color: #933;">18px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <br />
<span style="color: #00AA00;">&#125;</span><br />
h2 <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.333em</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.125em</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.125em</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <br />
<span style="color: #00AA00;">&#125;</span><br />
h3 <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.1667em</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.2857em</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.2857em</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p>
Now that the brace follows the last declaration it improves the spacing between rules, or course I could simply add another line after each rule, but that simply adds to the filesize and needlessly pads out the document. This method also places all of the selectors on their own tab level which helps when scanning through to locate a selector.</p>
<div class="codecolorer-container css default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">h1 <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">2em</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.5em</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span>0 0 <span style="color: #933;">18px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br />
<br />
h2 <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.333em</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.125em</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.125em</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br />
<br />
h3 <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.1667em</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.2857em</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.2857em</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p></p>
<h3>Closing semi-colon</h3>
<p>The closing semi-colon on the last declaration of a CSS rule is optional, while some people will no-doubt argue that dropping this will lead to smaller filesizes I&#8217;d always argue that long-term maintainability is more important, especially on larger projects with multiple developers or for projects which are handed to clients to maintain themselves.</p>
<p>By keeping the closing semi-colon in place anyone can quickly dive into the file and add rules without needing to worry about where the semi-colons are.</p>
<h3>Further reading</h3>
<p>I&#8217;ve only skimmed the surface of CSS coding standards to highlight some of the ways I like to do things, If you&#8217;re interested in making your CSS more readable, and especially more maintainable then I&#8217;d highly recommend you read the PDF version of this BarCamp presentation by Natalie Downe on <a href="http://natbat.net/2008/Sep/28/css-systems/">&#8220;CSS Systems for writing maintainable CSS&#8221;</a> which is a must-read and chock-full of excellent advice.</p>
<h3>What do you do?</h3>
<p>Do you have any personal preferences when it comes to writing your CSS? Feel free to hit the comment box below and let me know!</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeepowered.co.uk/2010/01/css-coding-standards/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>New stylings</title>
		<link>http://coffeepowered.co.uk/2009/08/new-stylings/</link>
		<comments>http://coffeepowered.co.uk/2009/08/new-stylings/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 19:25:54 +0000</pubDate>
		<dc:creator>Stanton</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[coffeepowered]]></category>
		<category><![CDATA[leather]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://coffeepowered.co.uk/blog/?p=103</guid>
		<description><![CDATA[As you can see, I&#8217;ve been tinkering with a new theme for the blog! Please feel free to let me know what you think! I&#8217;ll be using the same leathery style on the Coffeepowered frontpage also, once the blog is done Disclaimer! This theme isn&#8217;t finished, isn&#8217;t cross-browser tested and probably doesn&#8217;t validate. It&#8217;s to [...]]]></description>
			<content:encoded><![CDATA[<p>As you can see, I&#8217;ve been tinkering with a new theme for the blog! Please feel free to let me know what you think! I&#8217;ll be using the same leathery style on the Coffeepowered frontpage also, once the blog is done <img src='http://coffeepowered.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Disclaimer!</h3>
<p>This theme isn&#8217;t finished, isn&#8217;t cross-browser tested and probably doesn&#8217;t validate. It&#8217;s to be considered a work in progress which I was just too impatient to keep hidden.</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeepowered.co.uk/2009/08/new-stylings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Printable logos</title>
		<link>http://coffeepowered.co.uk/2009/08/printable-logos/</link>
		<comments>http://coffeepowered.co.uk/2009/08/printable-logos/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 18:33:57 +0000</pubDate>
		<dc:creator>Stanton</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Tips and tricks]]></category>

		<guid isPermaLink="false">http://coffeepowered.co.uk/blog/?p=50</guid>
		<description><![CDATA[This is one of those tips where I think &#8220;surely everyone knows this already?&#8221; but it&#8217;s a solution to a problem that I found which was quite neat and I&#8217;ll use all the time from now on. When it comes to embedding a company logo into a page, quite often the logo won&#8217;t be suitable [...]]]></description>
			<content:encoded><![CDATA[<p>This is one of those tips where I think &#8220;surely everyone knows this already?&#8221; but it&#8217;s a solution to a problem that I found which was quite neat and I&#8217;ll use all the time from now on.</p>
<p>When it comes to embedding a company logo into a page, quite often the logo won&#8217;t be suitable for print. For example, the website may be dark and the logo might be light and while this works fine when the site is viewed on-screen, it can look out of place when used in a print stylesheet or if the site is viewed with CSS disabled.</p>
<p>While building the new University of Leeds corporate website we got to the stage where we needed to build our print stylesheet, the page header has a white logo on a dark background.</p>
<p>Originally, the logo was inserted into the design using a standard CSS image-replacement technique:</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;logo&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;&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;http://www.leeds.ac.uk&quot;</span>&gt;</span>University of Leeds<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></div></td></tr></tbody></table></div>
<div class="codecolorer-container css default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #cc00cc;">#logo</span> a <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">logo_black.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">53px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">text-indent</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-9999px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">184px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<div id="attachment_59" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-59" title="University of Leeds header" src="http://coffeepowered.co.uk/wp-content/uploads/2009/08/University-of-Leeds_1249982729324.png" alt="Light logo on dark header" width="500" height="272" /><p class="wp-caption-text">Light logo on dark header</p></div>
<p>When you&#8217;re using a CSS image replacement, the image doesn&#8217;t exist in the markup, it&#8217;s applied as a background image and only the h2 text is displayed. We toyed with the idea of using the same image replacement technique in our print.css, replacing the logo with the black-on-white variant. This quickly fell on it&#8217;s arse, as most browsers are set by default to not print background images as seen below.</p>
<div id="attachment_72" class="wp-caption aligncenter" style="width: 209px"><img class="size-full wp-image-72" title="University of Leeds - no logo - no css" src="http://coffeepowered.co.uk/wp-content/uploads/2009/08/universityofleeds_nologo_nocss.png" alt="Image replacement with CSS disabled" width="199" height="319" /><p class="wp-caption-text">Image replacement with CSS disabled</p></div>
<h3>Putting the image back into the markup</h3>
<p>In order to get around this, we decided to stop using image replacement and go back to having the image in the markup. Initially I was curious as to the effect of this from an SEO standpoint and had a quick chat with an <a href="http://thehodge.co.uk">SEO friend</a> about the disadvantage of not having our corporate logo as a heading. He pointed out that there would be no disadvantage to us as we&#8217;re not trying to rank on the &#8216;University of Leeds&#8217; as a keyword and that as it&#8217;s mentioned everywhere else in the thousands of pages we manage, it&#8217;s not going to make a difference. (Your mileage may vary and this might not be suitable for everyone)</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;logo&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;logo_black.png&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;University of Leeds logo&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></div></td></tr></tbody></table></div>
<h3>Doing it bass-ackwards</h3>
<p>Once we&#8217;d put the image back into the markup, it showed up as expected in our print stylesheet, however our white-on-black logo wasn&#8217;t really suited.</p>
<div id="attachment_63" class="wp-caption aligncenter" style="width: 209px"><img class="size-full wp-image-63" title="University of Leeds - CSS disabled" src="http://coffeepowered.co.uk/wp-content/uploads/2009/08/universityofleeds_dark_nocss1.png" alt="Same logo with CSS disabled" width="199" height="320" /><p class="wp-caption-text">Same logo with CSS disabled</p></div>
<p>We already knew that we couldn&#8217;t use CSS to replace this with the black-on-white logo in our print.css, so we decided to do it the other way round. Rather than the have the white-on-black logo as default, we changed to having the black-on white as the default meaning that our no-css and print.css got the correct logo. We used a &#8220;hidden&#8221; class so we could hide the default image and a CSS overlay on the anchor tag to bring back our white-on-black logo to fit in with the rest of the design.</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;logo&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <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;http://www.leeds.ac.uk&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;logo_white.png&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;University of Leeds logo&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></div></td></tr></tbody></table></div>
<div class="codecolorer-container css default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #cc00cc;">#logo</span> a <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">logo_black.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
.<span style="color: #993333;">hidden</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <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><br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<div id="attachment_59" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-59" title="University of Leeds header" src="http://coffeepowered.co.uk/wp-content/uploads/2009/08/University-of-Leeds_1249982729324.png" alt="Light logo on dark header" width="500" height="272" /><p class="wp-caption-text">CSS enabled</p></div>
<div id="attachment_61" class="wp-caption aligncenter" style="width: 209px"><img class="size-full wp-image-61" title="University of Leeds - No CSS" src="http://coffeepowered.co.uk/wp-content/uploads/2009/08/universityofleeds_nocss.png" alt="Black on white logo" width="199" height="320" /><p class="wp-caption-text">CSS disabled / print stylesheet</p></div>
<h3>Conclusion</h3>
<p>Because most browsers disable background images when printing by default, you need to be aware that any important images that are using image-replacement techniques may not work. Working around these limitations is possible with a bit of planning.</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeepowered.co.uk/2009/08/printable-logos/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
