<?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>myCloudCode</title>
	<atom:link href="http://www.my-folios.com/code/feed" rel="self" type="application/rss+xml" />
	<link>http://www.my-folios.com/code</link>
	<description>my Personal Code Collection</description>
	<lastBuildDate>Thu, 08 Jul 2010 02:14:57 +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>Multiple Backgrounds and Borders with CSS 2.1 – Nicolas Gallagher — Blog &amp; Ephemera</title>
		<link>http://www.my-folios.com/code/multiple-backgrounds-and-borders-with-css-2-1-%e2%80%93-nicolas-gallagher-%e2%80%94-blog-ephemera.html</link>
		<comments>http://www.my-folios.com/code/multiple-backgrounds-and-borders-with-css-2-1-%e2%80%93-nicolas-gallagher-%e2%80%94-blog-ephemera.html#comments</comments>
		<pubDate>Thu, 08 Jul 2010 02:14:57 +0000</pubDate>
		<dc:creator>Jay Kwong</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[:after]]></category>
		<category><![CDATA[:before]]></category>

		<guid isPermaLink="false">http://www.my-folios.com/code/?p=65</guid>
		<description><![CDATA[Demo: Multiple Backgrounds with CSS 2.1 Demo: Multiple Borders with CSS 2.1 Support: Firefox 3.5+, Safari 4+, Chrome 4+, Opera 10+, IE8+. How does it work? Essentially, you create pseudo-elements using CSS (:before and :after) and treat them similarly to how you would treat HTML elements nested within your target element. But they have distinct [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li><strong>Demo: <a href="http://nicolasgallagher.com/demo/multiple-backgrounds-and-borders-with-css2/backgrounds.html">Multiple  Backgrounds with <abbr>CSS</abbr> 2.1</a></strong></li>
<li><strong>Demo: <a href="http://nicolasgallagher.com/demo/multiple-backgrounds-and-borders-with-css2/borders.html">Multiple  Borders with <abbr>CSS</abbr> 2.1</a></strong></li>
</ul>
<p><em>Support</em>: Firefox 3.5+, Safari 4+, Chrome 4+, Opera 10+, <abbr title="Internet Explorer">IE</abbr>8+.</p>
<h2>How does it work?</h2>
<p>Essentially, you create pseudo-elements using <abbr>CSS</abbr> (<code>:before</code> and <code>:after</code>) and treat them similarly to how you would  treat <abbr>HTML</abbr> elements nested within your target element. But  they have distinct benefits — beyond semantics — over the use of nested <abbr>HTML</abbr> elements.</p>
<p>To provide multiple backgrounds and/or borders, the pseudo-elements  are pushed behind the content layer and pinned to the desired points of  the <abbr>HTML</abbr> element using absolute positioning.</p>
<p><img src="http://nicolasgallagher.com/wp-content/uploads/css2-multiple-background-border-model.png" alt="" width="600" height="580" /></p>
<p>The pseudo-elements contain no true content and are absolutely  positioned. This means that they can be stretched to sit over any area  of the “parent” element without affecting its content. This can be done  using any combination of values for the <code>top</code>, <code>right</code>,  <code>bottom</code>, <code>left</code>, <code>width</code>, and <code>height</code> properties and is the key to their flexibility.</p>
<h2>What effects can be achieved?</h2>
<p>Using just one element you can create parallax effects, multiple  background colours, multiple background images, clipped background  images, image replacement, expandable boxes using images for borders,  fluid faux columns, images existing outside the box, the appearance of  multiple borders, and other popular effects that usually require images  and/or the use of presentational <abbr>HTML</abbr>. It is also possible  to include 2 extra presentational images as generated content.</p>
<p>The <a href="http://nicolasgallagher.com/demo/multiple-backgrounds-and-borders-with-css2/backgrounds.html">Multiple  Backgrounds with <abbr>CSS</abbr> 2.1</a> and <a href="http://nicolasgallagher.com/demo/multiple-backgrounds-and-borders-with-css2/borders.html">Multiple  Borders with <abbr>CSS</abbr> 2.1</a> demo pages show how several  popular examples of these effects can be achieved with this technique.</p>
<p>Most structural elements will contain child elements. Therefore, more  often than not, you will be able to gain a further 2 pseudo-elements to  use in the presentation by generating them from the first child (and  even last-child) element of the parent element. In addition, you can use  style changes on <code>:hover</code> to produce complex interaction  effects.</p>
<h2>Example code: multiple background images</h2>
<p>Using this technique it is possible to reproduce multiple-background  parallax effects like those found on the <a rel="external" href="http://silverbackapp.com/">Silverback</a> site using just one <abbr>HTML</abbr> element.</p>
<p><img src="http://nicolasgallagher.com/wp-content/uploads/css-multiple-backgrounds-silverback.jpg" alt="" width="600" height="216" /></p>
<p>The element gets its own background image and any desired padding. By  relatively positioning the element it acts as the reference point when  absolutely positioning the pseudo-elements. The positive <code>z-index</code> will allow for the correct z-axis positioning of the pseudo-elements.</p>
<pre><code>#silverback {
   position:relative;
   z-index:1;
   min-width:200px;
   min-height:200px;
   padding:120px 200px 50px;
   background:#d3ff99 url(vines-back.png) -10% 0 repeat-x;
}</code></pre>
<p>Both pseudo-elements are absolutely positioned and pinned to each  side of the element. The <code>z-index</code> value of <code>-1</code> moves the pseudo-elements behind the <em>content</em> layer. This way  the pseudo-elements sit on top of the element’s background and border  but all the content is still selectable or clickable.</p>
<pre><code>#silverback:before,
#silverback:after {
   position:absolute;
   z-index:-1;
   top:0;
   left:0;
   right:0;
   bottom:0;
   padding-top:100px;
}</code></pre>
<p>Each pseudo-element then has a repeated background-image set. This is  all that is needed to reproduce the parallax effect.</p>
<p>The <code>content</code> property lets you add an image as generated  content. With two pseudo-elements you can add 2 further images to an  element. They can be crudely positioned within the pseudo-element box by  varying other properties such as <code>text-align</code> and <code>padding</code>.</p>
<pre><code>#silverback:before {
   content:url(gorilla-1.png);
   padding-left:3%;
   text-align:left;
   background:transparent url(vines-mid.png) 300% 0 repeat-x;
}

