<?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>Pippin&#039;s Pages &#187; CSS</title> <atom:link href="http://pippinspages.com/category/css/feed/" rel="self" type="application/rss+xml" /><link>http://pippinspages.com</link> <description>{ Coding everyday keeps the bugs away }</description> <lastBuildDate>Wed, 07 Dec 2011 22:09:26 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Slick, CSS 3 Image Drop Shadows</title><link>http://pippinspages.com/tutorials/css/slick-css-3-image-drop-shadows/</link> <comments>http://pippinspages.com/tutorials/css/slick-css-3-image-drop-shadows/#comments</comments> <pubDate>Mon, 18 Apr 2011 14:00:02 +0000</pubDate> <dc:creator>Pippin Williamson</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[Design]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[css3]]></category> <category><![CDATA[drop shadows]]></category><guid isPermaLink="false">http://pippinspages.com/?p=1992</guid> <description><![CDATA[Today, while working on a theme update for my buddy AJ Clark, of WP Explorer, I cooked up some sick CSS 3 only drop shadows. The shadow on the image below is what we will be creating, with only CSS: &#8230; <a href="http://pippinspages.com/tutorials/css/slick-css-3-image-drop-shadows/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Today, while working on a theme update for my buddy AJ Clark, of <a href="http://www.mojo-themes.com/item/cleaner-business-wordpress-theme/?r=pippin">WP Explorer</a>, I cooked up some sick CSS 3 only drop shadows.<br /> <span id="more-1992"></span><br /> The shadow on the image below is what we will be creating, with only CSS:</p><p><a href="http://pippinspages.com/wp-content/uploads/2011/04/css3-shadow.png?9707a5"><img src="http://pippinspages.com/wp-content/uploads/2011/04/css3-shadow.png?9707a5" alt="" title="css3-shadow" width="421" height="267" class="alignnone size-full wp-image-1993" /></a></p><p>The first step is to set up your HTML structure:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image-wrap&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image-thumb&quot;</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;path/to/your/image.jpg&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image-shadow&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div><p>Next, some basic CSS:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.image-wrap</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.image-thumb</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">180px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*set this to the size of your image*/</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">280px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*set this to the size of your image*/</span>
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><p>The next step is a little more complex and utilizes the :before and :after pseudo selectors to allow us to do super cool stuff <img src="http://pippinspages.com/wp-includes/images/smilies/icon_smile.gif?9707a5" alt=':)' class='wp-smiley' /></p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.thumb-shadow</span>	<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">180px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*this must be the same as declared above*/</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">280px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*this must be the same as declared above*/</span>
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #808080; font-style: italic;">/*shadow*/</span>
<span style="color: #6666ff;">.image-shadow</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;">''</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#828282</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">98%</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">4px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> -<span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
	-webkit-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>2deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">2px</span> <span style="color: #933;">5px</span> <span style="color: #cc00cc;">#828282</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.image-shadow</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;">''</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#828282</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">95%</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">4px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> -<span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
	-webkit-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>-2deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">2px</span> <span style="color: #933;">5px</span> <span style="color: #cc00cc;">#828282</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #808080; font-style: italic;">/*end shadow*/</span></pre></td></tr></table></div><p>What we have done created two gray &#8220;stripes&#8221; that are slightly blurred, and then rotated them slightly to give the impression of a curved shadow. Pretty cool, huh?</p><p>This is a pretty simple application of this technique, and you could go much further and create more intricate shadows if you wanted.</p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://pippinspages.com/tutorials/css/freebie-css-3-drop-down-menus/">Freebie - CSS 3 Drop Down Menus</a> <span class="related-post-date timestamp">Tue 22 Jun 2010</span></li></ul>]]></content:encoded> <wfw:commentRss>http://pippinspages.com/tutorials/css/slick-css-3-image-drop-shadows/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Freebie &#8211; CSS 3 Drop Down Menus</title><link>http://pippinspages.com/tutorials/css/freebie-css-3-drop-down-menus/</link> <comments>http://pippinspages.com/tutorials/css/freebie-css-3-drop-down-menus/#comments</comments> <pubDate>Tue, 22 Jun 2010 22:42:19 +0000</pubDate> <dc:creator>Pippin Williamson</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[Freebies]]></category> <category><![CDATA[css3]]></category> <category><![CDATA[drop down menu]]></category> <category><![CDATA[free]]></category><guid isPermaLink="false">http://pippinspages.com/?p=1425</guid> <description><![CDATA[A simple multi level drop down menu I put together the other night coded entirely in CSS 3 with graceful degradation for non-supported browsers. Three color schemes included. Related PostsSlick, CSS 3 Image Drop Shadows Mon 18 Apr 2011Simple Utility &#8230; <a href="http://pippinspages.com/tutorials/css/freebie-css-3-drop-down-menus/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>A simple multi level drop down menu I put together the other night coded entirely in CSS 3 with graceful degradation for non-supported browsers.<br /> <span id="more-1425"></span><br /> Three color schemes included.</p><p><a class="downloadlink" href="http://pippinspages.com/wp-content/plugins/download-monitor/download.php?id=3" title="Version1.0 downloaded 1307 times" >CSS 3 Drop Down Menu (1307)</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://pippinspages.com/tutorials/css/slick-css-3-image-drop-shadows/">Slick, CSS 3 Image Drop Shadows</a> <span class="related-post-date timestamp">Mon 18 Apr 2011</span></li><li class="related-post"><a href="http://pippinspages.com/freebies/simple-utility-icons-free/">Simple Utility Icons - Free</a> <span class="related-post-date timestamp">Sun 22 Aug 2010</span></li><li class="related-post"><a href="http://pippinspages.com/freebies/sugar-glider-free-wordpress-theme/">Sugar Glider – Free WordPress Theme</a> <span class="related-post-date timestamp">Wed 09 Jun 2010</span></li></ul>]]></content:encoded> <wfw:commentRss>http://pippinspages.com/tutorials/css/freebie-css-3-drop-down-menus/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Quick Tip: Remove right margin from column post layout with php</title><link>http://pippinspages.com/tutorials/css/quick-tip-remove-right-margin-from-column-post-layout-with-php/</link> <comments>http://pippinspages.com/tutorials/css/quick-tip-remove-right-margin-from-column-post-layout-with-php/#comments</comments> <pubDate>Sat, 08 May 2010 05:01:37 +0000</pubDate> <dc:creator>Pippin Williamson</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[Design]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[Wordpress]]></category> <category><![CDATA[WordPress Tutorials]]></category> <category><![CDATA[layout]]></category> <category><![CDATA[three column]]></category> <category><![CDATA[tips]]></category><guid isPermaLink="false">http://pippinspages.com/?p=1268</guid> <description><![CDATA[One of the most popular layout styles right now is the Three Column grid, particularly for News-like websites. Well, one of the main problems coders will run into when creating the layout with CSS is how to make all the &#8230; <a href="http://pippinspages.com/tutorials/css/quick-tip-remove-right-margin-from-column-post-layout-with-php/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>One of the most popular layout styles right now is the Three Column grid, particularly for News-like websites.</p><p>Well, one of the main problems coders will run into when creating the layout with CSS is how to make all the columns fit correctly, while retaining the correct margins.<br /> <span id="more-1268"></span><br /> What often happens is the first two columns look great, but then the third margin will screw up because the right-margin, for example, has pushed the column outside of the containing div. The problem looks something like this:</p><p><img src="http://pippinspages.com/wp-content/uploads/2010/05/column-layout-error.jpg?9707a5" alt="" title="column-layout-error" width="626" height="150" class="alignnone size-full wp-image-1271" /></p><p>A friend / php developer showed me a sweet solution to this problem the other day, so I thought I&#8217;d post it here for all of you.</p><p>It works by adding a counter at the beginning of your column layout that starts at &#8220;0&#8243;, then with each column, a count of &#8220;1&#8243; is added to the initial &#8220;0&#8243;. Then, when the count reaches &#8220;3&#8243; (or however many columns your layout has), you add an additional CSS class that removes the right margin. And finally, you reset the counter so that the next row of columns begin at &#8220;0&#8243;.</p><p>It looks like this:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;div class=&quot;row&quot;&gt;
 <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;">//start the count at &quot;0&quot;</span>
   <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span> have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
   $i++; //add 1 to the total count
 ?&gt;
  &lt;div class=&quot;column <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: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'column-right'</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//your post content </span>
    <span style="color: #000000; font-weight: bold;">?&gt;</span>
  &lt;/div&gt;
 <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: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div style=&quot;clear:both; width: 100%;&quot;&gt;&lt;/div&gt;'</span><span style="color: #339933;">;</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: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">//reset the ount to &quot;0&quot; and clear the divs </span>
  <span style="color: #000000; font-weight: bold;">?&gt;</span>
 <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;</pre></td></tr></table></div><p>The CSS looks like this:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.row</span> <span style="color: #00AA00;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.column</span> <span style="color: #00AA00;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">33%</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;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
