<?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>Kashif Mushtaq &#187; CSS</title>
	<atom:link href="http://www.kash-if.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kash-if.com</link>
	<description>think again!</description>
	<lastBuildDate>Thu, 17 Dec 2009 08:55:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Simple Double Quotes</title>
		<link>http://www.kash-if.com/simple-double-quotes/</link>
		<comments>http://www.kash-if.com/simple-double-quotes/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 03:24:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.kash-if.com/?p=19</guid>
		<description><![CDATA[This CSS tutorial will show you how to display two double-quote images using one blockquote tag. The trick here is apply one background image to blockquote, and then apply another background to the first-letter (pseudo-element) of blockquote. Preview double quotes Download HTML file 1. HTML source code Start with a blockquote and some text. &#60;blockquote&#62;Hello, [...]]]></description>
			<content:encoded><![CDATA[<p class="intro">This CSS tutorial will show you how to display two double-quote images using one blockquote tag. The trick here is apply one background image to blockquote, and then apply another background to the first-letter (pseudo-element) of blockquote.<br />
<span id="more-19"></span></p>
<ul>
<li><strong><a class="thickbox" title="Double Quotes Preview" href="http://www.webdesignerwall.com/demo/doublequote/doublequote.html?TB_iframe=true&amp;height=300&amp;width=550">Preview <span>double quotes</span></a></strong></li>
<li><strong><a title="download html file" href="http://www.webdesignerwall.com/demo/doublequote/doublequote.html">Download <span>HTML file</span></a></strong></li>
</ul>
<h3><em>1.</em> HTML source code</h3>
<p>Start with a <code>blockquote</code> and some text.</p>
<pre><code class="html"><span class="tag">&lt;<span class="keyword">blockquote</span>&gt;</span>Hello, I am a double quote...<span class="tag">&lt;/<span class="keyword">blockquote</span>&gt;</span>
</code></pre>
<h3><em>2.</em> Specify blockquote</h3>
<p>Specify  <code>blockquote</code> element as follow:</p>
<pre><code class="css"><span class="keyword">blockquote</span> <span class="rules">{
  <span class="keyword">font</span>:<span class="value"> 1.2em/1.6em Georgia, "Times New Roman", Times, serif</span>;
  <span class="keyword">width</span>:<span class="value"> 400px</span>;
  <span class="keyword">background</span>:<span class="value"> url(images/close-quote.gif) no-repeat right bottom</span>;
  <span class="keyword">padding-left</span>:<span class="value"> 18px</span>;
  <span class="keyword">text-indent</span>:<span class="value"> -18px</span>;
}</span>
</code></pre>
<p>The CSS code above will display the close-quote.gif graphic background at bottom right corner. The padding-left and text-indent will create a hanging indent of -18px. It will look like this:</p>
<p class="image"><img src="http://www.webdesignerwall.com/wp-content/uploads/2007/07/doublequote-2.gif" alt="step 2" /></p>
<h3><em>3.</em> First letter of blockquote</h3>
<p>Now add 18px left padding to the first-letter of blockquote. This will make the text align together. Then display the open-quote.gif at top left corner. Note I made the first letter in different font styles just to look nice.</p>
<pre><code class="css"><span class="keyword">blockquote</span>:first-letter <span class="rules">{
  <span class="keyword">background</span>:<span class="value"> url(images/open-quote.gif) no-repeat left top</span>;
  <span class="keyword">padding-left</span>:<span class="value"> 18px</span>;
  <span class="keyword">font</span>:<span class="value"> italic 1.4em Georgia, "Times New Roman", Times, serif</span>;
}</span>
</code></pre>
<p class="image"><img src="http://www.webdesignerwall.com/wp-content/uploads/2007/07/doublequote-3.gif" alt="step 3" /></p>
<h3>Pullquote style</h3>
<p>If you want to make a pullquote, simply specify the blockquote float left or right. View my <strong><a class="thickbox" title="Pullquote Sample" href="http://www.webdesignerwall.com/demo/doublequote/pullquote.html?TB_iframe=true&amp;height=470&amp;width=750">pullquote sample</a></strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kash-if.com/simple-double-quotes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS: Gradient Text Effect</title>
		<link>http://www.kash-if.com/css-gradient-text-effect/</link>
		<comments>http://www.kash-if.com/css-gradient-text-effect/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 03:16:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[design]]></category>

		<guid isPermaLink="false">http://www.kash-if.com/?p=17</guid>
		<description><![CDATA[Do you want to create fancy headings without rendering each heading with Photoshop? Here is a simple CSS trick to show you how to create gradient text effect with a PNG image (pure CSS, no Javascript or Flash). All you need is an empty &#60;span&#62; tag in the heading and apply the background image overlay [...]]]></description>
			<content:encoded><![CDATA[<p class="intro">Do you want to create fancy headings without rendering each heading with Photoshop? Here is a simple CSS trick to show you how to create gradient text effect with a PNG image (pure CSS, no Javascript or Flash). All you need is an empty <code>&lt;span&gt;</code> tag in the heading and apply the background image overlay using the CSS <code>position:absolute</code> property. This trick has been tested on most browsers: Firefox, Safari, Opera, and even Internet Explorer 6. Continue to read this article to find out how.<br />
<span id="more-17"></span></p>
<ul>
<li><a href="http://www.webdesignerwall.com/demo/css-gradient-text/">View <span>Demos</span></a></li>
<li><a title="Download source files" href="http://www.webdesignerwall.com/file/css-gradient-demo.zip">Download <span> Demo ZIP</span></a></li>
</ul>
<h3>Benefits</h3>
<ul>
<li>This is pure CSS trick, no Javascript or Flash. It works on most browsers including IE6 (PNG hack required).</li>
<li>It is perfect for designing headings. You don’t have to render each heading with Photoshop. This will save you time and bandwidth.</li>
<li>You can use on any web fonts and the font size remains scalable.</li>
</ul>
<h3>How does this work?</h3>
<p>The trick is very simple. Basically we are just adding a 1px gradient PNG (with alpha transparency) over the text.</p>
<p class="image"><a href="http://www.webdesignerwall.com/demo/css-gradient-text/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/01/screen1.gif" alt="screenshot" /></a></p>
<h3>The HTML markups</h3>
<pre><code class="html"><span class="tag">&lt;<span class="keyword">h1</span>&gt;</span><span class="tag">&lt;<span class="keyword">span</span>&gt;</span><span class="tag">&lt;/<span class="keyword">span</span>&gt;</span>CSS Gradient Text<span class="tag">&lt;/<span class="keyword">h1</span>&gt;</span></code></pre>
<h3>The CSS</h3>
<p>The key point here is: <code>h1 { position: relative } </code>and <code>h1 span { </code><code>position: absolute }</code></p>
<pre><code class="css"><span class="keyword">h1</span> <span class="rules">{
  <span class="keyword">font</span>:<span class="value"> bold 330%/100% "Lucida Grande"</span>;
  <span class="keyword">position</span>:<span class="value"> relative</span>;
  <span class="keyword">color</span>:<span class="value"> #464646</span>;
}</span>
<span class="keyword">h1</span> <span class="keyword">span</span> <span class="rules">{
  <span class="keyword">background</span>:<span class="value"> url(gradient.png) repeat-x</span>;
  <span class="keyword">position</span>:<span class="value"> absolute</span>;
  <span class="keyword">display</span>:<span class="value"> block</span>;
  <span class="keyword">width</span>:<span class="value"> 100%</span>;
  <span class="keyword">height</span>:<span class="value"> 31px</span>;
}</span></code></pre>
<p><em>That’s it!</em> You are done. <a href="http://www.webdesignerwall.com/demo/css-gradient-text/">Click here</a> to view my demo page.</p>
<h3>Make it work on IE6</h3>
<p>Since IE6 doesn’t render PNG-24 properly, the following hack is required in order to display the transparent PNG (add anywhere in between the <code>&lt;head&gt;</code> tag):</p>
<pre><code class="css">&lt;!--<span class="attr_selector">[if lt IE 7]</span>&gt;

&lt;<span class="keyword">style</span>&gt;
<span class="keyword">h1</span> <span class="keyword">span</span> <span class="rules">{
  <span class="keyword">background</span>:<span class="value"> none</span>;
  filter:<span class="value"> progid:DXImageTransform.Microsoft.AlphaImageLoader(src='gradient.png', sizingMethod='scale')</span>;
}</span>
&lt;/<span class="keyword">style</span>&gt;

&lt;!<span class="attr_selector">[endif]</span>--&gt;</code></pre>
<p><em>This is why <a href="http://www.webdesignerwall.com/general/trash-all-ie-hacks/">we hate IE 6</a>!</em></p>
<h3>jQuery prepend version (for semantic lovers)</h3>
<p>If you don’t want to have the empty <code>&lt;span&gt;</code> tag in the heading, you can use Javascript to prepend the <code>&lt;span&gt;</code> tag. Here is a sample using <a href="http://jquery.com/" target="_top">jQuery</a> prepend method:</p>
<pre><code class="html"><span class="tag">&lt;<span class="keyword">script</span><span class="attribute"> type=<span class="value">"text/javascript"</span></span><span class="attribute"> src=<span class="value">"jquery.js"</span></span>&gt;</span><span class="tag">&lt;/<span class="keyword">script</span>&gt;</span>

<span class="tag">&lt;<span class="keyword">script</span><span class="attribute"> type=<span class="value">"text/javascript"</span></span>&gt;</span>
$(document).ready(function(){

  //prepend span tag to H1
  $("h1").prepend("<span class="tag">&lt;<span class="keyword">span</span>&gt;</span><span class="tag">&lt;/<span class="keyword">span</span>&gt;</span>");

});
<span class="tag">&lt;/<span class="keyword">script</span>&gt;</span></code></pre>
<h3>More samples</h3>
<p>Want  to make <del>Web 2.0</del> glossy text?</p>
<p class="image"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/01/screen2.gif" alt="screenshot" /></p>
<p>Literally, you can apply this trick on any solid background color (as long your gradient color is the same as your background color).</p>
<p class="image"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/01/screen3.gif" alt="screenshot" /></p>
<p class="image"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/01/screen4.gif" alt="screenshot" /></p>
<p class="image"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/01/screen5.gif" alt="screenshot" /></p>
<p class="image"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/01/screen6.gif" alt="screenshot" /></p>
<p class="image"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/01/screen7.gif" alt="screenshot" /></p>
<p class="image"><a href="http://www.webdesignerwall.com/demo/css-gradient-text/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/01/screen8.jpg" alt="screenshot" /></a></p>
<h3>Pattern / Texture</h3>
<p>You can also apply this trick with a tile background image. Look, here is an example of zebra pattern. So, be creative!</p>
<p class="image"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/01/screen9.gif" alt="screenshot" /></p>
<h3>Limitations and more…</h3>
<ul>
<li>This trick is only suitable for solid background color elements. Your gradient color (PNG image) must be the same color as your background color.</li>
<li>IE PNG hack is required if you want it to work on IE 6.</li>
<li>If your gradient image is taller than the heading, the text will not be selectable.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.kash-if.com/css-gradient-text-effect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS: Decorative Gallery</title>
		<link>http://www.kash-if.com/css-decorative-gallery/</link>
		<comments>http://www.kash-if.com/css-decorative-gallery/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 03:08:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.kash-if.com/?p=15</guid>
		<description><![CDATA[Did you like my previous CSS tutorial on how to create gradient text effects? I’m using the same trick to show you how to decorate your images and photo galleries without editing the source images. The trick is very simple. All you need is an extra &#60;span&#62; tag and apply a background image to create [...]]]></description>
			<content:encoded><![CDATA[<p class="intro">Did you like my previous CSS tutorial on how to  create gradient text effects? I’m using the same trick to show you how to decorate your images and photo galleries without editing the source images. The trick is very simple. All you need is an extra <code>&lt;span&gt;</code> tag and apply a background image to create the overlaying effect. It is very easy and flexible — see my demos with over 20 styles, from a simple image icon to a rounded corner to a masked layer (both decorative and complex).<br />
<span id="more-15"></span></p>
<ul>
<li><a class="thickbox" href="http://www.webdesignerwall.com/demo/decorative-gallery/decorative-gallery-index.html?TB_iframe=true&amp;height=550&amp;width=840">View Demo <span>Gallery</span></a></li>
<li><a title="Download source files" href="http://www.webdesignerwall.com/file/decorative-gallery-demo.zip">Download <span> Demo ZIP</span></a></li>
</ul>
<h3>What Are The Benefits Of This CSS Trick?</h3>
<ul>
<li><strong>Saves Time</strong> — You don’t have to manually create the decorative template in Photoshop and export the individual image.</li>
<li><strong>Keeps  Original Source Images</strong> — So you don’t have to worry about changing the design theme in the future.</li>
<li><strong>Very Flexible</strong> — You can have a completely different look and feel by just editing the CSS.</li>
<li><strong>It Works on Any Site</strong> — This CSS trick works on any type of site, with any image size.</li>
<li><strong>Cross-Browser CompatIble</strong> — It has passed the test on most browsers (Firefox, Safari, Opera, and even the &#8220;<a href="http://www.webdesignerwall.com/general/trash-all-ie-hacks/">buggy IE6</a>&#8220;).</li>
</ul>
<h3>Basic Concept  <small>(see <a href="http://www.webdesignerwall.com/demo/decorative-gallery/decorative-gallery-index.html">demo</a>)</small></h3>
<p>You need to insert an extra <code>&lt;span&gt;</code> tag within the <code>&lt;div&gt;</code> tag, with which we’ll apply a background image to create the overlaying effect. If you don’t like to have an empty <code>span</code> tag, you can append the <code>span</code> tag by Javascript (I’ll show you how later in this tutorial). Here is how it works:</p>
<p class="image"><a href="http://www.webdesignerwall.com/demo/decorative-gallery/decorative-gallery-index.html"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/05/basic-concept.gif" alt="Basic Concept" /></a></p>
<p>Then in the CSS, the key point you have to remember is: specify the <code>div</code> element to <code>position:relative</code> and the <code>span</code> element to <code>position:absolute</code>. You can position the <code>span</code> element anywhere you want by using the <code>top</code> and <code>left</code> property.</p>
<h4>IE PNG Hack</h4>
<p>To make the transparent PNG image work on IE6, I use this wonderful <a href="http://www.twinhelix.com/css/iepngfix/" target="_top">iepngfix.htc</a> hack. Download a copy of iepngfix.htc and  insert the following code in between the <code>&lt;head&gt;</code> tag:</p>
<pre><code>&lt;!--[if lt IE 7]&gt;
&lt;style type="text/css"&gt;

  .photo span { behavior: url(iepngfix.htc); }

&lt;/style&gt;
&lt;![endif]--&gt;
</code></pre>
<h4>Look and Feel</h4>
<p>To change the look and feel, simply edit the CSS specifications of the <code>span</code> element. Click the image below to see the demos I have. To show you how flexible it is, I’ve created 15 different styles (notice the HTML markup is same).</p>
<p class="image"><a href="http://www.webdesignerwall.com/demo/decorative-gallery/decorative-gallery-index.html"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/05/demo-screenshot.jpg" alt="Demo screenshot" /></a></p>
<h3>The jQuery Solution <small>(see <a href="http://www.webdesignerwall.com/demo/decorative-gallery/decorative-gallery-index-jquery.html">demo</a>)</small></h3>
<p>I know some of you (particularly the web accessibility fans) don’t like to have an empty <code>span</code> tag in the markup. Well, I’ve solved this issue by using jQuery to append the <code>span</code> tag to the source code. Insert the following code in between the <code>&lt;head&gt;</code> tag:</p>
<pre><code class="html"><span class="tag">&lt;<span class="keyword">script</span><span class="attribute"> type=<span class="value">"text/javascript"</span></span><span class="attribute"> src=<span class="value">"jquery.js"</span></span>&gt;</span><span class="tag">&lt;/<span class="keyword">script</span>&gt;</span>
<span class="tag">&lt;<span class="keyword">script</span><span class="attribute"> type=<span class="value">"text/javascript"</span></span>&gt;</span>
$(document).ready(function(){

  //prepend span tag
  $(".photo a").prepend("<span class="tag">&lt;<span class="keyword">span</span>&gt;</span><span class="tag">&lt;/<span class="keyword">span</span>&gt;</span>");

});
<span class="tag">&lt;/<span class="keyword">script</span>&gt;</span>
</code></pre>
<h3><em>#1.</em> Simple Gallery <small>(see <a href="http://www.webdesignerwall.com/demo/decorative-gallery/1_simple-gallery.html">demo</a>)</small></h3>
<p>Let’s take the technique from the previous step and apply it to create a photo gallery.</p>
<p class="image"><a href="http://www.webdesignerwall.com/demo/decorative-gallery/1_simple-gallery.html"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/05/demo1.gif" alt="Demo 1" /></a></p>
<h3><em>#1b.</em> Mini Icons <small>(see <a href="http://www.webdesignerwall.com/demo/decorative-gallery/1b_mini-icons.html">demo</a>)</small></h3>
<p>This example shows you how to position different icons on top of each photo (note: an extra CSS class name is required in the <code>span</code> tag).</p>
<p class="image"><a href="http://www.webdesignerwall.com/demo/decorative-gallery/1b_mini-icons.html"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/05/demo1b.gif" alt="Demo 1b" /></a></p>
<h3><em>#2.</em> Photo With Text <small>(see <a href="http://www.webdesignerwall.com/demo/decorative-gallery/2_photo-with-text.html">demo</a>)</small></h3>
<p>This example shows you how to create a gallery with linking text (<code>em</code> tag).</p>
<p class="image"><a href="http://www.webdesignerwall.com/demo/decorative-gallery/2_photo-with-text.html"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/05/demo-2a.gif" alt="photo with text" /></a></p>
<h3><em>#2b.</em> Popup Text <small>(see <a href="http://www.webdesignerwall.com/demo/decorative-gallery/2b_popup-title.html">demo</a>)</small></h3>
<p class="image"><a href="http://www.webdesignerwall.com/demo/decorative-gallery/2b_popup-title.html"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/05/demo-2b.gif" alt="popup text" /></a></p>
<h3><em>#3.</em> Mini Paper Clip <small>(see <a href="http://www.webdesignerwall.com/demo/decorative-gallery/3_mini-paper-clip.html">demo</a>)</small></h3>
<p class="image"><a href="http://www.webdesignerwall.com/demo/decorative-gallery/3_mini-paper-clip.html"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/05/demo3.gif" alt="Mini paper clip demo" /></a></p>
<h3><em>#4.</em> Cork Board Gallery <small>(see <a href="http://www.webdesignerwall.com/demo/decorative-gallery/4_cork-board.html">demo</a>, <a href="http://www.webdesignerwall.com/demo/decorative-gallery/4_cork-board-ie6.html">IE6 version</a>)</small></h3>
<p class="image"><a href="http://www.webdesignerwall.com/demo/decorative-gallery/4_cork-board.html"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/05/demo-4.gif" alt="cork board gallery" /></a></p>
<h4>sIFR Version (Flash Text Replacement) <small>(see <a href="http://www.webdesignerwall.com/demo/decorative-gallery/4_cork-board-sifr.html">sIFR demo</a>)</small></h4>
<p>This example uses <a href="http://novemberborn.net/sifr3" target="_top">sIFR</a> to replace the <code>em</code> text with a handwritten font (notes: in this demo, the <code>span</code> tag is appended by jQuery)</p>
<p class="image"><a href="http://www.webdesignerwall.com/demo/decorative-gallery/4_cork-board-sifr.html"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/05/demo-4-sifr.gif" alt="sIFR demo" /></a></p>
<h3><em>#4b.</em> Cork Board With Masking Tape <small>(see <a href="http://www.webdesignerwall.com/demo/decorative-gallery/4b_cork-masking-tape.html">demo</a>, <a href="http://www.webdesignerwall.com/demo/decorative-gallery/4b_cork-masking-tape-ie6.html">IE6 version</a>)</small></h3>
<p class="image"><a href="http://www.webdesignerwall.com/demo/decorative-gallery/4b_cork-masking-tape.html"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/05/demo-4b.gif" alt="Demo 2b" /></a></p>
<h3><em>#5.</em> Art Gallery &#8211; Black  Frame <small>(see <a href="http://www.webdesignerwall.com/demo/decorative-gallery/5_gallery-black-frame.html">demo</a>)</small></h3>
<p class="image"><a href="http://www.webdesignerwall.com/demo/decorative-gallery/5_gallery-black-frame.html"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/05/demo-5.gif" alt="black picture frame" /></a></p>
<h3><em>#5b.</em> Art Gallery &#8211; Gold Frame <small>(see <a href="http://www.webdesignerwall.com/demo/decorative-gallery/5b_gallery-gold-frame.html">demo</a>)</small></h3>
<p class="image"><a href="http://www.webdesignerwall.com/demo/decorative-gallery/5b_gallery-gold-frame.html"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/05/demo-5b.gif" alt="gold art frame" /></a></p>
<h3><em>#6.</em> Grungy Watercolor <small>(see <a href="http://www.webdesignerwall.com/demo/decorative-gallery/6_watercolor.html">demo</a>)</small></h3>
<p class="image"><a href="http://www.webdesignerwall.com/demo/decorative-gallery/6_watercolor.html"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/05/demo-6.gif" alt="grungy watercolor" /></a></p>
<h4>sIFR Version <small>(see <a href="http://www.webdesignerwall.com/demo/decorative-gallery/6_watercolor-sifr.html">sIFR demo</a>)</small></h4>
<p class="image"><a href="http://www.webdesignerwall.com/demo/decorative-gallery/6_watercolor-sifr.html"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/05/demo-6-sifr.gif" alt="sIFR demo" /></a></p>
<h3><em>#7.</em> Glossy Style <small>(see <a href="http://www.webdesignerwall.com/demo/decorative-gallery/7_glossy.html">demo</a>)</small></h3>
<p class="image"><a href="http://www.webdesignerwall.com/demo/decorative-gallery/7_glossy.html"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/05/demo-7.gif" alt="glossy style" /></a></p>
<h3><em>#8</em><em>.</em> Wood Panel Gallery <small>(see <a href="http://www.webdesignerwall.com/demo/decorative-gallery/8_wood-panel.html">demo</a>)</small></h3>
<p>Finally, this example demonstrates how you can apply the background image to all elements to create a wood panel gallery: <code>ul</code>, <code>li</code>, and <code>em</code>.</p>
<p class="image"><a href="http://www.webdesignerwall.com/demo/decorative-gallery/8_wood-panel.html"><img src="http://www.webdesignerwall.com/wp-content/uploads/2008/05/demo-8.gif" alt="wood panel" /></a></p>
<h3>Final Remarks</h3>
<p>As you can see, this CSS trick is very flexible. So, be creative! Feel free to incorporate the graphic images and CSS styles in this tutorial to create your own.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kash-if.com/css-decorative-gallery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Advanced CSS Menu</title>
		<link>http://www.kash-if.com/advanced-css-menu/</link>
		<comments>http://www.kash-if.com/advanced-css-menu/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 04:09:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.kash-if.com/?p=14</guid>
		<description><![CDATA[This tutorial I will show you how to slice up the menu design (step by step) and put them together with CSS. Most of you probably know how to code a horizontal or vertical CSS list menu. Now let’s take it to the next level — code an advanced (un-typical) list menu utilizing the CSS [...]]]></description>
			<content:encoded><![CDATA[<p class="intro">This tutorial I will show you how to slice up the menu design (step by step) and put them together with CSS. Most of you probably know how to code a horizontal or vertical CSS list menu. Now let’s take it to the next level — code an advanced (un-typical) list menu utilizing the CSS <code>position</code> property.<br />
<span id="more-14"></span></p>
<ul>
<li><a class="thickbox" title="View demo" href="http://www.webdesignerwall.com/demo/advanced-css-menu/?TB_iframe=true&amp;height=270&amp;width=810">View Demo <span>CSS menu</span></a></li>
<li><a title="Download source files" href="http://www.webdesignerwall.com/file/advanced-css-menu.zip">Download <span> Demo ZIP</span></a></li>
</ul>
<h3>Overview</h3>
<p>Here are the required graphics to assembe the menu (you can download from the zip).</p>
<p class="image"><img src="http://www.webdesignerwall.com/wp-content/uploads/2007/10/css-menu1.jpg" alt="required graphics" /></p>
<h3><em>1.</em> Main background</h3>
<p>Open the Photoshop file. Turn off the menu text Layer Group and save the main background as menu-bg.jpg.</p>
<p class="image"><img src="http://www.webdesignerwall.com/wp-content/uploads/2007/10/css-menu2.jpg" alt="screen 2" /></p>
<h3><em>2.</em> Button graphics</h3>
<p>Turn off the background Layer Group and leave only the menu text layers visible. Make a rectangle selection cover the &#8220;home&#8221; item, go to menu Edit &gt; Copy Merged (Cmd + Shift + C).</p>
<p class="image"><img src="http://www.webdesignerwall.com/wp-content/uploads/2007/10/css-menu3.jpg" alt="screen 3" /></p>
<p>Create a new file and take note of the file dimension (w x h), in my case the &#8220;home&#8221; graphic is 144 x 58px. Paste the &#8220;home&#8221; graphic in the new file. Go to menu Image &gt; Canvas Size, adjust the image height x 2 (58 + 58 = 116px). Duplicate the home graphic layer and align it to the bottom. Erase the highlight strokes in the upper layer.</p>
<p class="image"><img src="http://www.webdesignerwall.com/wp-content/uploads/2007/10/css-menu4.jpg" alt="screen 4" /></p>
<p>Here is how the hover effect will work. We will set the link button to 144 x 58px, when mouseover, we will shift the background image from top to bottom.</p>
<p class="image"><img src="http://www.webdesignerwall.com/wp-content/uploads/2007/10/css-menu5.gif" alt="screen 5" /></p>
<p>Repeat this step for the other buttons. You should have the follow graphics:</p>
<p class="image"><img src="http://www.webdesignerwall.com/wp-content/uploads/2007/10/css-menu1.jpg" alt="required graphics" /></p>
<h3><em>3.</em> HTML source</h3>
<p>When you are done with the graphics, let’s start coding. Start with an un-ordered list <code>&lt;ul&gt;</code>.</p>
<ul>
<li>note there is an id=&#8221;menu&#8221; assigned to the<code>&lt;ul&gt;</code> tag</li>
<li>an unique class name assigned to each link <code>&lt;a&gt;</code></li>
<li>an empty <code>&lt;span&gt;</code> tag (the purpose of this is to make the mouseover effect)</li>
</ul>
<pre><code class="html"><span class="tag">
&lt;<span class="keyword">ul</span><span class="attribute"> id=<span class="value">"menu"</span></span>&gt;</span>
  <span class="tag">&lt;<span class="keyword">li</span>&gt;</span><span class="tag">&lt;<span class="keyword">a</span><span class="attribute"> href=<span class="value">"#"</span></span><span class="attribute"> class=<span class="value">"home"</span></span>&gt;</span>Home <span class="tag">&lt;<span class="keyword">span</span>&gt;</span><span class="tag">&lt;/<span class="keyword">span</span>&gt;</span><span class="tag">&lt;/<span class="keyword">a</span>&gt;</span><span class="tag">&lt;/<span class="keyword">li</span>&gt;</span>
  <span class="tag">&lt;<span class="keyword">li</span>&gt;</span><span class="tag">&lt;<span class="keyword">a</span><span class="attribute"> href=<span class="value">"#"</span></span><span class="attribute"> class=<span class="value">"about"</span></span>&gt;</span>About <span class="tag">&lt;<span class="keyword">span</span>&gt;</span><span class="tag">&lt;/<span class="keyword">span</span>&gt;</span><span class="tag">&lt;/<span class="keyword">a</span>&gt;</span><span class="tag">&lt;/<span class="keyword">li</span>&gt;</span>
  <span class="tag">&lt;<span class="keyword">li</span>&gt;</span><span class="tag">&lt;<span class="keyword">a</span><span class="attribute"> href=<span class="value">"#"</span></span><span class="attribute"> class=<span class="value">"rss"</span></span>&gt;</span>RSS <span class="tag">&lt;<span class="keyword">span</span>&gt;</span><span class="tag">&lt;/<span class="keyword">span</span>&gt;</span><span class="tag">&lt;/<span class="keyword">a</span>&gt;</span><span class="tag">&lt;/<span class="keyword">li</span>&gt;</span>
<span class="tag">&lt;/<span class="keyword">ul</span>&gt;

</span></code></pre>
<h3>#menu</h3>
<p>Reset the menu to no padding, no margin, and no list-style. Specify the width and height same dimension as the menu-bg.jpg. Then attach the menu background image. The key point to remember here is set the <code>position</code> property to <code>relative</code>.</p>
<pre><code class="css"><span class="id">#menu</span> <span class="rules">{
  <span class="keyword">list-style</span>:<span class="value"> none</span>;
  <span class="keyword">padding</span>:<span class="value"> 0</span>;
  <span class="keyword">margin</span>:<span class="value"> 0</span>;
  <span class="keyword">width</span>:<span class="value"> 774px</span>;
  <span class="keyword">height</span>:<span class="value"> 210px</span>;
  <span class="keyword">background</span>:<span class="value"> url(images/menu-bg.jpg) no-repeat</span>;
  <span class="keyword">position</span>:<span class="value"> relative</span>;
}

</span></code></pre>
<h3>#menu span</h3>
<p>Specify the <code>span</code> element  to <code>display:none</code> (so they will be invisible by default). Specify <code>position:absolute</code>, so we can place the mouseover GIF image on exact position.</p>
<pre><code class="css"><span class="id">#menu</span> <span class="keyword">span</span> <span class="rules">{
  <span class="keyword">display</span>:<span class="value"> none</span>;
  <span class="keyword">position</span>:<span class="value"> absolute</span>;
}

</span></code></pre>
<h3>#menu a</h3>
<p>The key point here is the <code>text-indent</code> property. We specify the <code>text-indent</code> property with a negative value (-900%), so the text will be hidden.</p>
<pre><code class="css"><span class="id">#menu</span> <span class="keyword">a</span> <span class="rules">{
  <span class="keyword">display</span>:<span class="value"> block</span>;
  <span class="keyword">text-indent</span>:<span class="value"> -900%</span>;
  <span class="keyword">position</span>:<span class="value"> absolute</span>;
  <span class="keyword">outline</span>:<span class="value"> none</span>;
}

</span></code></pre>
<h3>#menu a:hover</h3>
<p>When mouseover the link, we want to shift the background image from top to bottom.</p>
<pre><code class="css"><span class="id">#menu</span> <span class="keyword">a</span>:hover <span class="rules">{
  <span class="keyword">background-position</span>:<span class="value"> left bottom</span>;
}

</span></code></pre>
<h3>#menu a:hover span</h3>
<p>When mouseover the link, we want the <code>span</code> element to <code>display:block</code>.</p>
<pre><code class="css"><span class="id">#menu</span> <span class="keyword">a</span>:hover <span class="keyword">span</span> <span class="rules">{
  <span class="keyword">display</span>:<span class="value"> block</span>;
}

</span></code></pre>
<h3>#menu .home</h3>
<p>Specify the width, height, and background image. Since we already specified all <code>&lt;a&gt;</code> element <code>postition:absolute</code> in previous step, now just say where the .home button should be by specifying the left and top property.</p>
<pre><code class="css"><span class="id">#menu</span> <span class="class">.home</span> <span class="rules">{
  <span class="keyword">width</span>:<span class="value"> 144px</span>;
  <span class="keyword">height</span>:<span class="value"> 58px</span>;
  <span class="keyword">background</span>:<span class="value"> url(images/home.gif) no-repeat</span>;
  <span class="keyword">left</span>:<span class="value"> 96px</span>;
  <span class="keyword">top</span>:<span class="value"> 73px</span>;
}</span>
</code></pre>
<h3>#menu .home span</h3>
<p>Here we are specifying the width, height, background, and position of the <code>span</code> element of .home (mouseover GIF image)</p>
<pre><code class="css"><span class="id">#menu</span> <span class="class">.home</span> <span class="keyword">span</span> <span class="rules">{
  <span class="keyword">width</span>:<span class="value"> 86px</span>;
  <span class="keyword">height</span>:<span class="value"> 14px</span>;
  <span class="keyword">background</span>:<span class="value"> url(images/home-over.gif) no-repeat</span>;
  <span class="keyword">left</span>:<span class="value"> 28px</span>;
  <span class="keyword">top</span>:<span class="value"> -20px</span>;
}

</span></code></pre>
<h3>#menu .about</h3>
<p>Copy the .home rules and rename them to .about. Now just change the width, height, background, left, and top property.</p>
<pre><code class="css"><span class="id">#menu</span> <span class="class">.about</span> <span class="rules">{
  <span class="keyword">width</span>:<span class="value"> 131px</span>;
  <span class="keyword">height</span>:<span class="value"> 51px</span>;
  <span class="keyword">background</span>:<span class="value"> url(images/about.gif) no-repeat</span>;
  <span class="keyword">left</span>:<span class="value"> 338px</span>;
  <span class="keyword">top</span>:<span class="value"> 97px</span>;
}</span>
<span class="id">#menu</span> <span class="class">.about</span> <span class="keyword">span</span> <span class="rules">{
  <span class="keyword">width</span>:<span class="value"> 40px</span>;
  <span class="keyword">height</span>:<span class="value"> 12px</span>;
  <span class="keyword">background</span>:<span class="value"> url(images/about-over.gif) no-repeat</span>;
  <span class="keyword">left</span>:<span class="value"> 44px</span>;
  <span class="keyword">top</span>:<span class="value"> 54px</span>;
}

</span></code></pre>
<h3>#menu .rss</h3>
<p>Repeat this step for .rss</p>
<pre><code class="css"><span class="id">#menu</span> <span class="class">.rss</span> <span class="rules">{
  <span class="keyword">width</span>:<span class="value"> 112px</span>;
  <span class="keyword">height</span>:<span class="value"> 47px</span>;
  <span class="keyword">background</span>:<span class="value"> url(images/rss.gif) no-repeat</span>;
  <span class="keyword">left</span>:<span class="value"> 588px</span>;
  <span class="keyword">top</span>:<span class="value"> 94px</span>;
}</span>
<span class="id">#menu</span> <span class="class">.rss</span> <span class="keyword">span</span> <span class="rules">{
  <span class="keyword">width</span>:<span class="value"> 92px</span>;
  <span class="keyword">height</span>:<span class="value"> 20px</span>;
  <span class="keyword">background</span>:<span class="value"> url(images/rss-over.gif) no-repeat</span>;
  <span class="keyword">left</span>:<span class="value"> 26px</span>;
  <span class="keyword">top</span>:<span class="value"> -20px</span>;
}

</span></code></pre>
<h3>All in one:</h3>
<pre><code class="css"><span class="id">#menu</span> <span class="rules">{
  <span class="keyword">list-style</span>:<span class="value"> none</span>;
  <span class="keyword">padding</span>:<span class="value"> 0</span>;
  <span class="keyword">margin</span>:<span class="value"> 0</span>;
  <span class="keyword">width</span>:<span class="value"> 774px</span>;
  <span class="keyword">height</span>:<span class="value"> 210px</span>;
  <span class="keyword">background</span>:<span class="value"> url(images/menu-bg.jpg) no-repeat</span>;
  <span class="keyword">position</span>:<span class="value"> relative</span>;
}</span>
<span class="id">#menu</span> <span class="keyword">span</span> <span class="rules">{
  <span class="keyword">display</span>:<span class="value"> none</span>;
  <span class="keyword">position</span>:<span class="value"> absolute</span>;
}</span>
<span class="id">#menu</span> <span class="keyword">a</span> <span class="rules">{
  <span class="keyword">display</span>:<span class="value"> block</span>;
  <span class="keyword">text-indent</span>:<span class="value"> -900%</span>;
  <span class="keyword">position</span>:<span class="value"> absolute</span>;
  <span class="keyword">outline</span>:<span class="value"> none</span>;
}</span>
<span class="id">#menu</span> <span class="keyword">a</span>:hover <span class="rules">{
  <span class="keyword">background-position</span>:<span class="value"> left bottom</span>;
}</span>
<span class="id">#menu</span> <span class="keyword">a</span>:hover <span class="keyword">span</span> <span class="rules">{
  <span class="keyword">display</span>:<span class="value"> block</span>;
}</span>

