<?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>Robert Kern &#187; CSS</title> <atom:link href="http://www.robertkern.com/tags/css/feed" rel="self" type="application/rss+xml" /><link>http://www.robertkern.com</link> <description>PHP Web developer</description> <lastBuildDate>Tue, 07 Feb 2012 00:34:47 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <cloud
domain='www.robertkern.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' /> <item><title>Use PHP to make alternate coloured rows</title><link>http://www.robertkern.com/php/use-php-to-make-alternate-coloured-rows.html</link> <comments>http://www.robertkern.com/php/use-php-to-make-alternate-coloured-rows.html#comments</comments> <pubDate>Thu, 28 Aug 2008 14:56:39 +0000</pubDate> <dc:creator>Robert Kern</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[Tables]]></category><guid
isPermaLink="false">http://www.robertkern.com/?p=145</guid> <description><![CDATA[I came across an article that described how to use PHP to make alternate coloured rows in a table and was surprised at how difficult they made it.  There is a very simple way to display alternate coloured rows in tabular data.  Read on for more info. Use the following PHP code to display alternate [...]]]></description> <content:encoded><![CDATA[<p>I came across an article that described how to use PHP to make alternate coloured rows in a table and was surprised at how difficult they made it.  There is a very simple way to display alternate coloured rows in tabular data.  Read on for more info.</p><p><span
id="more-145"></span></p><p>Use the following PHP code to display alternate rows in different colours.  What this is actually doing is setting the class for one row to: odd, and the next row to: even.  Then in my css stylesheet I will define .odd and .even to have different background colours.  I see this as a very clean and manageable way to do this common task.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Set the index to zero</span>
<span style="color: #666666; font-style: italic;">//Put your code here to loop through the database result or whatever it is you are displaying</span>
<span style="color: #666666; font-style: italic;">//Then display the table row</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;tr class=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">%</span><span style="color:#800080;">2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'odd'</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'even'</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;</pre></div></div><p>This same idea can be used in probably all web development coding languages with slightly different syntax.</p> ]]></content:encoded> <wfw:commentRss>http://www.robertkern.com/php/use-php-to-make-alternate-coloured-rows.html/feed</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>CSS / Javascript matching columns</title><link>http://www.robertkern.com/web-development/css-javascript-matching-columns.html</link> <comments>http://www.robertkern.com/web-development/css-javascript-matching-columns.html#comments</comments> <pubDate>Wed, 16 Jan 2008 23:47:29 +0000</pubDate> <dc:creator>Robert Kern</dc:creator> <category><![CDATA[How to]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[Javascript]]></category><guid
isPermaLink="false">http://www.robertkern.com/css/css-javascript-matching-columns.html</guid> <description><![CDATA[If you are having trouble getting two div columns to match, then try this matching columns script. It is a very simple script that will match the height of the columns you specify (all you have to do is assign the class &#8216;column&#8217; to the columns you want to match). Download file: matching_columns.zip /* &#160; [...]]]></description> <content:encoded><![CDATA[<p>If you are having trouble getting two div columns to match, then try this matching columns script.  It is a very simple script that will match the height of the columns you specify (all you have to do is assign the class &#8216;column&#8217; to the columns you want to match).<br
/> <span
id="more-40"></span></p><p
class="postmetadata">Download file: <a
href="http://www.robertkern.com/wp-content/uploads/2008/01/matching_columns.zip">matching_columns.zip</a></p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/*
&nbsp;
Derived from a script by Alejandro Gervasio.
&nbsp;
Modified to work in FireFox by Stefan Mischook for Killersites.comHow it works: just apply the CSS class of 'column' to your pages' main columns.
&nbsp;
*/</span>
&nbsp;
matchColumns<span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> divs<span style="color: #339933;">,</span>contDivs<span style="color: #339933;">,</span>maxHeight<span style="color: #339933;">,</span>divHeight<span style="color: #339933;">,</span>d<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// get all</span>
&nbsp;
elements in the document
&nbsp;
     divs<span style="color: #339933;">=</span>document<span style="color: #339933;">.</span>getElementsByTagName<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'div'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