#silverback:after {
   content:url(gorilla-2.png);
   padding-right:3%;
   text-align:right;
   background:transparent url(vines-front.png) 70% 0 repeat-x;
}</code></pre>
<p>The finished product is part of the <a href="http://nicolasgallagher.com/demo/multiple-backgrounds-and-borders-with-css2/backgrounds.html">Multiple  Backgrounds with <abbr>CSS</abbr> 2.1</a> demo.</p>
<h2>Example code: fluid faux columns</h2>
<p>Another application is creating equal height fluid columns without  images or extra nested containers.</p>
<p><img src="http://nicolasgallagher.com/wp-content/uploads/css-multiple-backgrounds-columns.png" alt="" width="600" height="220" /></p>
<p>The <abbr>HTML</abbr> base is very simple. I’ve used specific classes  on each child <code>div</code> rather than relying on <abbr>CSS</abbr> 2.1 selectors that <abbr>IE</abbr>6 does not support. If you don’t  require <abbr>IE</abbr>6 support you don’t actually need the classes.</p>
<pre><code>&lt;div id="faux"&gt;
   &lt;div class="main"&gt;[content]&lt;/div&gt;
   &lt;div class="supp1"&gt;[content]&lt;/div&gt;
   &lt;div class="supp2"&gt;[content]&lt;/div&gt;
&lt;/div&gt;</code></pre>
<p>The percentage-width container is once again relatively positioned  and a positive <code>z-index</code> is set. Applying <code>overflow:hidden</code> gets the element to wrap its floated children and will hide the  overflowing pseudo-elements. The background colour will provide the  colour for one of the columns.</p>
<pre><code>#faux {
   position:relative;
   z-index:1;
   width:80%;
   margin:0 auto;
   overflow:hidden;
   background:#ffaf00;
}</code></pre>
<p>By using relative positioning on the child <code>div</code>‘s you can  also control the order of the columns independently of their source  order.</p>
<pre><code>#faux div {
   position:relative;
   float:left;
   width:30%;
}

#faux .main {left:35%}
#faux .supp1 {left:-28.5%}
#faux .supp2 {left:8.5%}</code></pre>
<p>The other two full-height columns are produced by creating, sizing,  and positioning pseudo-elements with backgrounds. These backgrounds can  be (repeating) images if the design requires.</p>
<pre><code>#faux:before,
#faux:after {
   content:"";
   position:absolute;
   z-index:-1;
   top:0;
   left:33.333%;
   width:100%;
   height:100%;
   background:#f9b6ff;
}