<span class="id">#menu</span> <span class="class">.home</span> <span class="rules">{
  <span class="keyword">width</span>:<span class="value"> 144px</span>;
  <span class="keyword">height</span>:<span class="value"> 58px</span>;
  <span class="keyword">background</span>:<span class="value"> url(images/home.gif) no-repeat</span>;
  <span class="keyword">left</span>:<span class="value"> 96px</span>;
  <span class="keyword">top</span>:<span class="value"> 73px</span>;
}</span>
<span class="id">#menu</span> <span class="class">.home</span> <span class="keyword">span</span> <span class="rules">{
  <span class="keyword">width</span>:<span class="value"> 86px</span>;
  <span class="keyword">height</span>:<span class="value"> 14px</span>;
  <span class="keyword">background</span>:<span class="value"> url(images/home-over.gif) no-repeat</span>;
  <span class="keyword">left</span>:<span class="value"> 28px</span>;
  <span class="keyword">top</span>:<span class="value"> -20px</span>;
}</span>

<span class="id">#menu</span> <span class="class">.about</span> <span class="rules">{
  <span class="keyword">width</span>:<span class="value"> 131px</span>;
  <span class="keyword">height</span>:<span class="value"> 51px</span>;
  <span class="keyword">background</span>:<span class="value"> url(images/about.gif) no-repeat</span>;
  <span class="keyword">left</span>:<span class="value"> 338px</span>;
  <span class="keyword">top</span>:<span class="value"> 97px</span>;
}</span>
<span class="id">#menu</span> <span class="class">.about</span> <span class="keyword">span</span> <span class="rules">{
  <span class="keyword">width</span>:<span class="value"> 40px</span>;
  <span class="keyword">height</span>:<span class="value"> 12px</span>;
  <span class="keyword">background</span>:<span class="value"> url(images/about-over.gif) no-repeat</span>;
  <span class="keyword">left</span>:<span class="value"> 44px</span>;
  <span class="keyword">top</span>:<span class="value"> 54px</span>;
}</span>