contDivs<span style="color: #339933;">=</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// initialize maximum height value</span>
&nbsp;
     maxHeight<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// iterate over all</span>
&nbsp;
elements in the document
&nbsp;
     <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>i
&nbsp;
<span style="color: #666666; font-style: italic;">// make collection with</span>
&nbsp;
elements with <span style="color: #000000; font-weight: bold;">class</span> attribute <span style="color: #0000ff;">'container'</span>
&nbsp;
          <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">/</span>\bcolumn\b<span style="color: #339933;">/.</span>test<span style="color: #009900;">&#40;</span>divs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span>className<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
d<span style="color: #339933;">=</span>divs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
contDivs<span style="color: #009900;">&#91;</span>contDivs<span style="color: #339933;">.</span>length<span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span>d<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// determine height for</span>
&nbsp;
element
&nbsp;
                <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>d<span style="color: #339933;">.</span>offsetHeight<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
divHeight<span style="color: #339933;">=</span>d<span style="color: #339933;">.</span>offsetHeight<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>d<span style="color: #339933;">.</span>style<span style="color: #339933;">.</span>pixelHeight<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
divHeight<span style="color: #339933;">=</span>d<span style="color: #339933;">.</span>style<span style="color: #339933;">.</span>pixelHeight<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// calculate maximum height</span>
&nbsp;
                maxHeight<span style="color: #339933;">=</span>Math<span style="color: #339933;">.</span><span style="color: #990000;">max</span><span style="color: #009900;">&#40;</span>maxHeight<span style="color: #339933;">,</span>divHeight<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// assign maximum height value to all of container</span>
&nbsp;
elements
&nbsp;
     <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>i
&nbsp;
contDivs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span>style<span style="color: #339933;">.</span>height<span style="color: #339933;">=</span>maxHeight <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;px&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Runs the script when page loads</span>
&nbsp;
window<span style="color: #339933;">.</span>onload<span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>document<span style="color: #339933;">.</span>getElementsByTagName<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
matchColumns<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>]]></content:encoded> <wfw:commentRss>http://www.robertkern.com/web-development/css-javascript-matching-columns.html/feed</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Fix transparent png images in Internet Explorer 6 (IE6)</title><link>http://www.robertkern.com/web-development/fix-transparent-png-images-in-internet-explorer-6-ie6.html</link> <comments>http://www.robertkern.com/web-development/fix-transparent-png-images-in-internet-explorer-6-ie6.html#comments</comments> <pubDate>Wed, 16 Jan 2008 23:42:15 +0000</pubDate> <dc:creator>Robert Kern</dc:creator> <category><![CDATA[How to]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[ie6]]></category> <category><![CDATA[png]]></category> <category><![CDATA[transparent]]></category><guid
isPermaLink="false">http://www.robertkern.com/css/fix-transparent-png-images-in-internet-explorer-6-ie6.html</guid> <description><![CDATA[Sometimes it can be very frustrating building websites that are cross-browser. One of the many issues is transparent png images in IE6. PNG&#8217;s have enabled us to make beautiful images for websites with amazing transparency etc. There is a very simple way to make transparent png images work in all browsers. Download file: png-fix.zip This [...]]]></description> <content:encoded><![CDATA[<p>Sometimes it can be very frustrating building websites that are cross-browser.  One of the many issues is transparent png images in IE6.</p><p>PNG&#8217;s have enabled us to make beautiful images for websites with amazing transparency etc.  There is a very simple way to make transparent png images work in all browsers.</p><p
class="postmetadata">Download file: <a
href="http://www.robertkern.com/wp-content/uploads/2008/01/png-fix.zip">png-fix.zip</a></p><p>This method uses CSS to fix the issue.  You can define a class such as &#8216;transparent&#8217; and apply that to the images whose transparency you want to make work in ie6, or simply use the fix in CSS for the img tag (therefore making all images&#8217; transparency work in ie6).</p> ]]></content:encoded> <wfw:commentRss>http://www.robertkern.com/web-development/fix-transparent-png-images-in-internet-explorer-6-ie6.html/feed</wfw:commentRss> <slash:comments>2</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: www.robertkern.com @ 2012-02-06 23:55:58 -->
