<?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>WebMuch &#187; PNG Fix</title>
	<atom:link href="http://webmuch.com/tag/png-fix/feed/" rel="self" type="application/rss+xml" />
	<link>http://webmuch.com</link>
	<description>Everything about the web</description>
	<lastBuildDate>Tue, 16 Feb 2010 10:05:17 +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>Lightbox Effect Maintenance Page</title>
		<link>http://webmuch.com/lightbox-effect-maintenance-page/</link>
		<comments>http://webmuch.com/lightbox-effect-maintenance-page/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 20:50:50 +0000</pubDate>
		<dc:creator>Aayush</dc:creator>
				<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[PNG Fix]]></category>

		<guid isPermaLink="false">http://webmuch.com/?p=50</guid>
		<description><![CDATA[<img src="http://webmuch.com/wp-content/uploads/2009/04/post-intro.png" alt="Lightbox Effect Maintenance Page Photo" title="Lightbox Effect Maintenance Page Photo" width="150" height="150" class="alignnone size-full wp-image-51" />Well the Website Build-Up series was getting a little same-ish so I thought I’d share this cool little technique for telling the user that a page is currently not in use. By the way, this technique would make a great 404 page.]]></description>
			<content:encoded><![CDATA[<h3>Preview:</h3>
<p><img class="alignnone size-full wp-image-52" title="Lightbox Effect Maintenance Page Preview" src="http://webmuch.com/wp-content/uploads/2009/04/preview1.jpg" alt="Lightbox Effect Maintenance Page Preview" width="585" height="585" /><br />
OK! Before starting let me warn you that this technique is totally based on HTML &amp; CSS, so make sure you take care of all this on the server end as-well, which basically means that if the page in the background has a form, then it shouldn’t be active &amp; things like that. So moving on: I have taken an old template I was working on to show the Lightbox overlay effect on it. It is shown below; you can take anything you like instead.<br />
<img class="alignnone size-full wp-image-53" title="Background Template Preview" src="http://webmuch.com/wp-content/uploads/2009/04/back-preview.png" alt="Background Template Preview" width="585" height="655" /><br />
We obviously wouldn’t be making this template here.</p>
<h3>What We Need:</h3>
<ul>
<li>Make a 1px * 1px image in Photoshop and fill a new layer with black and reduce it&#8217;s opacity by 50% then hide the background layer and save the transparent image as a 24bit PNG in the images directory name it overlay.png</li>
<li>Make another image around 400px wide and make something you want to display on a page under maintenance and save it in the images directory name it maintain.png</li>
</ul>
<p>Moving on: Once you have the page to be in the background open it in a text editor of your choice; As the body tag opens, place this code(even before the container).</p>
<pre class="code">&lt;img src="./images/maintain.png" id="maintain" alt=”Under Maintenance” /&gt;
&lt;div id="overlay"&gt;&amp;nbsp;&lt;/div&gt;</pre>
<p>It is the hierarchy we need to understand here. We want to display a dark transparent overlay on the whole page therefore we place the division with an id of overlay on the top and then we want to display a maintenance image on top of it and so we place the img tag with that image even on top of the overlay division.</p>
<p>Now make a new stylesheet in your CSS directory, call it technique.css, include it on the page and then place this code in it. (You can place this code in your master stylesheet as well).</p>
<pre class="code">#overlay{
width:100%;
height:1100px; /*about the height of the background page*/
background:url('../images/overlay.png') repeat; /*to include &amp; repeat the image on the whole page*/
position:absolute; /*to place it anywhere on the page*/
top:0;/*start from  the top*/
left:0;/*and start from  the left*/
z-index:90; /*tells the browser that it should be displayed above the items with a “z-index” value less than 90*/
}
#maintain{
position:absolute;
left:50%; /*so the image starts after half of the page from the left */
top:50%; /*so the image starts after half of the page from the top */
margin: -140px 0 0 -200px; /*we bring up the image by half it’s height and bring it left by half it’s width*/
/*now the image should be in the center of the page.*/
z-index:100; /*tells the browser that it should be displayed above the items with a “z-index” value less than 100*/
}</pre>
<h3>IE6:</h3>
<p>To make the transparent background image render transparent in IE6, download the <a href="http://www.dillerdesign.com/experiment/DD_belatedPNG/#usage">DD_belatedPNG</a> JavaScript. Place the .js file in the js directory of the page and if the IE browser version is less than 7 then include it in our page right before ending the body tag, then open another script tag and run the fix method, pass in the ID of the overlay division in it. To know more about the DD_belatedPNG read it’s <a href="http://www.dillerdesign.com/experiment/DD_belatedPNG">documentation</a>.</p>
<pre class="code">
&lt;!--[if IE 6]>
&lt;script src="./js/DD_belatedPNG_0.0.7a-min.js">&lt;/script>
&lt;script>
  DD_belatedPNG.fix('#overlay');
&lt;/script>
&lt;![endif]-->
</pre>
<p>I’ll be continuing with the Build-Up Series in the next post.</p>
<p>Thanks for reading!</p>
<p><a href="http://webmuch.com/source_files/overlay.zip"><strong>Download the Source Code!</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://webmuch.com/lightbox-effect-maintenance-page/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