<span class="id">#menu</span> <span class="class">.rss</span> <span class="rules">{
  <span class="keyword">width</span>:<span class="value"> 112px</span>;
  <span class="keyword">height</span>:<span class="value"> 47px</span>;
  <span class="keyword">background</span>:<span class="value"> url(images/rss.gif) no-repeat</span>;
  <span class="keyword">left</span>:<span class="value"> 588px</span>;
  <span class="keyword">top</span>:<span class="value"> 94px</span>;
}</span>
<span class="id">#menu</span> <span class="class">.rss</span> <span class="keyword">span</span> <span class="rules">{
  <span class="keyword">width</span>:<span class="value"> 92px</span>;
  <span class="keyword">height</span>:<span class="value"> 20px</span>;
  <span class="keyword">background</span>:<span class="value"> url(images/rss-over.gif) no-repeat</span>;
  <span class="keyword">left</span>:<span class="value"> 26px</span>;
  <span class="keyword">top</span>:<span class="value"> -20px</span>;
}

</span></code></pre>
<h3>Done</h3>
<p>That’s it. You can preview my <a href="http://www.webdesignerwall.com/demo/advanced-css-menu/">CSS menu</a>.</p>
<p><em>Note: there is an IE6 bug where the &lt;span&gt; hover effect doesn’t display properly. To fix that, you can use Javascript to specify the &lt;span&gt; to display block on mouseover.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kash-if.com/advanced-css-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS: The All-Expandable Box</title>
		<link>http://www.kash-if.com/css-the-all-expandable-box/</link>
		<comments>http://www.kash-if.com/css-the-all-expandable-box/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 04:04:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.kash-if.com/?p=13</guid>
		<description><![CDATA[In HTML, if you don’t specify a specific width, block-level elements are vertically expandable by their nature. Think of an unordered list. That list will grow be be as big as it needs to be to fit all of it’s list elements. If a user increases the font size in their browser, the list will [...]]]></description>
			<content:encoded><![CDATA[<p class="intro">In HTML, if you don’t specify a specific width, block-level elements are vertically expandable by their nature. Think of an unordered list. That list will grow be be as big as it needs to be to fit all of it’s list elements. If a user increases the font size in their browser, the list will expand vertically, growing to fit the larger content. Sometimes it feels like vertical-only expansion is limiting and it would be nice if the element could grow horizontally as well as vertically with a font size increase by the user.<br />
<span id="more-13"></span></p>
<ul>
<li><a title="View demo" href="http://www.webdesignerwall.com/demo/expandable-box/">View Demo <span>Expandable Box</span></a></li>
<li><a title="Download source files" href="http://www.webdesignerwall.com/file/expandable-box-demo.zip">Download <span> Demo ZIP</span></a></li>
</ul>
<h3>Abstract</h3>
<p>If you have been using  the Firefox 3 beta much, you might notice that it handles this automatically. Increasing the size in Firefox 3 doesn’t just increase the font size, it increases <strong>everything</strong> in size, which actually feel really natural and nice. But despite it’s growing market share, we can’t count on Firefox for the resizing needs of our users.</p>
<p>I am going to attempt to explain how to make an All-Expandable box, with the following features:</p>
<ul>
<li>Works in all major browsers</li>
<li>Expands both vertically and horizontally</li>
<li>Uses a single background image</li>
</ul>
<p><img src="http://www.webdesignerwall.com/wp-content/uploads/2007/12/example-animation.gif" alt="Demo animation" /></p>
<p>This is a bit of a tall order, especially the use of the background image. This will end up using kind of a combination of the <a href="http://css-tricks.com/css-sprites-what-they-are-why-theyre-cool-and-how-to-use-them/" target="_top">CSS sprites technique</a> since different areas of the image will be used in different places and the <a href="http://www.alistapart.com/articles/slidingdoors/" target="_top">Sliding Doors technique</a>, since different amounts of those images will be visible depending on the current size.</p>
<h3>Make the box horizontally expandable</h3>
<p>There is one way simple way to make a box horizontally expandable: <strong>specify your width in em’s</strong>. For example:</p>
<pre><code class="css"><span class="class">.box</span> <span class="rules">{
  <span class="keyword">width</span>:<span class="value"> 35em</span>;
  <span class="keyword">margin</span>:<span class="value"> 50px auto</span>;
}
</span></code></pre>
<p>The margin is there for example purposes, to keep it centered and away from the top edge of the browser window.</p>
<h3>Thinking about image placement</h3>
<p>In this example, the box has rounded corners, a bit of a drop shadow, and a bit of an inner shadow. This means that all of the four corners of the box are distinctly different. This is uniquely challenging since images are not expandable. We will need a way to apply the four different corner images to the four corners of the box separately.</p>
<p>Also, we will need to overlap them in such a way that the transitions are seamless. And also, we are trying to do this with only a single background image, to make it as efficient as possible.</p>
<p>Below is an image of how you might think of what we need to do. The boxes would be overlapping, I nudged them apart so you can see the whole boxes.</p>
<p class="image"><img src="http://www.webdesignerwall.com/wp-content/uploads/2007/12/positioning-example.png" alt="Position example" /></p>
<p>When creating the background image, think big. The bigger your background image, the larger you will be able to expand without borking the layout. The example background is 700px wide which gets you about 4 or 5 different text sizings it works at, but it does eventually break apart above that.</p>
<h3>Coding the box</h3>
<p>Of course we always like to be as semantic as possible with our XTHML. That means not using extra markup for things that aren’t really content but are purely design. Unfortunately, with all this craziness of needing four boxes for our single box, it ain’t gonna happen.</p>
<p>This is how it’s done:</p>
<pre><code class="html"><span class="tag">&lt;<span class="keyword">div</span><span class="attribute"> class=<span class="value">"box"</span></span>&gt;</span>
  <span class="tag">&lt;<span class="keyword">div</span><span class="attribute"> class=<span class="value">"topleft"</span></span>&gt;</span>
  <span class="tag">&lt;<span class="keyword">div</span><span class="attribute"> class=<span class="value">"topright"</span></span>&gt;</span>
    <span class="tag">&lt;<span class="keyword">div</span>&gt;</span>
       CONTENT GOES HERE
    <span class="tag">&lt;/<span class="keyword">div</span>&gt;</span>
  <span class="tag">&lt;/<span class="keyword">div</span>&gt;</span>
  <span class="tag">&lt;/<span class="keyword">div</span>&gt;</span>

  <span class="tag">&lt;<span class="keyword">div</span><span class="attribute"> class=<span class="value">"bottomleft"</span></span>&gt;</span>
  <span class="tag">&lt;<span class="keyword">div</span><span class="attribute"> class=<span class="value">"bottomright"</span></span>&gt;</span>
  <span class="tag">&lt;/<span class="keyword">div</span>&gt;</span>
  <span class="tag">&lt;/<span class="keyword">div</span>&gt;</span>
<span class="tag">&lt;/<span class="keyword">div</span>&gt;

</span></code></pre>
<h3>Styling the box</h3>
<p>Here is the CSS for the four areas within the box:</p>
<pre><code class="css"><span class="class">.box</span> <span class="keyword">div</span><span class="class">.topleft</span> <span class="rules">{
	<span class="keyword">display</span>:<span class="value"> block</span>;
	<span class="keyword">background</span>:<span class="value"> url("images/box-bg.png") top left no-repeat white</span>;
	<span class="keyword">padding</span>:<span class="value"> 2.0em 0em 0em 2.0em</span>;
}</span>

<span class="class">.box</span> <span class="keyword">div</span><span class="class">.topright</span> <span class="rules">{
	<span class="keyword">display</span>:<span class="value"> block</span>;
	<span class="keyword">background</span>:<span class="value"> url("images/box-bg.png") top right no-repeat white</span>;
	<span class="keyword">padding</span>:<span class="value"> 2.0em</span>;
	<span class="keyword">margin</span>:<span class="value"> -2.0em 0 0 2.0em</span>;
}</span>

<span class="class">.box</span> <span class="keyword">div</span><span class="class">.bottomleft</span> <span class="rules">{
	<span class="keyword">display</span>:<span class="value"> block</span>;
	<span class="keyword">height</span>:<span class="value"> 45px</span>;
	<span class="keyword">margin-top</span>:<span class="value"> -2.0em</span>;
	<span class="keyword">background</span>:<span class="value"> url("images/box-bg.png") bottom left no-repeat white</span>;
}</span>

<span class="class">.box</span> <span class="keyword">div</span><span class="class">.bottomright</span> <span class="rules">{
	<span class="keyword">display</span>:<span class="value"> block</span>;
	<span class="keyword">background</span>:<span class="value"> url("images/box-bg.png") bottom right no-repeat white</span>;
	<span class="keyword">height</span>:<span class="value"> 45px</span>;
	<span class="keyword">margin-left</span>:<span class="value"> 3.0em</span>;
}</span>

</code></pre>
<p>Note the negative margins are necessary to pull back from the padding applied from the parent spans. It just works out good that way with the padding, keeping text inside the box. Also note the height of the bottom spans are set in pixels. That is on purpose as they need to be kept short and not be expandable.</p>
<p>This has been tested in Firefox, Safari, Opera, and IE 6 and is working in all of them, so I’m fairly satisfed it’s a solid technique.</p>
<h3>Credits</h3>
<p>This tutorial is contributed by Chris Coyier. Visit <a href="http://css-tricks.com/" target="_top">CSS-Tricks</a> to learn more CSS tricks from Chris.</p>
<h3><em>Update:</em></h3>
<p>The code in this example was updated to fix the div within a span issue and now validates.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kash-if.com/css-the-all-expandable-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