#faux:after {
   left:66.667%;
   background:#79daff;
}</code></pre>
<p>The finished product is part of the <a href="http://nicolasgallagher.com/demo/multiple-backgrounds-and-borders-with-css2/backgrounds.html">Multiple  Backgrounds with <abbr>CSS</abbr> 2.1</a> demo.</p>
<h2>Example code: multiple borders</h2>
<p>Multiple borders are produced in much the same way. Using them can  avoid the need for images to produce simple effects.</p>
<p><img src="http://nicolasgallagher.com/wp-content/uploads/css-multiple-borders.png" alt="" width="600" height="240" /></p>
<p>An element must be relatively positioned and have sufficient padding  to contain the width of the extra border you will be creating with  pseudo-elements.</p>
<pre><code>#borders {
   position:relative;
   z-index:1;
   padding:30px;
   border:5px solid #f00;
   background:#ff9600;
}</code></pre>
<p>The pseudo-elements are positioned at specific distances away from  the edge of the element’s box, moved behind the content layer with the  negative <code>z-index</code>, and given the border and background  values you want.</p>
<pre><code>#borders:before {
   content:"";
   position:absolute;
   z-index:-1;
   top:5px;
   left:5px;
   right:5px;
   bottom:5px;
   border:5px solid #ffea00;
   background:#4aa929;
}</code></pre>
<pre><code>#borders:after {
   content:"";
   position:absolute;
   z-index:-1;
   top:15px;
   left:15px;
   right:15px;
   bottom:15px;
   border:5px solid #00b4ff;
   background:#fff;
}</code></pre>
<p>That’s all there is to it. The finished product is part of the <a href="http://nicolasgallagher.com/demo/multiple-backgrounds-and-borders-with-css2/borders.html">Multiple  Borders with <abbr>CSS</abbr> 2.1</a> demo.</p>
<h2>Progressive enhancement and legacy browsers</h2>
<p><abbr>IE</abbr>6 and <abbr>IE</abbr>7 have no support for <abbr>CSS</abbr> 2.1 pseudo-elements and will ignore all <code>:before</code> and <code>:after</code> declarations. They get none of the enhancements but are left with the  basic usable experience.</p>
<h3>A warning about Firefox 3.0</h3>
<p>Firefox 3.0 supports <abbr>CSS</abbr> 2.1 pseudo-elements but does  not support their positioning. Due to this partial support some effects  look pretty broken, while others are completely unaffected, and there is  often <strong>no graceful fallback for Firefox 3.0 when using this  technique</strong>. Sometimes an improved appearance can be achieved by  adding <code>display:block</code> to the pseudo-element styles.</p>
<p>Before using pseudo-elements in a way that requires their  positioning, consider the importance of Firefox 3.0 support and the  percentage of your users currently using the browser.</p>
<h3>Enhancing with <abbr>CSS</abbr>3</h3>
<p>All the applications included in this article could be further  enhanced to take advantage of present-day <abbr>CSS</abbr>3  implementations.</p>
<p>Using <code>border-radius</code>, <code>rgba</code>, and <code>transforms</code>,  and <abbr>CSS</abbr>3 multiple background images in tandem with  pseudo-elements can produce even more complex presentations that I hope  to include in a future article. Currently there is no browser support  for the use of CSS3 transitions or animations on pseudo-elements.</p>
<h2>In the future: <abbr>CSS</abbr>3 pseudo-elements</h2>
<p>The proposed extensions to pseudo-elements in the <a href="http://www.w3.org/TR/css3-content/#pseudo-elements"><abbr>CSS</abbr>3  Generated and Replaced Content Module</a> include the addition of  nested pseudo-elements (<code>::before::before</code>), multiple  pseudo-elements (<code>::after(2)</code>), wrapping pseudo-elements (<code>::outside</code>),  and the ability to insert pseudo-elements into later parts of the  document  (<code>::alternate</code>).</p>
<p>These changes would provide a near limitless number, and arrangement,  of pseudo-elements for all sorts of complex effects and presentations  using just one element.</p>]]></content:encoded>
			<wfw:commentRss>http://www.my-folios.com/code/multiple-backgrounds-and-borders-with-css-2-1-%e2%80%93-nicolas-gallagher-%e2%80%94-blog-ephemera.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fancy Inset CSS Image Borders &#124; Evan Byrne&#8217; Writings</title>
		<link>http://www.my-folios.com/code/fancy-inset-css-image-borders-evan-byrne-writings.html</link>
		<comments>http://www.my-folios.com/code/fancy-inset-css-image-borders-evan-byrne-writings.html#comments</comments>
		<pubDate>Thu, 08 Jul 2010 01:55:12 +0000</pubDate>
		<dc:creator>Jay Kwong</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[border]]></category>
		<category><![CDATA[:after]]></category>
		<category><![CDATA[css3]]></category>

		<guid isPermaLink="false">http://www.my-folios.com/code/?p=60</guid>
		<description><![CDATA[Before After .fancy{ position:relative; display:inline-block; font-size:0; line-height:0; } .fancy:after{ position:absolute; top:1px; left:1px; bottom:1px; right:1px; border:1px solid rgba(255,255,255,0.5); outline:1px solid rgba(0,0,0,0.2); content:" "; } The HTML Markup In a perfect world we would only use a single img tag with a class attribute. This is not a perfect world. Because the img tag does not support [...]]]></description>
			<content:encoded><![CDATA[<h2>Before</h2>
<p><img src="http://www.evanbyrne.com/bin/2010/07/fancy-borders/dingo.jpg" alt="" /></p>
<h2>After</h2>
<div class="p400 w500">
<style>
.fancy{ 	position:relative; 	display:inline-block; 	font-size:0; 	line-height:0; } 
.fancy:after{ 	position:absolute; 	top:1px; 	left:1px; 	bottom:1px; 	right:1px; 	border:1px solid rgba(255,255,255,0.5); 	outline:1px solid rgba(0,0,0,0.2); 	content:" "; }   
</style>
<p><span class="fancy"><br />
<img src="http://www.evanbyrne.com/bin/2010/07/fancy-borders/dingo.jpg" alt="" /><br />
</span></p>
<h2>The HTML Markup</h2>
<p>In a perfect world we would only use a single 	<code>img</code> tag with a class attribute. 	This is not a perfect world. Because the 	<code>img</code> tag does not support the CSS 	pseudo-element <code>:after</code>, we have to wrap 	our image in a <code>span</code>.</p>
<pre>&lt;span class="fancy"&gt;&lt; img src="dingo.jpg" /&gt;&lt;/span&gt;</pre>
<h2>The CSS</h2>
<p>The first step is to apply a simple reset to 	our <code>span</code> and <code>img</code> tags.</p>
<pre class="brush: css;">
span,img{padding:0;margin:0;border:0;}
</pre>
<p>Next, we style the wrapper element.</p>
</div>
<pre class="brush: css;">
.fancy{
position:relative;
display:inline-block;
font-size:0;
line-height:0;
}

.fancy:after{
position:absolute;
top:1px;
left:1px;
bottom:1px;
right:1px;
border:1px solid rgba(255,255,255,0.5);
outline:1px solid rgba(0,0,0,0.2);
content:&amp;amp;quot; &amp;amp;quot;;
}
</pre>]]></content:encoded>
			<wfw:commentRss>http://www.my-folios.com/code/fancy-inset-css-image-borders-evan-byrne-writings.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>keep footers at the bottom of the page</title>
		<link>http://www.my-folios.com/code/how-to-keep-footers-at-the-bottom-of-the-page.html</link>
		<comments>http://www.my-folios.com/code/how-to-keep-footers-at-the-bottom-of-the-page.html#comments</comments>
		<pubDate>Mon, 28 Jun 2010 07:40:07 +0000</pubDate>
		<dc:creator>Jay Kwong</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[footer]]></category>

		<guid isPermaLink="false">http://www.my-folios.com/code/?p=56</guid>
		<description><![CDATA[The HTML div structure &#60;div id=&#34;container&#34;&#62; &#60;div id=&#34;header&#34;&#62;&#60;/div&#62; &#60;div id=&#34;body&#34;&#62;&#60;/div&#62; &#60;div id=&#34;footer&#34;&#62;&#60;/div&#62; &#60;/div&#62; There are only four divs required for this to work. The first is a container div that surrounds everything. Inside that are three more divs; a header, a body and a footer. That&#8217;s it, all the magic happens in the CSS. html, [...]]]></description>
			<content:encoded><![CDATA[<p>The HTML div structure</p>
<pre class="brush: xml;">
&lt;div id=&quot;container&quot;&gt;
   &lt;div id=&quot;header&quot;&gt;&lt;/div&gt;
   &lt;div id=&quot;body&quot;&gt;&lt;/div&gt;
   &lt;div id=&quot;footer&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>There are only four divs required for this to work. The first is a container div that surrounds everything. Inside that are three more divs; a header, a body and a footer. That&#8217;s it, all the magic happens in the CSS.</p>
<pre class="brush: css;">

html, body { margin:0; padding:0; height:100%; }

#container { min-height:100%; position:relative; }

#header { background:#ff0; padding:10px; }

#body { padding:10px; padding-bottom:60px;   /* Height of the footer */ }

#footer { position:absolute; bottom:0; width:100%; height:60px;   /* Height of the footer */
background:#6cf; }
</pre>
<p>And one simple CSS rule for IE 6 and IE 5.5:</p>
<pre class="brush: css;">
#container { height:100%; }
</pre>
<p>via <a href="http://matthewjamestaylor.com/blog/keeping-footers-at-the-bottom-of-the-page">Get down! How to keep footers at the bottom of the page</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.my-folios.com/code/how-to-keep-footers-at-the-bottom-of-the-page.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS3 Gradient Buttons</title>
		<link>http://www.my-folios.com/code/css3-gradient-buttons.html</link>
		<comments>http://www.my-folios.com/code/css3-gradient-buttons.html#comments</comments>
		<pubDate>Mon, 28 Jun 2010 07:06:50 +0000</pubDate>
		<dc:creator>Jay Kwong</dc:creator>
				<category><![CDATA[Button]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[border]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[-moz-border-radius]]></category>
		<category><![CDATA[-webkit-border-radius]]></category>

		<guid isPermaLink="false">http://www.my-folios.com/code/?p=51</guid>
		<description><![CDATA[What Is So Cool About These Buttons? Pure CSS: no image or Javascript is used. The gradient is cross-browser supported (IE, Firefox 3.6, Chrome, and Safari). Flexible and scalable: button size and rounded corners can be adjusted by changing the font size and padding values. It has three button states: normal, hover, and active. It [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.webdesignerwall.com/demo/css-buttons.html"><img src="http://www.webdesignerwall.com/wp-content/uploads/2010/04/button-preview.jpg" alt="button states" /></a></p>
<h3>What Is So Cool About These Buttons?</h3>
<ul>
<li>Pure CSS: no image or Javascript is used.</li>
<li>The gradient is cross-browser supported (IE, Firefox 3.6, Chrome,  and Safari).</li>
<li>Flexible and scalable: button size and rounded corners can be  adjusted by changing the font size and padding values.</li>
<li>It has three button states: normal, hover, and active.</li>
<li>It can be applied to any HTML element: a, input, button, span, div,  p, h3, etc.</li>
<li>Fallback: if CSS3 is not supported, it will display a regular button  (no gradient and shadow).</li>
</ul>
<h3>Preview</h3>
<p>The image below shows how the button will  display in different  browsers.</p>
<p><img src="http://www.webdesignerwall.com/wp-content/uploads/2010/04/browser-preview.gif" alt="preview" /></p>
<h3>Button States</h3>
<ul>
<li>normal state = gradient with border and shadow styles.</li>
<li>hover = darker gradient</li>
<li>active = gradient is reversed, 1px down, and darker font color as  well.</li>
</ul>
<p><img src="http://www.webdesignerwall.com/wp-content/uploads/2010/04/button-states.gif" alt="button states" /></p>
<h3>General Styles For The Button</h3>
<p>The following code is the general styles for the .button class. I use  em value in the padding and border-radius property to make it scalable  base on the font-size. To adjust the rounded corners and button size,  simply change the border-radius, font-size and padding values. For  example: I can make a smaller button by decreasing the font-size and  padding values  (see <a href="http://www.webdesignerwall.com/demo/css-buttons.html">demo</a>).</p>
<p>For more details on border-radius, text-shadow, and box-shadow, read  my article <a href="http://www.webdesignerwall.com/tutorials/the-basics-of-css3/">The  Basics of CSS3</a>.</p>
<pre class="brush: css;">.button {
	display: inline-block;
	outline: none;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
	font: 14px/100% Arial, Helvetica, sans-serif;
	padding: .5em 2em .55em;
	text-shadow: 0 1px 1px rgba(0,0,0,.3);
	-webkit-border-radius: .5em;
	-moz-border-radius: .5em;
	border-radius: .5em;
	-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
	-moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
	box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.button:hover {
	text-decoration: none;
}
.button:active {
	position: relative;
	top: 1px;
}
</pre>
<p><img src="http://www.webdesignerwall.com/wp-content/uploads/2010/04/button-general-styles.gif" alt="button general styles" /></p>
<h3>Color Gradient Styles</h3>
<p>The code below is the CSS styling for the orange button. The first  background line is a fallback for the non-CSS3 browsers, the second line  is for Webkit browsers, the third line is for Firefox, and the last  line is a gradient filter that is only read by Internet Explorer.</p>
<p>For more details on  CSS gradient,  read my article <a href="http://www.webdesignerwall.com/tutorials/cross-browser-css-gradient/">Cross-Browser  CSS Gradient</a>.</p>
<pre class="brush: css;">.orange {
	color: #fef4e9;
	border: solid 1px #da7c0c;
	background: #f78d1d;
	background: -webkit-gradient(linear, left top, left bottom, from(#faa51a), to(#f47a20));
	background: -moz-linear-gradient(top,  #faa51a,  #f47a20);
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#faa51a', endColorstr='#f47a20');
}
.orange:hover {
	background: #f47c20;
	background: -webkit-gradient(linear, left top, left bottom, from(#f88e11), to(#f06015));
	background: -moz-linear-gradient(top,  #f88e11,  #f06015);
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#f88e11', endColorstr='#f06015');
}
.orange:active {
	color: #fcd3a5;
	background: -webkit-gradient(linear, left top, left bottom, from(#f47a20), to(#faa51a));
	background: -moz-linear-gradient(top,  #f47a20,  #faa51a);
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#f47a20', endColorstr='#faa51a');
}
</pre>
<p><img src="http://www.webdesignerwall.com/wp-content/uploads/2010/04/css-color-styles.gif" alt="button general styles" /></p>
<h3>How To Use My Buttons?</h3>
<p>Lets say you like the blue button and want to use it on your page:</p>
<ul>
<li>First, copy the .button and .blue CSS (view <a href="http://www.webdesignerwall.com/demo/css-buttons.html">demo source  code</a>).</li>
<li>Then, add  to the HTML element where you want  the button to be (eg. <code>&lt;a href="#"&gt;Button&lt;/a&gt;</code>). The CSS classes can be applied to any  element such as link, p, span, div, input, button, etc.</li>
</ul>
<p><img src="http://www.webdesignerwall.com/wp-content/uploads/2010/04/applying.jpg" alt="applying" /></p>]]></content:encoded>
			<wfw:commentRss>http://www.my-folios.com/code/css3-gradient-buttons.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何使用WordPress 2.9内置文章缩略图功能Post Thumbnail &#124; 帕兰映像</title>
		<link>http://www.my-folios.com/code/%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8wordpress-2-9%e5%86%85%e7%bd%ae%e6%96%87%e7%ab%a0%e7%bc%a9%e7%95%a5%e5%9b%be%e5%8a%9f%e8%83%bdpost-thumbnail-%e5%b8%95%e5%85%b0%e6%98%a0%e5%83%8f.html</link>
		<comments>http://www.my-folios.com/code/%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8wordpress-2-9%e5%86%85%e7%bd%ae%e6%96%87%e7%ab%a0%e7%bc%a9%e7%95%a5%e5%9b%be%e5%8a%9f%e8%83%bdpost-thumbnail-%e5%b8%95%e5%85%b0%e6%98%a0%e5%83%8f.html#comments</comments>
		<pubDate>Thu, 25 Feb 2010 07:30:58 +0000</pubDate>
		<dc:creator>Jay Kwong</dc:creator>
				<category><![CDATA[Functions]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[thumb]]></category>

		<guid isPermaLink="false">http://www.my-folios.com/code/?p=48</guid>
		<description><![CDATA[1. 激活文章缩略图功能 要激活该功能，打开你主题的functions.php文件，输入下面的代码: add_theme_support( 'post-thumbnails' ); 你也可以添加一个参数来指定在post还是page激活该功能: add_theme_support( 'post-thumbnails', array( 'post', 'page' ) ); 默认是在两者里都激活的。激活后，在你的post或page编辑页面的侧边栏底部，就能看到该功能的设置模块了。 2.输出到主题 要在你的主题中显示出设置的图片，你需要在loop里面添加下面这个函数: 你可以给该函数传递一个参数值来调用图片的不同尺寸， the_post_thumbnail(); // 默认显示缩略图 the_post_thumbnail('thumbnail'); // 显示缩略图 the_post_thumbnail('medium'); // 显示中等尺寸 the_post_thumbnail('large'); // 显示大尺寸 the_post_thumbnail( array(100,100) ); // 自定义尺寸 3. 在loop外调用某篇文章的文章缩略图 如果你想在loop以外调用某些文章的缩略图，另一个函数为你准备: 和the_post_thumbnail()相比，它需要再传入一个参数来指定文章的ID: get_the_post_thumbnail($id); get_the_post_thumbnail($id, 'thumbnail'); get_the_post_thumbnail($id, 'medium'); get_the_post_thumbnail($id, 'large'); get_the_post_thumbnail($id, array(100,100) ); 对于大多数wordpress用户来说，知道上面这些就已经足够了。如果你是一个主题开发者，想了解的更深入，可以查看justintadlock的这篇文章： Everything you need to know [...]]]></description>
			<content:encoded><![CDATA[<p><strong>1. 激活文章缩略图功能</strong></p>
<p>要激活该功能，打开你主题的functions.php文件，输入下面的代码:</p>
<pre class="brush: php;">
add_theme_support( 'post-thumbnails' );
</pre>
<p>你也可以添加一个参数来指定在post还是page激活该功能:</p>
<pre class="brush: php;">
add_theme_support( 'post-thumbnails', array( 'post', 'page' ) );
</pre>
<p>默认是在两者里都激活的。激活后，在你的post或page编辑页面的侧边栏底部，就能看到该功能的设置模块了。<br />
<strong></strong></p>
<p><strong>2.输出到主题</strong></p>
<p>要在你的主题中显示出设置的图片，你需要在loop里面添加下面这个函数:</p>
<pre class="brush: php;">
</pre>
<p>你可以给该函数传递一个参数值来调用图片的不同尺寸，</p>
<pre class="brush: php;">
the_post_thumbnail();                  // 默认显示缩略图

the_post_thumbnail('thumbnail');       // 显示缩略图
the_post_thumbnail('medium');          // 显示中等尺寸
the_post_thumbnail('large');           // 显示大尺寸

the_post_thumbnail( array(100,100) );  // 自定义尺寸
</pre>
<p><strong>3. 在loop外调用某篇文章的文章缩略图</strong></p>
<p>如果你想在loop以外调用某些文章的缩略图，另一个函数为你准备:</p>
<pre class="brush: php;">
</pre>
<p>和the_post_thumbnail()相比，它需要再传入一个参数来指定文章的ID:</p>
<pre class="brush: php;">
get_the_post_thumbnail($id);

get_the_post_thumbnail($id, 'thumbnail');
get_the_post_thumbnail($id, 'medium');
get_the_post_thumbnail($id, 'large');

get_the_post_thumbnail($id, array(100,100) );
</pre>
<p>对于大多数wordpress用户来说，知道上面这些就已经足够了。如果你是一个主题开发者，想了解的更深入，可以查看justintadlock的这篇文章：</p>
<p>Everything you need to know about WordPress 2.9’s post image feature</p>
<p>里面还介绍了如何添加函数连接到过滤器动作来改变文章缩略图尺寸和缩略图的html代码输出。</p>
<p>via <a href="http://paranimage.com/how-to-use-wordpress-2-9-post-thumbnai-function/">如何使用WordPress 2.9内置文章缩略图功能Post Thumbnail | 帕兰映像</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.my-folios.com/code/%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8wordpress-2-9%e5%86%85%e7%bd%ae%e6%96%87%e7%ab%a0%e7%bc%a9%e7%95%a5%e5%9b%be%e5%8a%9f%e8%83%bdpost-thumbnail-%e5%b8%95%e5%85%b0%e6%98%a0%e5%83%8f.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wp-caption</title>
		<link>http://www.my-folios.com/code/wp-caption.html</link>
		<comments>http://www.my-folios.com/code/wp-caption.html#comments</comments>
		<pubDate>Tue, 23 Feb 2010 07:49:01 +0000</pubDate>
		<dc:creator>Jay Kwong</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[caption]]></category>

		<guid isPermaLink="false">http://www.my-folios.com/code/?p=46</guid>
		<description><![CDATA[.wp-caption{ background: #ffffff; text-align:center!important; border:1px solid #D0D0D0; width:570px!important; padding:3px;-moz-border-radius: 5px; -webkit-border-radius: 5px; } .wp-caption img{ max-width:100%; text-align:center; padding:0px!important; margin:0 auto} .wp-caption .wp-caption-text{ padding:3px!important; margin:0!important; font-size:11px!important; color: #666}]]></description>
			<content:encoded><![CDATA[<pre class="brush: css;">
.wp-caption{ background: #ffffff; text-align:center!important; border:1px solid #D0D0D0; width:570px!important; padding:3px;-moz-border-radius: 5px;
-webkit-border-radius: 5px; }
.wp-caption img{ max-width:100%; text-align:center; padding:0px!important; margin:0 auto}
.wp-caption .wp-caption-text{ padding:3px!important; margin:0!important; font-size:11px!important; color: #666}
</pre>]]></content:encoded>
			<wfw:commentRss>http://www.my-folios.com/code/wp-caption.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Widgetize Your WordPress Theme</title>
		<link>http://www.my-folios.com/code/widgetize-your-wordpress-theme.html</link>
		<comments>http://www.my-folios.com/code/widgetize-your-wordpress-theme.html#comments</comments>
		<pubDate>Wed, 17 Feb 2010 11:38:31 +0000</pubDate>
		<dc:creator>Jay Kwong</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[Widget]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.my-folios.com/code/widgetize-your-wordpress-theme.html</guid>
		<description><![CDATA[if (function_exists('register_sidebar')) { register_sidebar(array( 'name' =&#62; 'Widgetized Area', 'id' =&#62; 'widgetized-area', 'description' =&#62; 'This is a widgetized area.', 'before_widget' =&#62; '&#60;div id=&#34;%1$s&#34; class=&#34;widget %2$s&#34;&#62;', 'after_widget' =&#62; '&#60;/div&#62;', 'before_title' =&#62; '&#60;h4&#62;', 'after_title' =&#62; '&#60;/h4&#62;' )); } This is all that is needed for the first step. Once this widgetizing code is placed in your functions.php file, [...]]]></description>
			<content:encoded><![CDATA[<pre class="brush: php;">
if (function_exists('register_sidebar')) {

	register_sidebar(array(
		'name' =&gt; 'Widgetized Area',
		'id'   =&gt; 'widgetized-area',
		'description'   =&gt; 'This is a widgetized area.',
		'before_widget' =&gt; '&lt;div id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;',
		'after_widget'  =&gt; '&lt;/div&gt;',
		'before_title'  =&gt; '&lt;h4&gt;',
		'after_title'   =&gt; '&lt;/h4&gt;'
	));

}
</pre>
<p>This is all that is needed for the first step. Once this widgetizing code is placed in your functions.php file, proceed to Step 2. The remainder of this section is explanation.</p>
<p>This code checks to make sure that the current version of WordPress supports widgets, and then declares an array of values that will be used to create the widgetized area in your theme. Here are the different values:</p>
<p>    * name – the name of the widgetized area as displayed in the WP Admin<br />
    * id – a unique identifier for your widgetized area<br />
    * description – description of the widgetized area<br />
    * before_widget – the markup generated before any user-added widgets<br />
    * after_widget – the markup generated after any user-added widgets<br />
    * before_title – the markup generated before the title of any user-added widgets<br />
    * after_title – the markup generated after the title of any user-added widgets</p>
<p>So, given these parameters, our widgetizing code would result in the following output, say, if the built-in Search widget were added to our widgetized area:</p>
<pre class="brush: xml;">
&lt;div id=&quot;search-3&quot; class=&quot;widget widget_search&quot;&gt;
	&lt;h4&gt;Search&lt;/h4&gt;
	&lt;form role=&quot;search&quot; method=&quot;get&quot; id=&quot;searchform&quot; action=&quot;http://localhost/283/&quot; &gt;
		&lt;div&gt;
			&lt;label class=&quot;screen-reader-text&quot; for=&quot;s&quot;&gt;Search for:&lt;/label&gt;
			&lt;input type=&quot;text&quot; value=&quot;&quot; name=&quot;s&quot; id=&quot;s&quot; /&gt;
			&lt;input type=&quot;submit&quot; id=&quot;searchsubmit&quot; value=&quot;Search&quot; /&gt;
		&lt;/div&gt;
	&lt;/form&gt;
&lt;/div&gt;
</pre>
<p>Note the markup created for the opening
<div>, which gets its attribute information based on the wild-card matching specified in our widgetizing array. To see this more clearly, examine the following side-by-side comparison of the sprintf directives and the resulting (X)HTML source code:</p>
<pre class="brush: xml;">
'before_widget' =&gt; '&lt;div id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;',
&lt;div id=&quot;search-3&quot; class=&quot;widget widget_search&quot;&gt;
</pre>
<p>Hopefully the relationship is clear. This is a powerful way to ensure that all widgets have a similar class names and unique IDs, which are important for easy CSS styles.</p>
<p>Widgetize Your WordPress Theme: Step 2</p>
<p>Finally, add the following code to the location in your theme’s template file(s) where you would like the widgetized area to appear:</p>
<pre class="brush: xml;">
&lt;div id=&quot;widgetized-area&quot;&gt;

	&lt;?php if (function_exists('dynamic_sidebar') &amp;&amp; dynamic_sidebar('widgetized-area')) : else : ?&gt;

	&lt;div class=&quot;pre-widget&quot;&gt;
		&lt;p&gt;&lt;strong&gt;Widgetized Area&lt;/strong&gt;&lt;/p&gt;
		&lt;p&gt;This panel is active and ready for you to add some widgets via the WP Admin&lt;/p&gt;
	&lt;/div&gt;

	&lt;?php endif; ?&gt;

&lt;/div&gt;
</pre>]]></content:encoded>
			<wfw:commentRss>http://www.my-folios.com/code/widgetize-your-wordpress-theme.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Highlight Search Terms in Results</title>
		<link>http://www.my-folios.com/code/highlight-search-terms-in-results.html</link>
		<comments>http://www.my-folios.com/code/highlight-search-terms-in-results.html#comments</comments>
		<pubDate>Wed, 17 Feb 2010 09:48:26 +0000</pubDate>
		<dc:creator>Jay Kwong</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://www.my-folios.com/code/?p=43</guid>
		<description><![CDATA[In an attempt to make your WordPress search even more user friendly, you can highlight the search terms in the results. We did this for one of our clients, so we thought it would be useful for other users. In this article we will show you how you can highlight search terms in the results [...]]]></description>
			<content:encoded><![CDATA[<p>In an attempt to make your WordPress search even more user friendly, you can highlight the search terms in the results. We did this for one of our clients, so we thought it would be useful for other users. In this article we will show you how you can highlight search terms in the results in WordPress.</p>
<p>First open your search.php and look for the following code:</p>
<pre class="brush: php;">&lt;?php the_title(); ?&gt;</pre>
<p>Replace the above code with:</p>
<pre class="brush: php;">&lt;?php echo $title; ?&gt;</pre>
<p>Make sure that you paste this line above the title code:</p>
<pre class="brush: php;">
&lt;?php $title = get_the_title(); $keys= explode(&quot; &quot;,$s); $title = preg_replace('/('.implode('|', $keys) .')/iu', '&lt;strong class=&quot;search-excerpt&quot;&gt;&#92;&#48;&lt;/strong&gt;', $title); ?&gt;
</pre>
<p>Now open your CSS file and add the styling for the class search-excerpt, and it will highlight the term. Currently the code is making the search terms bold.</p>]]></content:encoded>
			<wfw:commentRss>http://www.my-folios.com/code/highlight-search-terms-in-results.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inner shadows in CSS3 « Devthought</title>
		<link>http://www.my-folios.com/code/inner-shadows-in-css3-%c2%ab-devthought.html</link>
		<comments>http://www.my-folios.com/code/inner-shadows-in-css3-%c2%ab-devthought.html#comments</comments>
		<pubDate>Tue, 09 Feb 2010 06:48:15 +0000</pubDate>
		<dc:creator>Jay Kwong</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[-webkit-border-radius]]></category>
		<category><![CDATA[-webkit-box-shadow]]></category>

		<guid isPermaLink="false">http://www.my-folios.com/code/?p=41</guid>
		<description><![CDATA[-webkit-box-shadow (in Webkit nightly) and -moz-box-shadow support inner shadows with the inset keyword. Both also support multiple shadow declarations separated by commas. div.box { -webkit-box-shadow: 0 3px 3px rgba(0,0,0,0.20), rgba(0,0,0,0.12) 0px 0px 10px inset; -moz-box-shadow: 0 3px 3px rgba(0,0,0,0.20), rgba(0,0,0,0.12) 0px 0px 10px inset; -webkit-border-radius: 10px; -moz-border-radius: 10px; border: 1px solid #fff; padding: 6px; width: [...]]]></description>
			<content:encoded><![CDATA[<p><code class="inline">-webkit-box-shadow</code> (in Webkit nightly)  and <code class="inline">-moz-box-shadow</code> support inner shadows  with the <code class="inline">inset</code> keyword. Both also support  multiple shadow declarations separated by commas.</p>
<p><img src="http://cld.ly/8719st" alt="" /></p>
<pre class="brush: css;">
div.box {
-webkit-box-shadow: 0 3px 3px rgba(0,0,0,0.20), rgba(0,0,0,0.12) 0px 0px 10px inset;
-moz-box-shadow: 0 3px 3px rgba(0,0,0,0.20), rgba(0,0,0,0.12) 0px 0px 10px inset;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border: 1px solid #fff;
padding: 6px;
width: 200px;
background: #fff;
}
</pre>
<p>via <a href="http://devthought.com/tumble/2010/02/inner-shadows-in-css3/">Inner shadows in CSS3 « Devthought</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.my-folios.com/code/inner-shadows-in-css3-%c2%ab-devthought.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Buttons with CSS3 and RGBA</title>
		<link>http://www.my-folios.com/code/buttons-with-css3-and-rgba.html</link>
		<comments>http://www.my-folios.com/code/buttons-with-css3-and-rgba.html#comments</comments>
		<pubDate>Fri, 22 Jan 2010 06:54:11 +0000</pubDate>
		<dc:creator>Jay Kwong</dc:creator>
				<category><![CDATA[Button]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[-moz-border-radius]]></category>
		<category><![CDATA[text-shadow]]></category>

		<guid isPermaLink="false">http://www.my-folios.com/code/?p=37</guid>
		<description><![CDATA[.awesome{ background: #222 url(/images/alert-overlay.png) repeat-x; display: inline-block; padding: 5px 10px 6px; color: #fff; text-decoration: none; font-weight: bold; line-height: 1; -moz-border-radius: 5px; -webkit-border-radius: 5px; -moz-box-shadow: 0 1px 3px #999; -webkit-box-shadow: 0 1px 3px #999; text-shadow: 0 -1px 1px #222; border-bottom: 1px solid #222; position: relative; cursor: pointer; } /* Sizes ---------- */ .small.awesome { font-size: 11px; [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.zurb.com/blog_uploads/0000/0394/super-awesome-buttons.png" alt="" /></p>
<p><a href="http://www.zurb.com/blog_uploads/0000/0617/buttons-03.html" target="_blank"><img src="http://www.zurb.com/blog_uploads/0000/0397/super-awesome-buttons-all.png" alt="" /></a>
<pre class="brush: css;">

.awesome{
background: #222 url(/images/alert-overlay.png) repeat-x;
display: inline-block;
padding: 5px 10px 6px;
color: #fff;
text-decoration: none;
font-weight: bold;
line-height: 1;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-moz-box-shadow: 0 1px 3px #999;
-webkit-box-shadow: 0 1px 3px #999;
text-shadow: 0 -1px 1px #222;
border-bottom: 1px solid #222;
position: relative;
cursor: pointer;
}
</pre>
<pre class="brush: css;">
  /* Sizes ---------- */
 .small.awesome {
 font-size: 11px;
 }
.medium.awesome {
 font-size: 13px;
 }
.large.awesome {
font-size: 14px;
 padding: 8px 14px 9px;
}

 /* Colors ---------- */
 .blue.awesome {
 background-color: #2daebf;
}
 .red.awesome {
 background-color: #e33100;
 }
 .magenta.awesome {
 background-color: #a9014b;
 }
 .orange.awesome {
 background-color: #ff5c00;
 }
.yellow.awesome {
 background-color: #ffb515;
 }
</pre>
<p>via <a href="http://www.zurb.com/article/266/super-awesome-buttons-with-css3-and-rgba">ZURB – Super Awesome Buttons with CSS3 and RGBA</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.my-folios.com/code/buttons-with-css3-and-rgba.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