.column-<span style="color: #000000; font-weight: bold;">right</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span>!important<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><p>Enjoy!</p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://pippinspages.com/tutorials/get-page-id-by-page-name/">Get Page ID by Page Name</a> <span class="related-post-date timestamp">Fri 15 Oct 2010</span></li><li class="related-post"><a href="http://pippinspages.com/tutorials/wordpress-cms-tips-and-tricks-part-3/">Wordpress CMS Tips and Tricks - Part 3</a> <span class="related-post-date timestamp">Wed 19 May 2010</span></li><li class="related-post"><a href="http://pippinspages.com/tutorials/better-wordpress-post-excerpt-revamped/">Better Wordpress Post Excerpt - Revamped</a> <span class="related-post-date timestamp">Thu 22 Apr 2010</span></li></ul>]]></content:encoded> <wfw:commentRss>http://pippinspages.com/tutorials/css/quick-tip-remove-right-margin-from-column-post-layout-with-php/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Alternate Your Comment Colors</title><link>http://pippinspages.com/tutorials/css/alternate-comment-colors/</link> <comments>http://pippinspages.com/tutorials/css/alternate-comment-colors/#comments</comments> <pubDate>Mon, 08 Mar 2010 01:08:41 +0000</pubDate> <dc:creator>Pippin Williamson</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[WordPress Tutorials]]></category> <category><![CDATA[comments]]></category> <category><![CDATA[Wordpress]]></category><guid isPermaLink="false">http://pippinspages.com/?p=1003</guid> <description><![CDATA[Effectively styling comments can be a difficult task. One tip to make your comments more readable is to alternate their background colors. By default, WordPress assigns a class of &#8220;even&#8221; or &#8220;odd&#8221; to each comment in the list; the first &#8230; <a href="http://pippinspages.com/tutorials/css/alternate-comment-colors/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Effectively styling comments can be a difficult task. One tip to make your comments more readable is to alternate their background colors.<br /> <span id="more-1003"></span><br /> By default, WordPress assigns a class of &#8220;even&#8221; or &#8220;odd&#8221; to each comment in the list; the first is odd, the second even, the third odd, etc, etc.</p><p>So, to achieve the desired effect, put this in your style.css:</p><p></p><div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">li<span style="color: #6666ff;">.even</span>	<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FFFF</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
li<span style="color: #6666ff;">.odd</span>	<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#F9F9F9</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div><p>Add in a few other styling elements, such as borders and clever margins, and you can get some really slick results.</p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://pippinspages.com/tutorials/css/quick-tip-remove-right-margin-from-column-post-layout-with-php/">Quick Tip: Remove right margin from column post layout with php</a> <span class="related-post-date timestamp">Sat 08 May 2010</span></li><li class="related-post"><a href="http://pippinspages.com/tutorials/add-scripts-and-styles-to-specific-admin-pages-only/">Add Scripts and Styles to Specific Admin Pages Only</a> <span class="related-post-date timestamp">Thu 30 Jun 2011</span></li><li class="related-post"><a href="http://pippinspages.com/wordpress/give-away-3-free-copies-of-font-uploader-for-wordpress/">Give Away: 3 Free Copies of Font Uploader for WordPress</a> <span class="related-post-date timestamp">Mon 02 May 2011</span></li></ul>]]></content:encoded> <wfw:commentRss>http://pippinspages.com/tutorials/css/alternate-comment-colors/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Override Inline Styles</title><link>http://pippinspages.com/tutorials/css/override-inline-styles/</link> <comments>http://pippinspages.com/tutorials/css/override-inline-styles/#comments</comments> <pubDate>Fri, 26 Feb 2010 22:51:24 +0000</pubDate> <dc:creator>Pippin Williamson</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[Tutorials]]></category><guid isPermaLink="false">http://pippinspages.com/?p=831</guid> <description><![CDATA[A few weeks ago I ran into a problem while styling some elements in a wordpress plugin. The source of problem was that the plugin author had used inline styles to control the elements. This prevented my user-defined styles from &#8230; <a href="http://pippinspages.com/tutorials/css/override-inline-styles/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>A few weeks ago I ran into a problem while styling some elements in a wordpress plugin. The source of problem was that the plugin author had used inline styles to control the elements. <span id="more-831"></span>This prevented my user-defined styles from applying. Rather than manually going into the plugin source and removing the styles (any modifications would be over ridden if I ever updated the plugin), I found a solution posted by <a title="Natalie Jost" href="http://nataliejost.com/542" target="_blank">Natale Jost</a>.</p><p>It&#8217;s really simple.</p><p>Your original style looks something like:</p><div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">div  <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;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div><p><br /> But, thanks to the inline styles, the above don&#8217;t actually appear. By adding [style] to the end of div, the nasty inline styles will be over written.</p><div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">div<span style="color: #00AA00;">&#91;</span>style<span style="color: #00AA00;">&#93;</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;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div><p>This trick works in all browsers except IE 6 (no surprise).</p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://pippinspages.com/tutorials/add-scripts-and-styles-to-specific-admin-pages-only/">Add Scripts and Styles to Specific Admin Pages Only</a> <span class="related-post-date timestamp">Thu 30 Jun 2011</span></li><li class="related-post"><a href="http://pippinspages.com/tutorials/css/quick-tip-remove-right-margin-from-column-post-layout-with-php/">Quick Tip: Remove right margin from column post layout with php</a> <span class="related-post-date timestamp">Sat 08 May 2010</span></li><li class="related-post"><a href="http://pippinspages.com/tutorials/css/alternate-comment-colors/">Alternate Your Comment Colors</a> <span class="related-post-date timestamp">Mon 08 Mar 2010</span></li></ul>]]></content:encoded> <wfw:commentRss>http://pippinspages.com/tutorials/css/override-inline-styles/feed/</wfw:commentRss> <slash:comments>9</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: basic
Database Caching 82/139 queries in 0.262 seconds using disk: basic
Object Caching 858/1019 objects using disk: basic

Served from: www.pippinspages.com @ 2012-02-05 07:51:41 -->
