<?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>logon2 Blog &#187; CSS</title>
	<atom:link href="http://www.logon2.com.au/blog/archive/category/coding/css-coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.logon2.com.au/blog</link>
	<description>Better use of the web for everybody</description>
	<lastBuildDate>Tue, 13 Jul 2010 12:44:29 +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>Processing PHP Code in CSS files to Improve Productivity and Browser Cross-Compatibility (using Apache)</title>
		<link>http://www.logon2.com.au/blog/archive/coding/coding-php/processing-php-code-in-css-files-to-improve-productivity-and-browser-cross-compatibility-using-apache/</link>
		<comments>http://www.logon2.com.au/blog/archive/coding/coding-php/processing-php-code-in-css-files-to-improve-productivity-and-browser-cross-compatibility-using-apache/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 08:49:59 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[colour]]></category>
		<category><![CDATA[compatibility]]></category>
		<category><![CDATA[cross-browser]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[execute]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[processing]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.logon2.com.au/blog/?p=167</guid>
		<description><![CDATA[It&#8217;s possible that you&#8217;re thinking, &#8220;Processing PHP in CSS? That&#8217;s plain stinks.,&#8221; just from reading the heading. It does stink, but so does maintaining two CSS files, updating your colour scheme manually (or even by sed), changing common dimensions, and all the other crap that goes with static files. Think about it this way &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s possible that you&#8217;re thinking, &#8220;Processing PHP in CSS? That&#8217;s plain stinks.,&#8221; just from reading the heading. It does stink, but so does maintaining two CSS files, updating your colour scheme manually (or even by sed), changing common dimensions, and all the other crap that goes with static files. Think about it this way &#8211; would you build a site out of many HTML files or would you use some kind of template system (like <a href="http://www.logon2.com.au/blog/coding/pretty-smarties/">Pretty Smarties</a>)? By now I hope you&#8217;re less sceptical. If you&#8217;re interested, please read on.</p>
<h3>Executing PHP in CSS Files</h3>
<p>In order to parse and execute PHP in a CSS file, all you have to do is tell Apache to treat CSS files as PHP, and just make sure you tell the browser that it&#8217;s NOT text/html (default mime type) but CSS.Very easy.</p>
<h4>.htaccess File</h4>
<p>Place a .htaccess file in the directory of the CSS file (if there isn&#8217;t one already). Simply add a directive to process the PHP in CSS files. Depending on your configuration, you might have to use a different directive. Here are the two most common ones I&#8217;ve been able to use:<br />
Mod_PHP (Apache PHP Module)</p>
<pre>
#MOD PHP
<FilesMatch "\.(css)$">
	SetHandler application/x-httpd-php
</FilesMatch>
</pre>
<p>Others:</p>
<pre>
#OTHERS
AddType application/x-httpd-php5 .css
</pre>
<p><em>(If you&#8217;re using php4, use x-httpd-php4)</em></p>
<h4>CSS (and PHP) File</h4>
<p>I recommend using this code just to test that your Apache directive is working. Hopefully this example shows the potential use for  (server-side) executable code in CSS files.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&lt;?php
	//make sure the browser treats this as CSS
	header<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;Content-Type: text/css&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
&nbsp;
	//browser detection
	if <span style="color: #00AA00;">&#40;</span>strpos<span style="color: #00AA00;">&#40;</span>$_SERVER<span style="color: #00AA00;">&#91;</span><span style="color: #ff0000;">'HTTP_USER_AGENT'</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">,</span><span style="color: #ff0000;">&quot;Internet Explorer&quot;</span><span style="color: #00AA00;">&#41;</span> <span style="color: #00AA00;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">&#41;</span> <span style="color: #00AA00;">&#123;</span>
		$internet_explorer <span style="color: #00AA00;">=</span> true<span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span>
&nbsp;
	$baseColour <span style="color: #00AA00;">=</span> <span style="color: #ff0000;">&quot;#F3AA9C&quot;</span><span style="color: #00AA00;">;</span>
	$secondaryColour <span style="color: #00AA00;">=</span> <span style="color: #ff0000;">&quot;#CCAF1F&quot;</span><span style="color: #00AA00;">;</span>
	$foregroundColour <span style="color: #00AA00;">=</span> <span style="color: #ff0000;">&quot;#FFFFFF&quot;</span><span style="color: #00AA00;">;</span>
	$moduleWidth <span style="color: #00AA00;">=</span> <span style="color: #ff0000;">&quot;125px&quot;</span><span style="color: #00AA00;">;</span>
?<span style="color: #00AA00;">&gt;</span>
&nbsp;
<span style="color: #cc00cc;">#content</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span>&lt;?php echo $baseColour<span style="color: #00AA00;">;</span> ?<span style="color: #00AA00;">&gt;;</span>
	colour<span style="color: #00AA00;">:</span>&lt;?php echo $foregroundColour ?<span style="color: #00AA00;">&gt;;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#sideBar</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> &lt;?php echo $secondaryColour<span style="color: #00AA00;">;</span> ?<span style="color: #00AA00;">&gt;;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span>&lt;?php echo $baseColour<span style="color: #00AA00;">;</span> ?<span style="color: #00AA00;">&gt;;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span>&lt;?php echo $moduleWidth<span style="color: #00AA00;">;</span> ?<span style="color: #00AA00;">&gt;;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#footer</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> &lt;?php echo $secondaryColour<span style="color: #00AA00;">;</span> ?<span style="color: #00AA00;">&gt;;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span>&lt;?php echo $foregroundColour<span style="color: #00AA00;">;</span> ?<span style="color: #00AA00;">&gt;;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><em>Obviously mixing PHP and CSS stuffs up syntax highlighting sorry.</em></p>
<h4>Caveat</h4>
<p>Most browsers will download the CSS file on every pageload &#8211; it&#8217;s not too difficult to implement cache-control, but I haven&#8217;t done it for this code.</p>
<hr />
Code hard or &#8230; er&#8230; code home.</p>
<h3>Related Posts:</h3><ul class="related_post"><li><a href="http://www.logon2.com.au/blog/archive/coding/pretty-smarties/pretty-smarties-05-pretty-urls-smarty-templates-and-faster-web-design/" title="Pretty Smarties 0.5 &#8211; Pretty URLs, Smarty Templates and Faster Web Design">Pretty Smarties 0.5 &#8211; Pretty URLs, Smarty Templates and Faster Web Design</a></li><li><a href="http://www.logon2.com.au/blog/archive/myspace/choose-myspace-comment-colors-fonts-and-sizes/" title="Choose MySpace Comment Colors, Fonts and Sizes">Choose MySpace Comment Colors, Fonts and Sizes</a></li><li><a href="http://www.logon2.com.au/blog/archive/web-design/pngs-have-different-colours-in-different-browsers/" title="PNGs Have Different Colours in Different Browsers?">PNGs Have Different Colours in Different Browsers?</a></li><li><a href="http://www.logon2.com.au/blog/archive/web-design/introducing-the-lovely-caption-maker/" title="Introducing the Lovely Caption Maker">Introducing the Lovely Caption Maker</a></li><li><a href="http://www.logon2.com.au/blog/archive/troubleshooting/accessible-valid-dropdown-menu-or-popup-menu-using-css-and-semantic-html/" title="Accessible, Valid Dropdown Menu or Popup Menu using CSS and Semantic HTML">Accessible, Valid Dropdown Menu or Popup Menu using CSS and Semantic HTML</a></li><li><a href="http://www.logon2.com.au/blog/archive/coding/coding-php/extract-get-variables-from-url-string-to-array-php-function/" title="Extract GET Variables from URL String to Array &#8211; PHP Function">Extract GET Variables from URL String to Array &#8211; PHP Function</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.logon2.com.au/blog/archive/coding/coding-php/processing-php-code-in-css-files-to-improve-productivity-and-browser-cross-compatibility-using-apache/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Nicer Footer Navigation with pseudo-selectors</title>
		<link>http://www.logon2.com.au/blog/archive/web-design/nicer-footer-navigation-with-pseudo-selectors/</link>
		<comments>http://www.logon2.com.au/blog/archive/web-design/nicer-footer-navigation-with-pseudo-selectors/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 13:31:46 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[accessibility]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[first-child]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[pseudo-selectors]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://www.logon2.com.au/blog/?p=141</guid>
		<description><![CDATA[A common website design feature is the inclusion of navigation links (top level or otherwise) in the footer. Often, links are separated by a hyphen ( &#8211; ) or a pipe ( &#124; ). It&#8217;s very easy to enter these separators in the markup, like so: &#60;a href=&#34;/&#34;&#62;Home&#60;/a&#62; &#124; &#60;a href=&#34;/about/&#34;&#62;About&#60;/a&#62; &#124; &#60;a href=&#34;/contact/&#34;&#62;Contact&#60;/a&#62; I [...]]]></description>
			<content:encoded><![CDATA[<p>A common website design feature is the inclusion of navigation links (top level or otherwise) in the footer. Often, links are separated by a hyphen ( &#8211; ) or a pipe ( | ). It&#8217;s very easy to enter these separators in the markup, like so:</p>

<div class="wp_syntax"><div class="code"><pre class="xhtml" style="font-family:monospace;">&lt;a href=&quot;/&quot;&gt;Home&lt;/a&gt; |
&lt;a href=&quot;/about/&quot;&gt;About&lt;/a&gt; |
&lt;a href=&quot;/contact/&quot;&gt;Contact&lt;/a&gt;</pre></div></div>

<p>I guess it&#8217;s OK to do that, but it&#8217;s not really great practice because the pipes ( | ) are not actually part of the content and are only meant for presentation, so they shouldn&#8217;t really be part of the HTML. Another problem with this is that it&#8217;s inflexible. What if we want more space between the pipes and the links? Do we enter a bunch of &#8220;&amp;nbsp;&#8221;s? That&#8217;s ugly<a href="#note-1">^</a>.</p>
<p>We can use the CSS border property to add the separators for us by adding a left-border to each of the links.</p>
<p>&#8220;<em>But what about the first link?</em>&#8220;</p>
<p>The answer is the<strong> :first-child</strong> CSS pseudo-selector. It allows us to define CSS properties to the first element of its kind within a container. So in this instance, we can apply no border to the first child. Here&#8217;s how the lot would look:</p>

<div class="wp_syntax"><div class="code"><pre class="xhtml" style="font-family:monospace;">&lt;ul id=&quot;footer&quot;&gt;
	&lt;li&gt;&lt;a href=&quot;/&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;/about/&quot;&gt;About&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;/contact/&quot;&gt;Contact&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">ul<span style="color: #cc00cc;">#footer</span> li <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">inline</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* so they display horizontally */</span>
    <span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* our 'pipe' */</span>
    <span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">1em</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">padding-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">1em</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* here it is, the first-child pseudo-selector */</span>
ul<span style="color: #cc00cc;">#footer</span> li<span style="color: #3333ff;">:first-child </span><span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* no 'pipe' before the first element */</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>It requires a bit more coding initially but it&#8217;s more elegant because it separates concerns and it&#8217;s also more accessible for screen readers and our friendly neighbourhood search engines<a href="#note-2">*</a>.</p>
<p style="font-size:x-small">
<a name="note-1">^</a> I know, this very site doesn&#8217;t follow this site doesn&#8217;t follow these practices. I&#8217;m a hypocrite!<br />
<a name="note-2">*</a> FACT</p>
<h3>Related Posts:</h3><ul class="related_post"><li><a href="http://www.logon2.com.au/blog/archive/coding/pretty-smarties/pretty-smarties-05-pretty-urls-smarty-templates-and-faster-web-design/" title="Pretty Smarties 0.5 &#8211; Pretty URLs, Smarty Templates and Faster Web Design">Pretty Smarties 0.5 &#8211; Pretty URLs, Smarty Templates and Faster Web Design</a></li><li><a href="http://www.logon2.com.au/blog/archive/web-design/introducing-the-lovely-caption-maker/" title="Introducing the Lovely Caption Maker">Introducing the Lovely Caption Maker</a></li><li><a href="http://www.logon2.com.au/blog/archive/troubleshooting/accessible-valid-dropdown-menu-or-popup-menu-using-css-and-semantic-html/" title="Accessible, Valid Dropdown Menu or Popup Menu using CSS and Semantic HTML">Accessible, Valid Dropdown Menu or Popup Menu using CSS and Semantic HTML</a></li><li><a href="http://www.logon2.com.au/blog/archive/coding/coding-php/processing-php-code-in-css-files-to-improve-productivity-and-browser-cross-compatibility-using-apache/" title="Processing PHP Code in CSS files to Improve Productivity and Browser Cross-Compatibility (using Apache)">Processing PHP Code in CSS files to Improve Productivity and Browser Cross-Compatibility (using Apache)</a></li><li><a href="http://www.logon2.com.au/blog/archive/web-design/pngs-have-different-colours-in-different-browsers/" title="PNGs Have Different Colours in Different Browsers?">PNGs Have Different Colours in Different Browsers?</a></li><li><a href="http://www.logon2.com.au/blog/archive/web-design/php-apache-mod-rewrite-tutorial/" title="Clean URLs Using Apache&#8217;s mod_rewrite and PHP &#8211; Beginner&#8217;s Tutorial">Clean URLs Using Apache&#8217;s mod_rewrite and PHP &#8211; Beginner&#8217;s Tutorial</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.logon2.com.au/blog/archive/web-design/nicer-footer-navigation-with-pseudo-selectors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PNGs Have Different Colours in Different Browsers?</title>
		<link>http://www.logon2.com.au/blog/archive/web-design/pngs-have-different-colours-in-different-browsers/</link>
		<comments>http://www.logon2.com.au/blog/archive/web-design/pngs-have-different-colours-in-different-browsers/#comments</comments>
		<pubDate>Wed, 06 May 2009 23:03:25 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[colour]]></category>
		<category><![CDATA[consistency]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[different]]></category>
		<category><![CDATA[internet-explorer]]></category>
		<category><![CDATA[png]]></category>
		<category><![CDATA[solutions]]></category>

		<guid isPermaLink="false">http://www.logon2.com.au/blog/?p=106</guid>
		<description><![CDATA[Inconsistent PNGs Lovely Caption Maker Have you ever been working on a website and noticed that in certain browsers a background image isn&#8217;t blending properly with one of your background colours or another image? This phenomenon occurs in Internet Explorer and it&#8217;s caused by metadata in the PNG file itself. There&#8217;s a great program that [...]]]></description>
			<content:encoded><![CDATA[<div style="float:left; position:relative; margin:5px; width:140px; height:174px;" >
		<img style="position:relative;" src="http://www.logon2.com.au/blog/wp-content/png-gamma-problem.jpg" alt="Inconsistent PNGs" width="140" height="174"></p>
<div class="caption" style="position:absolute; width:120px; bottom:0; left:0;	margin:5px;	padding-left:5px; padding-right:5px; background:#5f5b4f; opacity: 0.7; -moz-opacity: 0.7; filter: alpha(opacity=70);">
<h3 style="margin-bottom:0.25em; margin-top:0.25em; color:#FFFFFF;">Inconsistent PNGs</h3>
</p></div>
<div><a style="display:block; position:absolute;right:0;top:0;width:32px;height:7px;background:url(http://www.logon2.com.au/images/logon2_badge.gif) no-repeat;margin:2px;" href="http://www.logon2.com.au/tools/lovely-caption-maker-css-transparent-overlay/"><span style="display:none;">Lovely Caption Maker</span></a></div>
</div>
<p>Have you ever been working on a website and noticed that in <em>certain browsers </em>a background image isn&#8217;t blending properly with one of your background colours or another image? This phenomenon occurs in Internet Explorer and it&#8217;s caused by metadata in the PNG file itself. There&#8217;s a great program that solves this problem without any hacks.</p>
<p>The problem? Gamma. Some programs (like Adobe ImageReady) export PNGs with Gamma metadata. While I&#8217;m sure this metadata could be useful, it causes colour inconsistencies in Internet Explorer (6 and 7 confirmed.)</p>
<p>Solution &#8211; <a href="http://entropymine.com/jason/tweakpng/">TweakPNG</a>. Download this Windows program &#8211; consistent PNGs are X steps away:</p>
<ol>
<li>Open TweakPNG</li>
<li>Load the problem PNG into TweakPNG (Either drag and drop or File &gt; Open)</li>
<li>In the list of &#8220;Chunk&#8221;s, select &#8220;gAMA&#8221; and press the delete key.</li>
<li>Save (Ctrl+S or File &gt; Save)</li>
</ol>
<p style="text-align: center;"><img src="http://www.logon2.com.au/blog/wp-content/tweakpng.png" alt="TweakPNG" width="225" height="120" /></p>
<p>Done.</p>
<h3>Related Posts:</h3><ul class="related_post"><li><a href="http://www.logon2.com.au/blog/archive/troubleshooting/accessible-valid-dropdown-menu-or-popup-menu-using-css-and-semantic-html/" title="Accessible, Valid Dropdown Menu or Popup Menu using CSS and Semantic HTML">Accessible, Valid Dropdown Menu or Popup Menu using CSS and Semantic HTML</a></li><li><a href="http://www.logon2.com.au/blog/archive/coding/coding-php/processing-php-code-in-css-files-to-improve-productivity-and-browser-cross-compatibility-using-apache/" title="Processing PHP Code in CSS files to Improve Productivity and Browser Cross-Compatibility (using Apache)">Processing PHP Code in CSS files to Improve Productivity and Browser Cross-Compatibility (using Apache)</a></li><li><a href="http://www.logon2.com.au/blog/archive/web-design/making-your-site-stand-out-with-favicons/" title="Making Your Site Stand Out With Favicons">Making Your Site Stand Out With Favicons</a></li><li><a href="http://www.logon2.com.au/blog/archive/web-design/nicer-footer-navigation-with-pseudo-selectors/" title="Nicer Footer Navigation with pseudo-selectors">Nicer Footer Navigation with pseudo-selectors</a></li><li><a href="http://www.logon2.com.au/blog/archive/coding/pretty-smarties/pretty-smarties-05-pretty-urls-smarty-templates-and-faster-web-design/" title="Pretty Smarties 0.5 &#8211; Pretty URLs, Smarty Templates and Faster Web Design">Pretty Smarties 0.5 &#8211; Pretty URLs, Smarty Templates and Faster Web Design</a></li><li><a href="http://www.logon2.com.au/blog/archive/web-design/introducing-the-lovely-caption-maker/" title="Introducing the Lovely Caption Maker">Introducing the Lovely Caption Maker</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.logon2.com.au/blog/archive/web-design/pngs-have-different-colours-in-different-browsers/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Introducing the Lovely Caption Maker</title>
		<link>http://www.logon2.com.au/blog/archive/web-design/introducing-the-lovely-caption-maker/</link>
		<comments>http://www.logon2.com.au/blog/archive/web-design/introducing-the-lovely-caption-maker/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 21:35:42 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[accessible]]></category>
		<category><![CDATA[banner]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[lovely]]></category>
		<category><![CDATA[overlay]]></category>
		<category><![CDATA[ribbon]]></category>
		<category><![CDATA[sematic]]></category>
		<category><![CDATA[valid]]></category>

		<guid isPermaLink="false">http://www.logon2.com.au/blog/?p=103</guid>
		<description><![CDATA[A recent trend I&#8217;ve noticed on some Australian media websites has been evoking my interest for a few months now. Sites like The Age and Fox FM have started overlaying a lovely coloured banner with a caption over feature images. The great thing is, they&#8217;re not rendered but glorious SEO-friendly and accessible HTML and CSS. [...]]]></description>
			<content:encoded><![CDATA[<p>
<a href="http://www.logon2.com.au/tools/lovely-caption-maker-css-transparent-overlay/"><img align="right" title="Lovely Caption Maker - Valid Accessible SEO Friendly Transparent CSS Coloured Overlay Caption" src="http://www.logon2.com.au/blog/wp-content/lovely-caption-maker.png" alt="Lovely Caption Maker CSS Transparent Overlay" width="155" height="37" /></a>A recent trend I&#8217;ve noticed on some Australian media websites has been evoking my interest for a few months now. Sites like <a href="http://www.theage.com.au/" target="_blank">The Age</a> and <a href="http://www.foxfm.com.au/" target="_blank">Fox FM</a> have started overlaying a lovely coloured banner with a caption over feature images. The great thing is, they&#8217;re not rendered but glorious <em>SEO-friendly </em>and <em>accessible </em>HTML and CSS. I&#8217;m not surprised, however, since <a href="http://www.theage.com.au/" target="_blank">The Age</a> and <a href="http://www.foxfm.com.au/" target="_blank">Fox FM</a> have always been trend early adopters. <a href="http://www.abc.net.au/">The ABC </a>still beats them, though.
</p>

<p>
Unfortunately, this effect can&#8217;t be achieved without knowing and entering the width and height of an image &#8211; making it kind of tedious to implement. After deciding that I&#8217;d like to use it with wordpress posts, it was decided that a tool should be built. And then <a href="http://www.logon2.com.au/tools/lovely-caption-maker-css-transparent-overlay/">The Lovely Caption Maker</a> was born. Here&#8217;s an example of Lovely Caption Maker&#8217;s glory:
</p>

<style type="text/css">
.feature {
		position:relative;
		width:360px;
		height:480px;
	}
	
	.feature img {
		position:relative;
	}
	
	.feature .caption h3 {
		margin-bottom:0.25em;
		margin-top:0.25em;
	}
	
	.feature .caption p {
		margin-bottom:0.5em;
		margin-left:0.25em;
	}
	
	.feature .caption {
		position:absolute;
		width:340px; 
		bottom:0;
		left:0;
		
		margin:5px;
		
		padding-left:5px;
		padding-right:5px;

		color:#FFFFFF;
		background:#f4489a;
		
		opacity: 0.82;
		-moz-opacity: 0.82;
		filter: alpha(opacity=82);
	}
</style>

	<div class="feature">
		<img src="http://www.logon2.com.au/blog/wp-content/dsc01092.jpg" alt="This Is How We Party" width="360" height="480">
		<div class="caption">
			<h3>This Is How We Party</h3>			<p>Expressing ourselves on the last day of year twelve in 2006. Very sexy stuff.</p>		</div>
	</div>
<h3>Related Posts:</h3><ul class="related_post"><li><a href="http://www.logon2.com.au/blog/archive/coding/pretty-smarties/pretty-smarties-05-pretty-urls-smarty-templates-and-faster-web-design/" title="Pretty Smarties 0.5 &#8211; Pretty URLs, Smarty Templates and Faster Web Design">Pretty Smarties 0.5 &#8211; Pretty URLs, Smarty Templates and Faster Web Design</a></li><li><a href="http://www.logon2.com.au/blog/archive/coding/coding-php/processing-php-code-in-css-files-to-improve-productivity-and-browser-cross-compatibility-using-apache/" title="Processing PHP Code in CSS files to Improve Productivity and Browser Cross-Compatibility (using Apache)">Processing PHP Code in CSS files to Improve Productivity and Browser Cross-Compatibility (using Apache)</a></li><li><a href="http://www.logon2.com.au/blog/archive/web-design/nicer-footer-navigation-with-pseudo-selectors/" title="Nicer Footer Navigation with pseudo-selectors">Nicer Footer Navigation with pseudo-selectors</a></li><li><a href="http://www.logon2.com.au/blog/archive/troubleshooting/accessible-valid-dropdown-menu-or-popup-menu-using-css-and-semantic-html/" title="Accessible, Valid Dropdown Menu or Popup Menu using CSS and Semantic HTML">Accessible, Valid Dropdown Menu or Popup Menu using CSS and Semantic HTML</a></li><li><a href="http://www.logon2.com.au/blog/archive/web-design/xhtml-and-html5-compliant-flash-stop-using-embed-and-invalid-xhtmlhtml5/" title="XHTML and HTML5 Compliant Flash &#8211; Stop Using Embed and Invalid XHTML/HTML5">XHTML and HTML5 Compliant Flash &#8211; Stop Using Embed and Invalid XHTML/HTML5</a></li><li><a href="http://www.logon2.com.au/blog/archive/web-design/pngs-have-different-colours-in-different-browsers/" title="PNGs Have Different Colours in Different Browsers?">PNGs Have Different Colours in Different Browsers?</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.logon2.com.au/blog/archive/web-design/introducing-the-lovely-caption-maker/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

