<?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>MaggsWeb:7 &#187; CSS</title>
	<atom:link href="http://www.maggsweb.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.maggsweb.com</link>
	<description>www.maggsweb.com</description>
	<lastBuildDate>Sat, 21 Aug 2010 20:50:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Compressing CSS files &#8211; on the fly</title>
		<link>http://www.maggsweb.com/php/compressing-files-on-the-fly/</link>
		<comments>http://www.maggsweb.com/php/compressing-files-on-the-fly/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 07:30:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[compress]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[function]]></category>

		<guid isPermaLink="false">http://www.maggsweb.com/?p=978</guid>
		<description><![CDATA[I hate compressing CSS files as they become totally unreadable for editing. I end up keeping 2 versions, compressed and uncompressed, etc.. But how about compressing all your CSS files into one file, &#8216;on-the-fly&#8217;. Now that has solved the problem. ?View Code PHP&#60;?php &#160; header&#40;'Content-type: text/css'&#41;; &#160; ob_start&#40;&#34;compress&#34;&#41;; &#160; function compress&#40;$buffer&#41; &#123; /* remove comments [...]]]></description>
			<content:encoded><![CDATA[<p>I hate compressing CSS files as they become totally unreadable for editing.  I end up keeping 2 versions, compressed and uncompressed, etc..   But how about compressing all your CSS files into one file, &#8216;on-the-fly&#8217;.  Now that has solved the problem.</p>
<p><span id="more-978"></span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p978code3'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p9783"><td class="code" id="p978code3"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<a href="http://www.php.net/header" onclick="pageTracker._trackPageview('/outgoing/www.php.net/header?referer=');"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-type: text/css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<a href="http://www.php.net/ob_start" onclick="pageTracker._trackPageview('/outgoing/www.php.net/ob_start?referer=');"><span style="color: #990000;">ob_start</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;compress&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> compress<span style="color: #009900;">&#40;</span><span style="color: #000088;">$buffer</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">/* remove comments */</span>
  <span style="color: #000088;">$buffer</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace" onclick="pageTracker._trackPageview('/outgoing/www.php.net/preg_replace?referer=');"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'!/\*[^*]*\*+([^/][^*]*\*+)*/!'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$buffer</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">/* remove tabs, spaces, newlines, etc. */</span>
  <span style="color: #000088;">$buffer</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/str_replace" onclick="pageTracker._trackPageview('/outgoing/www.php.net/str_replace?referer=');"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/array" onclick="pageTracker._trackPageview('/outgoing/www.php.net/array?referer=');"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'  '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'    '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'    '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$buffer</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$buffer</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/* your css files */</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'master.css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'typography.css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'grid.css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'print.css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'handheld.css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<a href="http://www.php.net/ob_end_flush" onclick="pageTracker._trackPageview('/outgoing/www.php.net/ob_end_flush?referer=');"><span style="color: #990000;">ob_end_flush</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Use it like this :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p978code4'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p9784"><td class="code" id="p978code4"><pre class="html" style="font-family:monospace;">&lt;link rel=&quot;stylesheet&quot; href=&quot;style.php&quot; type=&quot;text/css&quot; media=&quot;all&quot;&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/php/compressing-files-on-the-fly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS NoWrap</title>
		<link>http://www.maggsweb.com/css/css-nowrap/</link>
		<comments>http://www.maggsweb.com/css/css-nowrap/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 08:35:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.maggsweb.com/?p=714</guid>
		<description><![CDATA[I used to use NOWRAP in my &#8216;s often to ensure that columns didn&#8217;t &#8216;wrap&#8217; their contents &#8211; but have struggled to find an equivalent in CSS for a white. Until now: Short and simple equivalent for NOWRAP in a TD&#8230;? ?View Code CSS&#160; &#60;style language='text/css'&#62; td.fixed-width &#123; white-space:nowrap; &#125; &#60;/style&#62;]]></description>
			<content:encoded><![CDATA[<p>I used to use NOWRAP in my
<td>&#8216;s often to ensure that columns didn&#8217;t &#8216;wrap&#8217; their contents &#8211; but have struggled to find an equivalent in CSS for a white.<br />
<span id="more-714"></span><br />
Until now:<br />
Short and simple equivalent for NOWRAP in a TD&#8230;?</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p714code6'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p7146"><td class="code" id="p714code6"><pre class="css" style="font-family:monospace;">&nbsp;
&lt;style language<span style="color: #00AA00;">=</span><span style="color: #ff0000;">'text/css'</span><span style="color: #00AA00;">&gt;</span>
  td.fixed-<span style="color: #000000; font-weight: bold;">width</span> <span style="color: #00AA00;">&#123;</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: #00AA00;">&#125;</span>
  &lt;/style<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/css/css-nowrap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS &#8216;content&#8217; attribute</title>
		<link>http://www.maggsweb.com/css/css-content-attribute/</link>
		<comments>http://www.maggsweb.com/css/css-content-attribute/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 18:49:20 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://tech.maggsweb.co.uk/?p=300</guid>
		<description><![CDATA[This is a new one, and pretty cool.  The &#8216;content&#8217; attribute automatically adds code / text / attributes to the start or end of any tag, depending on the pseudo class. For example: ?View Code CSS&#160; a:after &#123; content: &#34;&#34; attr&#40;href&#41; &#34;&#34;; &#125; &#160; a.external:after&#123; content: &#34;(Link opens in a new window)&#34;; &#125; &#160; a.pdf:before [...]]]></description>
			<content:encoded><![CDATA[<p>This is a new one, and pretty cool.  The &#8216;content&#8217; attribute automatically adds code / text / attributes to the start or end of any tag, depending on the pseudo class.</p>
<p><span id="more-300"></span></p>
<p>For example:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p300code8'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3008"><td class="code" id="p300code8"><pre class="css" style="font-family:monospace;">&nbsp;
a<span style="color: #3333ff;">:after </span><span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">content</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;&quot;</span> attr<span style="color: #00AA00;">&#40;</span>href<span style="color: #00AA00;">&#41;</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
a<span style="color: #6666ff;">.external</span><span style="color: #3333ff;">:after</span><span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">content</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;(Link opens in a new window)&quot;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
a<span style="color: #6666ff;">.pdf</span><span style="color: #3333ff;">:before </span><span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">content</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;&lt;img src='/img/abobe-icon.gif' width='16' height='16' border='0'&gt;&quot;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<ol>
<li>Would automatically add the content of the &#8216;href&#8217; attribute of the link code to the end (because we used &#8216;:after&#8217;) of the link text.</li>
<li>Would automatically add the quoted text to the end of the link text.  See how this is applied to a &#8216;class&#8217; of &#8216;external&#8217;.</li>
<li>This one adds an icon to the beginning of the link text, and is controlled by the &#8216;class&#8217;.  Imagine having classes for each type of document link&#8230;..</li>
</ol>
<p>Web 2.0?  Nah, this is CSS3!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/css/css-content-attribute/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS fixes for IE, using Javascript</title>
		<link>http://www.maggsweb.com/css/css-fixes-for-ie-using-javascript/</link>
		<comments>http://www.maggsweb.com/css/css-fixes-for-ie-using-javascript/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 09:54:16 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://tech.maggsweb.co.uk/?p=217</guid>
		<description><![CDATA[Some CSS effects don&#8217;t work in IE, damn them, so that leaves 2 options. Either forget that you have coded some nice roll-over effects that the majority of people wont see&#8230; Or, add an IE-specific javascript fix. ?View Code CSS&#60;!--&#91;if IE&#93;&#62; &#60;script type=&#34;text/javascript&#34; src=&#34;/content/iehover-fix.js&#34;&#62;&#60;!-- ---&#62;&#60;/script&#62; &#60;!&#91;endif&#93;--&#62;]]></description>
			<content:encoded><![CDATA[<p>Some CSS effects don&#8217;t work in IE, damn them, so that leaves 2 options.</p>
<p>Either forget that you have coded some nice roll-over effects that the majority of people wont see&#8230;</p>
<p>Or, add an IE-specific javascript fix.<br />
<span id="more-217"></span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p217code10'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p21710"><td class="code" id="p217code10"><pre class="css" style="font-family:monospace;">&lt;!--<span style="color: #00AA00;">&#91;</span>if IE<span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">&gt;</span>
&lt;script type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> src<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;/content/iehover-fix.js&quot;</span><span style="color: #00AA00;">&gt;</span>&lt;!-- ---<span style="color: #00AA00;">&gt;</span>&lt;/script<span style="color: #00AA00;">&gt;</span>
&lt;!<span style="color: #00AA00;">&#91;</span>endif<span style="color: #00AA00;">&#93;</span>--<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/css/css-fixes-for-ie-using-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS3 and Rounded borders&#8230;</title>
		<link>http://www.maggsweb.com/css/css3-and-rounded-borders/</link>
		<comments>http://www.maggsweb.com/css/css3-and-rounded-borders/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 08:16:37 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://tech.maggsweb.co.uk/?p=198</guid>
		<description><![CDATA[&#8230;but still not on IE. ?View Code CSS&#60;div style=&#34; background-color: #ccc; -moz-border-radius: 5px; -webkit-border-radius: 5px; border: 1px solid #000; padding: 10px;&#34;&#62; &#60;/div&#62; -moz-border-radius-topleft -webkit-border-top-left-radius -moz-border-radius-topright -webkit-border-top-right-radius -moz-border-radius-bottomleft -webkit-border-bottom-left-radius -moz-border-radius-bottomright -webkit-border-bottom-right-radius]]></description>
			<content:encoded><![CDATA[<h3>&#8230;but still not on IE.</h3>
<p><span id="more-198"></span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p198code12'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p19812"><td class="code" id="p198code12"><pre class="css" style="font-family:monospace;">&lt;div style<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot; background-color: #ccc;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border: 1px solid #000;
padding: 10px;&quot;</span><span style="color: #00AA00;">&gt;</span>
&lt;/div<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>

<p>-moz-border-radius-topleft<br />
-webkit-border-top-left-radius<br />
-moz-border-radius-topright<br />
-webkit-border-top-right-radius<br />
-moz-border-radius-bottomleft<br />
-webkit-border-bottom-left-radius<br />
-moz-border-radius-bottomright<br />
-webkit-border-bottom-right-radius</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/css/css3-and-rounded-borders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Expressions in CSS / IE fix</title>
		<link>http://www.maggsweb.com/css/ie-fix/</link>
		<comments>http://www.maggsweb.com/css/ie-fix/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 07:09:15 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[expressions]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://tech.maggsweb.co.uk/?p=173</guid>
		<description><![CDATA[This wont pass CSS validation, but its usefull to know that expressions can be added into css. ?View Code CSS/* IE FIX */ #div &#123; overflow-x: auto; overflow-y: hidden; padding-bottom: expression&#40;this.scrollWidth &#38;gt; this.offsetWidth ? 15 : 0&#41;; &#125;]]></description>
			<content:encoded><![CDATA[<p>This wont pass CSS validation, but its usefull to know that expressions can be added into css.<br />
<span id="more-173"></span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p173code14'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p17314"><td class="code" id="p173code14"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* IE FIX */</span>
<span style="color: #cc00cc;">#div</span> <span style="color: #00AA00;">&#123;</span>
  overflow-x<span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
  overflow-y<span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">padding-bottom</span><span style="color: #00AA00;">:</span> expression<span style="color: #00AA00;">&#40;</span>this<span style="color: #6666ff;">.scrollWidth</span> &amp;gt<span style="color: #00AA00;">;</span> this<span style="color: #6666ff;">.offsetWidth</span> ? <span style="color: #cc66cc;">15</span> <span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/css/ie-fix/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Head in the clouds? Tag yourself.</title>
		<link>http://www.maggsweb.com/php/head-in-the-clouds-tag-yourself/</link>
		<comments>http://www.maggsweb.com/php/head-in-the-clouds-tag-yourself/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 12:21:21 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[tag cloud]]></category>

		<guid isPermaLink="false">http://www.cmaggs.co.uk/?p=42</guid>
		<description><![CDATA[I have been looking for a &#8216;simple&#8217; tag cloud generator that will parse content from MySQL for ages and couldn&#8217;t find one. So I adapted &#8211; and heavily modified (reduced) &#8211; and CSS&#8217;d &#8211; the best one that I could find. It turned out nice and simple. ?View Code CSS .size9 &#123; color: #000; font-size: [...]]]></description>
			<content:encoded><![CDATA[<p>I have been looking for a &#8216;simple&#8217; tag cloud generator that will parse content from MySQL for ages and couldn&#8217;t find one.  So I adapted &#8211; and heavily modified (reduced) &#8211; and CSS&#8217;d &#8211; the best one that I could find.  It turned out nice and simple.<br />
<span id="more-273"></span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p273code17'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p27317"><td class="code" id="p273code17"><pre class="css" style="font-family:monospace;">  <span style="color: #6666ff;">.size9</span> <span style="color: #00AA00;">&#123;</span>	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">26px</span><span style="color: #00AA00;">;</span>	 <span style="color: #00AA00;">&#125;</span>
  <span style="color: #6666ff;">.size8</span> <span style="color: #00AA00;">&#123;</span> 	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#111</span><span style="color: #00AA00;">;</span>	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">24px</span><span style="color: #00AA00;">;</span>	 <span style="color: #00AA00;">&#125;</span>
  <span style="color: #6666ff;">.size7</span> <span style="color: #00AA00;">&#123;</span>	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#222</span><span style="color: #00AA00;">;</span>	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">22px</span><span style="color: #00AA00;">;</span>	 <span style="color: #00AA00;">&#125;</span>
  <span style="color: #6666ff;">.size6</span> <span style="color: #00AA00;">&#123;</span>	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#333</span><span style="color: #00AA00;">;</span>	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>	<span style="color: #00AA00;">&#125;</span>
  <span style="color: #6666ff;">.size5</span> <span style="color: #00AA00;">&#123;</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;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">18px</span><span style="color: #00AA00;">;</span>	<span style="color: #00AA00;">&#125;</span>
  <span style="color: #6666ff;">.size4</span> <span style="color: #00AA00;">&#123;</span>	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#555</span><span style="color: #00AA00;">;</span>	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">16px</span><span style="color: #00AA00;">;</span>	  <span style="color: #00AA00;">&#125;</span>
  <span style="color: #6666ff;">.size3</span> <span style="color: #00AA00;">&#123;</span>	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#666</span><span style="color: #00AA00;">;</span>	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">14px</span><span style="color: #00AA00;">;</span>	  <span style="color: #00AA00;">&#125;</span>
  <span style="color: #6666ff;">.size2</span> <span style="color: #00AA00;">&#123;</span>	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#777</span><span style="color: #00AA00;">;</span>	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>	  <span style="color: #00AA00;">&#125;</span>
  <span style="color: #6666ff;">.size1</span> <span style="color: #00AA00;">&#123;</span>	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#888</span><span style="color: #00AA00;">;</span>	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">8px</span><span style="color: #00AA00;">;</span>	  <span style="color: #00AA00;">&#125;</span>
  <span style="color: #6666ff;">.size0</span> <span style="color: #00AA00;">&#123;</span>	<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>	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span>	  <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p><br/></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p273code18'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p27318"><td class="code" id="p273code18"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000088;">$terms</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array" onclick="pageTracker._trackPageview('/outgoing/www.php.net/array?referer=');"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$maximum</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_query" onclick="pageTracker._trackPageview('/outgoing/www.php.net/mysql_query?referer=');"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT word, count FROM [tablename] WHERE display = '1'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// could add LIMIT, SORT, etc.. if required</span>
&nbsp;
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_fetch_array" onclick="pageTracker._trackPageview('/outgoing/www.php.net/mysql_fetch_array?referer=');"><span style="color: #990000;">mysql_fetch_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">//create vars</span>
    <span style="color: #000088;">$word</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'word'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'count'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// set 'maximum' from counter</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$count</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$maximum</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$maximum</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$count</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//create array</span>
    <span style="color: #000088;">$elements</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array" onclick="pageTracker._trackPageview('/outgoing/www.php.net/array?referer=');"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'word'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$word</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'count'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$count</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//random</span>
<span style="color: #666666; font-style: italic;">//shuffle($elements);</span>
<span style="color: #666666; font-style: italic;">//alphabetical</span>
<a href="http://www.php.net/sort" onclick="pageTracker._trackPageview('/outgoing/www.php.net/sort?referer=');"><span style="color: #990000;">sort</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$elements</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$elements</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$e</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// start looping through the tags</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// determine the popularity of this term as a percentage</span>
    <span style="color: #000088;">$percent</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/floor" onclick="pageTracker._trackPageview('/outgoing/www.php.net/floor?referer=');"><span style="color: #990000;">floor</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$e</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'count'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">/</span> <span style="color: #000088;">$maximum</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// determine the class for this term based on the percentage</span>
	<span style="color: #b1b100;">if</span> 	   <span style="color: #009900;">&#40;</span><span style="color: #000088;">$percent</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">99</span><span style="color: #009900;">&#41;</span>		<span style="color: #000088;">$class</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">9</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$percent</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">70</span><span style="color: #009900;">&#41;</span>		<span style="color: #000088;">$class</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">8</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$percent</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">60</span><span style="color: #009900;">&#41;</span>		<span style="color: #000088;">$class</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">7</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$percent</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">50</span><span style="color: #009900;">&#41;</span>		<span style="color: #000088;">$class</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">6</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$percent</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">40</span><span style="color: #009900;">&#41;</span>		<span style="color: #000088;">$class</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$percent</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">30</span><span style="color: #009900;">&#41;</span>		<span style="color: #000088;">$class</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">4</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$percent</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">20</span><span style="color: #009900;">&#41;</span>		<span style="color: #000088;">$class</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$percent</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span>		<span style="color: #000088;">$class</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$percent</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span>		<span style="color: #000088;">$class</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">else</span>						<span style="color: #000088;">$class</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// output this term</span>
    <span style="color: #666666; font-style: italic;">//with links...</span>
    <span style="color: #666666; font-style: italic;">//echo &quot;&lt;span class=\&quot;$class\&quot;&gt;&lt;a href=\&quot;search.php?search=&quot; . urlencode($k['term']) . &quot;\&quot;&gt;&quot; . $k['term'] . &quot;&lt;/a&gt;&lt;/span&gt;\n &quot;;</span>
  <span style="color: #666666; font-style: italic;">//without links.../</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;span class='word size&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$class</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;'&gt;&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$e</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'word'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&lt;/span&gt;<span style="color: #000099; font-weight: bold;">\n</span> &quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">// for debugging....</span>
<span style="color: #666666; font-style: italic;">//echo &quot;&lt;hr /&gt;&quot;;</span>
<span style="color: #666666; font-style: italic;">//echo &quot;&lt;pre&gt;&quot;;</span>
<span style="color: #666666; font-style: italic;">//print_r($elements);</span>
<span style="color: #666666; font-style: italic;">//echo &quot;</span></pre></td></tr></table></div>

<p>&#8220;;<br />
?>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/php/head-in-the-clouds-tag-yourself/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>blur() no more..</title>
		<link>http://www.maggsweb.com/css/blur-no-more/</link>
		<comments>http://www.maggsweb.com/css/blur-no-more/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 11:24:54 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[link border]]></category>

		<guid isPermaLink="false">http://www.cmaggs.co.uk/?p=37</guid>
		<description><![CDATA[Use FireFox? Can&#8217;t stand the dotted lines around links when you select them? Nope, nor me. For ages I have been diligently adding a javascript:blur(); call to my links to stop these little white lines appearing.  Now I have found the holy grail. For example, previously I would have done this: ?View Code HTML&#60;a href=&#34;...&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>Use FireFox? Can&#8217;t stand the dotted lines around links when you select them?  Nope, nor me.</p>
<p>For ages I have been diligently adding a <strong>javascript:blur();</strong> call to my links to stop these little white lines appearing.  Now I have found the holy grail.</p>
<p><span id="more-37"></span></p>
<p>For example, previously I would have done this:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p37code21'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3721"><td class="code" id="p37code21"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;...&quot; onfocus=&quot;blur()&quot; &gt; [LINK] &lt;/a&gt;</pre></td></tr></table></div>

<p>This works great, but guaranteed the one that you forget to code will be the one that annoys you most. So, add it to the style sheet once &#8211; like this.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p37code22'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3722"><td class="code" id="p37code22"><pre class="css" style="font-family:monospace;">a<span style="color: #3333ff;">:active </span><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>
a<span style="color: #3333ff;">:focus </span><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></td></tr></table></div>

<p>Cool <img src='http://www.maggsweb.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/css/blur-no-more/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using CSS for form layout (No more tables.. )</title>
		<link>http://www.maggsweb.com/css/css-form-layout-2/</link>
		<comments>http://www.maggsweb.com/css/css-form-layout-2/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 13:16:39 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Web2.0]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.cmaggs.co.uk/html/32</guid>
		<description><![CDATA[Form fields need to line up. OK. Historically this was achieved using a table, and masses of markup. Although that&#8217;s still acceptable and would not fail validation, there is an easier and better way that uses less code and where using the correct tags will also cause the &#8216;name&#8217; field become focused when you clicked [...]]]></description>
			<content:encoded><![CDATA[<p>Form fields need to line up.  OK.  Historically this was achieved using a table, and masses of markup.  Although that&#8217;s still acceptable and would not fail validation, there is an easier and better way that uses less code and where using the correct tags will also cause the &#8216;name&#8217; field become <em>focused </em>when you clicked the &#8216;name&#8217; <em>label</em>.
</p>
<p>
Using CSS we can achieve this using less code, while providing improved usability.
</p>
<p><span id="more-32"></span></p>
<ul>
<li> Use a &lt;P&gt; tag to distinguish each line.</li>
<li> Use a &lt;label&gt; with the <em>name</em> attribute to link to an input with the same name attribute to create the links.</li>
<li> Put the &lt;label&gt; inside the &lt;P&gt; tag with a fixed width, floated left</li>
<li> Use the padding (inside) and margin (outside) on the &lt;P&gt; tag for spacing.</li>
</ul>
<p>Perfect!<br />
<br />
<a href="http://www.maggsweb.com/css/css-form-layout-2/attachment/cssform/" rel="attachment wp-att-375"><img src="http://www.maggsweb.com/wp-content/uploads/2008/03/cssForm.jpg" alt="cssForm" title="cssForm" width="310" height="157" class="size-full wp-image-375" /></a></p>
<p></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p32code25'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3225"><td class="code" id="p32code25"><pre class="html" style="font-family:monospace;">&nbsp;
&lt;form action=&quot;#&quot;&gt;
&lt;p&gt;&lt;label for=&quot;name&quot;&gt;Name&lt;/label&gt;&lt;input id=&quot;name&quot; type=&quot;text&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;label for=&quot;e-mail&quot;&gt;E-mail&lt;/label&gt;&lt;input id=&quot;e-mail&quot; type=&quot;text&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;&lt;/p&gt;
&lt;/form&gt;</pre></td></tr></table></div>

<p></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p32code26'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3226"><td class="code" id="p32code26"><pre class="css" style="font-family:monospace;">&nbsp;
p <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
p<span style="color: #6666ff;">.submit</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">110px</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span>
label <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;">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;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</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: #00AA00;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/css/css-form-layout-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fieldset as a border and title</title>
		<link>http://www.maggsweb.com/css/fieldset-as-a-border-title/</link>
		<comments>http://www.maggsweb.com/css/fieldset-as-a-border-title/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 10:12:47 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[fieldset]]></category>

		<guid isPermaLink="false">http://www.cmaggs.co.uk/html/31</guid>
		<description><![CDATA[These are a wicked (and widely underused) way to wrap similar actions together with a nice little header. When I first saw them in use I tried to recreate them using CSS, a background image, overlapping layers&#8230; Wooaah &#8211; Cool Head!! Noah was using these&#8230; ?View Code HTML&#160; &#60;h2&#62;TITLE&#60;/h2&#62; &#60;fieldset&#62; &#60;legend&#62;Sub Title&#60;/legend&#62; STUFF HERE &#60;/fieldset&#62;]]></description>
			<content:encoded><![CDATA[<p>These are a wicked (and widely underused) way to wrap similar actions together with a nice little header.<br />
When I first saw them in use I tried to recreate them using CSS, a background image, overlapping layers&#8230;  Wooaah &#8211; Cool Head!!   Noah was using these&#8230;</p>
<p><span id="more-31"></span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p31code28'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3128"><td class="code" id="p31code28"><pre class="html" style="font-family:monospace;">&nbsp;
&lt;h2&gt;TITLE&lt;/h2&gt;
&lt;fieldset&gt;
&lt;legend&gt;Sub Title&lt;/legend&gt;
STUFF HERE
&lt;/fieldset&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/css/fieldset-as-a-border-title/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
