<?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>Search-This &#187; Browsers</title>
	<atom:link href="http://www.search-this.com/category/browsers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.search-this.com</link>
	<description>Internet Marketing, Website Promotion and Blogging Advice</description>
	<lastBuildDate>Fri, 30 Apr 2010 18:22:45 +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>Firefox 3 Opens Tomorrow</title>
		<link>http://www.search-this.com/2008/06/16/firefox-3-opens-tomorrow/</link>
		<comments>http://www.search-this.com/2008/06/16/firefox-3-opens-tomorrow/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 23:22:26 +0000</pubDate>
		<dc:creator>Golgotha</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Firefox 3]]></category>

		<guid isPermaLink="false">http://www.search-this.com/?p=695</guid>
		<description><![CDATA[&#8220;Just more than 10 years ago, Mozilla threw its open-source code into the public domain. Today, its browser &#8212; Firefox &#8212; is preparing to launch its third major release in hopes of continuing to eat away at Microsoft&#8217;s Internet Explorer. Firefox already has more than 18 percent of the global market, according to Net Applications. [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;Just more than 10 years ago, Mozilla threw its open-source code into the public domain. Today, its browser &#8212; Firefox &#8212; is preparing to launch its third major release in hopes of continuing to eat away at Microsoft&#8217;s Internet Explorer.</p>
<p>Firefox already has more than 18 percent of the global market, according to Net Applications. With the release of Firefox 3, Mozilla could see a boost in downloads and market share. Microsoft&#8217;s next version of Internet Explorer won&#8217;t come to market until later this year.</p>
<p>Tomorrow, Mozilla will release Firefox 3. After more than 34 months of active development and the contributions of thousands of people, Firefox 3 will be downloadable free from the Mozilla Web site. Mozilla is promising this is the best browser &#8212; period.&#8221;</p>
<p>[ more <a href="http://news.yahoo.com/s/nf/20080612/bs_nf/60269">here</a> and <a href="http://www.dria.org/wordpress/archives/2008/06/12/655/">here</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.search-this.com/2008/06/16/firefox-3-opens-tomorrow/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CSS &#8211; Bordering on The Ridiculous</title>
		<link>http://www.search-this.com/2008/06/04/css-bordering-on-the-ridiculous/</link>
		<comments>http://www.search-this.com/2008/06/04/css-bordering-on-the-ridiculous/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 16:07:45 +0000</pubDate>
		<dc:creator>Paul OB</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Website Tools]]></category>

		<guid isPermaLink="false">http://www.search-this.com/?p=670</guid>
		<description><![CDATA[I'd like to share a couple of simple tips for adding graphical borders or side shadows to your CSS layouts. This article is mainly aimed at beginners but there are some useful tips for everyone if you'll bear with the simpler stuff first. CSS Full Length Graphical Borders on Fluid Layout It's quite easy to [...]]]></description>
			<content:encoded><![CDATA[<p>I'd like to share a couple of simple tips for adding graphical borders or side shadows to your CSS layouts. This article is mainly aimed at beginners but there are some useful tips for everyone if you'll bear with the simpler stuff first.</p>
<p><strong>CSS Full Length Graphical Borders on Fluid Layout</strong></p>
<p>It's quite easy to use graphical side borders on <a href="http://www.pmob.co.uk/temp/transparent-test3.htm">fixed width elements</a> as you can simply repeat an appropriate sized image down the y-axis of the container and draw both edges at the same time. However, it is often not well understood how to achieve this effect with an element that has a fluid width especially in a 100% high environment. </p>
<p>We will first learn how to apply an image to both sides of a normal content height (but fluid width) container and then later on explore the possibilities of using this for a 100% (viewport high) container.</p>
<p><strong>Normal Height Layout</strong></p>
<p>Let's start with a <a href="http://www.pmob.co.uk/temp/image-border.htm"><strong>simple example</strong></a> that has graphical borders on both sides of a fluid layout.</p>
<p>The technique is to repeat the left border down the left side of the first wrapper and then repeat the right border down the right side of an inner wrapper. You must be careful not to overwrite the first image when you overlay the second image so any background colours would need to be on the first element and not the nested element.</p>
<p>CSS:</p>
<div class="igBar"><span id="lcss-11"><a href="#" onclick="javascript:showPlainTxt('css-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-11">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">p <span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">margin</span>:<span style="color: #cc66cc;color:#800000;">0</span>;padding-<span style="color: #000000; font-weight: bold;">bottom</span>:10px<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#outer<span style="color: #66cc66;">&#123;</span>border<span style="color: #3333ff;">:1px </span>solid #000;background: <span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span>images/left-edge.gif<span style="color: #66cc66;">&#41;</span> <span style="color: #993333;">repeat-y</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">top</span>;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #cc00cc;">#inner <span style="color: #66cc66;">&#123;</span></span>margin-<span style="color: #000000; font-weight: bold;">left</span>:20px;background: <span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span>images/right-edge.gif<span style="color: #66cc66;">&#41;</span> <span style="color: #993333;">repeat-y</span> <span style="color: #000000; font-weight: bold;">right</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#content<span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">margin-right</span>:20px;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/* mac hide - force layout in ie \*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">* html <span style="color: #cc00cc;">#outer <span style="color: #66cc66;">&#123;</span></span>height:<span style="color: #cc66cc;color:#800000;">1</span>%<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/* end hide */</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div class="igBar"><span id="lhtml-12"><a href="#" onclick="javascript:showPlainTxt('html-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-12">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"outer"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"inner"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"content"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>This is the content : this is the content : <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>This is the content : this is the content : <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The side image is 20px wide so the elements are nested allowing for a 20px gap using margins to keep the content away from the borders. We could have done the <a href="http://www.pmob.co.uk/temp/image-border2.htm"><strong>same thing with padding</strong></a> and saved ourselves an extra div.</p>
<div class="igBar"><span id="lcss-13"><a href="#" onclick="javascript:showPlainTxt('css-13'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-13">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">p <span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">margin</span>:<span style="color: #cc66cc;color:#800000;">0</span>;padding-<span style="color: #000000; font-weight: bold;">bottom</span>:10px<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#outer<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; border<span style="color: #3333ff;">:1px </span>solid #000;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>: <span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span>images/left-edge.gif<span style="color: #66cc66;">&#41;</span> <span style="color: #993333;">repeat-y</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">top</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; padding<span style="color: #3333ff;">:<span style="color: #cc66cc;color:#800000;">0</span> </span><span style="color: #cc66cc;color:#800000;">0</span> <span style="color: #cc66cc;color:#800000;">0</span> 20px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #cc00cc;">#inner <span style="color: #66cc66;">&#123;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; padding<span style="color: #3333ff;">:<span style="color: #cc66cc;color:#800000;">0</span> </span>20px <span style="color: #cc66cc;color:#800000;">0</span> <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>: <span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span>images/right-edge.gif<span style="color: #66cc66;">&#41;</span> <span style="color: #993333;">repeat-y</span> <span style="color: #000000; font-weight: bold;">right</span> <span style="color: #000000; font-weight: bold;">top</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/* mac hide - force layout in ie \*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">* html #outer,* html <span style="color: #cc00cc;">#inner <span style="color: #66cc66;">&#123;</span></span>height:<span style="color: #cc66cc;color:#800000;">1</span>%<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/* end hide */</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div class="igBar"><span id="lhtml-14"><a href="#" onclick="javascript:showPlainTxt('html-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-14">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"outer"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"inner"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>This is the content : this is the content : This is the content : this is the content : This is the content : this is the content : This is the content : this is the content : This is the content : this is the content : This is the content : this is the content : This is the content : this is</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; the content : This is the content : this is the content : This is the content : this is the content : This is the content : this is the content : This is the content : this is the content : <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>This is the content : this is the content : This is the content : this is the content : This is the content : this is the content : This is the content : this is the content : This is the content : this is the content : This is the content : this is the content : This is the content : this is</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; the content : This is the content : this is the content : This is the content : this is the content : This is the content : this is the content : This is the content : this is the content : <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>This is the content : this is the content : <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>This is the content : this is the content : <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The only thing to note in both the above snippets is the "haslayout" fix for IE. If you are not familiar with "haslayout" then I have a good explanation <a href="http://reference.sitepoint.com/css/haslayout"><strong>here</strong></a>.</p>
<p>Figure 1 shows the result of the above code.</p>
<p><strong>Figure 1</strong><br />
<a href='http://www.search-this.com/wp-content/uploads/2008/05/fb-fig1.jpg'><img src="http://www.search-this.com/wp-content/uploads/2008/05/fb-fig1.jpg" alt="" title="fb-fig1" width="256" height="333" size-full wp-image-671" /></a></p>
<p>If you have a little imagination you can improve the look -- here is <a href="http://www.pmob.co.uk/temp/ragged-sides2.htm">another example</a> as shown in Figure 2.</p>
<p>Figure 2<br />
<a href='http://www.search-this.com/wp-content/uploads/2008/05/fb-fig2.jpg'><img src="http://www.search-this.com/wp-content/uploads/2008/05/fb-fig2.jpg" alt="" title="fb-fig2" width="256" height="200" size-full wp-image-672" /></a></p>
<p>All that was needed was to change the image slightly and give the background a colour that merges in with the image.</p>
<div class="igBar"><span id="lcss-15"><a href="#" onclick="javascript:showPlainTxt('css-15'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-15">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.outer<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span>:<span style="color: #cc66cc;color:#800000;">50</span>%;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:#ffe6a5 <span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span>images/ragged-left2.gif<span style="color: #66cc66;">&#41;</span> <span style="color: #993333;">repeat-y</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">top</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The simple change above gives the layout a nice torn look down each side.</p>
<p><strong>100% Height Borders</strong></p>
<p>So far we have established that it is easy to place a repeating graphic on each side of a normal height layout, but what about 100% high layouts where the layout stretches from the top of the viewport to the bottom of the viewport?</p>
<p>This is more complicated because 100% height is a tricky subject at the best of times. In effect you can only ever have one 100% high element to play with and therefore with a fluid width element you can't tile both edges of the element in one go with a background image.</p>
<p><strong>100% Height Explained</strong></p>
<p>I suppose I should explain why you cannot have more than one 100% high element!</p>
<p>In order to achieve an initial 100% high container the html and body elements are first set to 100% height. This allows us to use the main-container on the page and to give it <em>min-height:100%</em>. We use min-height because we want a minimum of 100% height but we also want the height to expand should content exceed the viewport height. If we had used height:100% for the main container then the container would never expand past the viewport and content would just spill out. Therefore we use min-height:100% to get our initial 100% height.</p>
<p>However, because we must use min-height on the main container we cannot nest another element inside that container and use min-height again. </p>
<p><em>Why Not? </em></p>
<p>The reason is that a percentage height of an element must be based on the parent's height. If the parent is defined as height:auto (the default) then the child has no height to base its measurements on and the height collapses to auto (for both <strong>height</strong> and <em>min-height</em>) which is effectively content height. This is an impossible conundrum and the reason is that in most cases you can only ever work with one 100% high container and that must be the first container on the page.</p>
<p>I should point out that IE6 and under do not understand <em>min-height</em> but treat <em>height</em> as a minimum anyway so that is the reason you will see the IE hacks for this. In some cases IE6 will allow you to nest successive 100% high elements but other browsers will not so it's best avoided.</p>
<p>Now with the 100% height issue explained we can set about creating our 100% high borders. Let's start with the basic page.</p>
<div class="igBar"><span id="lcss-16"><a href="#" onclick="javascript:showPlainTxt('css-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-16">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">* <span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">margin</span>:<span style="color: #cc66cc;color:#800000;">0</span>;padding:<span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#125;</span><span style="color: #808080; font-style: italic;">/* for demo only use a proper reset in real life */</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">p,h1<span style="color: #66cc66;">&#123;</span>margin<span style="color: #3333ff;">:<span style="color: #cc66cc;color:#800000;">0</span> </span><span style="color: #cc66cc;color:#800000;">0</span> 1em <span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">html,body<span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">height</span>:<span style="color: #cc66cc;color:#800000;">100</span>%<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">body <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; font<span style="color: #3333ff;">:13px </span>arial,helvetica,<span style="color: #993333;">sans-serif</span>; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:#ccc;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span>:#000;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#wrapper<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">position</span>:<span style="color: #993333;">relative</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; margin<span style="color: #3333ff;">:<span style="color: #cc66cc;color:#800000;">0</span> </span><span style="color: #cc66cc;color:#800000;">6</span>%;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; min-<span style="color: #000000; font-weight: bold;">height</span>:<span style="color: #cc66cc;color:#800000;">100</span>%;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:#6b97c8;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span>:#fff;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; padding<span style="color: #3333ff;">:<span style="color: #cc66cc;color:#800000;">0</span> </span>50px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">* html #wrapper<span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">height</span>:<span style="color: #cc66cc;color:#800000;">100</span>%<span style="color: #66cc66;">&#125;</span><span style="color: #808080; font-style: italic;">/* for ie6 and under*/</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div class="igBar"><span id="lhtml-17"><a href="#" onclick="javascript:showPlainTxt('html-17'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-17">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"wrapper"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/h1.html"><span style="color: #000000; font-weight: bold;">&lt;h1&gt;</span></a></span>Full Length side border images<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h1&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>This is the content : <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Here is a <a href="http://www.pmob.co.uk/search-this/fb-ex1.htm"><strong>live page</strong></a> using the above code. Simple stuff so far with the 100% height routine as mentioned earlier. Now we need a method of painting both edges with our repeating graphics. We can't nest any inner elements because they will only be content height and will look bad.</p>
<p>Therefore we are going to use a technique I devised for <a href="http://www.search-this.com/2007/02/26/how-to-make-equal-columns-in-css/"><strong>making equal columns</strong></a> and will apply it to make our borders. You should read the article for the full details but briefly the idea goes like this...</p>
<p>An absolute element is placed using top and bottom properties at the same time to hold it in tune with the outer parent. The outer parent has position:relative applied and this keeps the inner absolute element relative to itself at all times. By specifying top and bottom properties at the same time the absolute element will keep its top and bottom in place with the top and bottom of the parent always creating a 100% high element.</p>
<p>Unfortunately IE6 and under don't understand it when you use top and bottom together so instead for IE6 and under only we place the absolute element at the bottom of the element and give it a height that will be bigger than we ever need. It doesn't matter that the height is too big because it will simply disappear through the top of the viewport without any ill-effects.</p>
<p>In fact, for other browsers we don't need to use top and bottom properties at the same time. We can simply give the element a top position and then specify 100%:height. Unlike static elements, absolute elements will keep track of an auto height container.</p>
<p>Time for a <a href="http://www.pmob.co.uk/search-this/absolute-edges.htm"><strong>demonstration</strong></a>.</p>
<p>The css we add to the snippet above is as follows.</p>
<div class="igBar"><span id="lcss-18"><a href="#" onclick="javascript:showPlainTxt('css-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-18">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#edgeL<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">position</span>:<span style="color: #993333;">absolute</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">bottom</span>:<span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">left</span>:<span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span>: 34px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span>:<span style="color: #cc66cc;color:#800000;">100</span>%;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:<span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span>images/left-graphic2.jpg<span style="color: #66cc66;">&#41;</span> <span style="color: #993333;">repeat-y</span> <span style="color: #cc66cc;color:#800000;">0</span> <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; border-right<span style="color: #3333ff;">:1px </span>solid #000;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#edgeR<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">position</span>:<span style="color: #993333;">absolute</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">bottom</span>:<span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">right</span>:-1px;<span style="color: #808080; font-style: italic;">/* hide background jog in IE6*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span>: 34px;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span>:<span style="color: #cc66cc;color:#800000;">100</span>%;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:<span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span>images/right-graphic2.jpg<span style="color: #66cc66;">&#41;</span> <span style="color: #993333;">repeat-y</span> <span style="color: #cc66cc;color:#800000;">0</span> <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; border-left<span style="color: #3333ff;">:1px </span>solid #000;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">* html #edgeR,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">* html #edgeL<span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">height</span>:1000em<span style="color: #66cc66;">&#125;</span><span style="color: #808080; font-style: italic;">/* for ie6- height bigger than page will ever be*/</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The html is simple also:</p>
<div class="igBar"><span id="lhtml-19"><a href="#" onclick="javascript:showPlainTxt('html-19'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-19">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"wrapper"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/h1.html"><span style="color: #000000; font-weight: bold;">&lt;h1&gt;</span></a></span>Full Length side border images<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h1&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>This is the content<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"edgeL"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"edgeR"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The two extra divs that we are utilizing for the borders are shoved to the bottom of the current stacking context and kept nicely out of the way. This method is so simple and the extra mark-up is minimal as only one extra div than the normal height method.</p>
<p><strong>Adding Transparent Shadows</strong></p>
<p>A lot of sites like to have their main page bordered down the side with a transparent shadow effect. In order to do this properly transparent pngs need to be used so that the body background isn't rubbed out and can still be seen below the shadow. This is especially important if the body background has a gradient effect or has fixed images that need to be visible under the shadow.</p>
<p>Unfortunately IE6 (and older) don't understand how to use transparent pngs and you lose any opacity with horrible effect. Fortunately we can use the proprietary <a href="http://reference.sitepoint.com/css/filter">alpha image loader filter</a> to provide IE6 and 5.5 with some sort of fix. As the filter is a Microsoft extension it's best to feed it to only IE6/5.5 (preferably via <a href="http://reference.sitepoint.com/css/conditionalcomments">Conditional comments</a>). For ease I have used the <a href="http://reference.sitepoint.com/css/workaroundsfilters">star selector hack</a> to target IE6 and 5.5. I am ignoring IE5.0 as it doesn't understand the filter but you may wish to supply alternative non-transparent images to IE5 only using conditional comments.</p>
<p>For all other browsers we can simply use the code as shown above and instead of the border images we will use transparent pngs for the borders. For IE5.5/6 we need to add the filter which will make the relevant code look like this.</p>
<div class="igBar"><span id="lcss-20"><a href="#" onclick="javascript:showPlainTxt('css-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-20">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#edgeL<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">position</span>:<span style="color: #993333;">absolute</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">bottom</span>:<span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">left</span>:<span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span>: 34px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span>:<span style="color: #cc66cc;color:#800000;">100</span>%;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:<span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span>images/left-<span style="color: #000000; font-weight: bold;">border</span>.png<span style="color: #66cc66;">&#41;</span> <span style="color: #993333;">repeat-y</span> <span style="color: #cc66cc;color:#800000;">0</span> <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">* html <span style="color: #cc00cc;">#edgeL <span style="color: #66cc66;">&#123;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:<span style="color: #993333;">none</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader<span style="color: #66cc66;">&#40;</span>src=<span style="color: #ff0000;">'images/left-border.png'</span>,sizingMethod=<span style="color: #ff0000;">'scale'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#edgeR<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">position</span>:<span style="color: #993333;">absolute</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">bottom</span>:<span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">right</span>:-1px;<span style="color: #808080; font-style: italic;">/* hide background jog in IE6*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span>: 34px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span>:<span style="color: #cc66cc;color:#800000;">100</span>%;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:<span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span>images/right-<span style="color: #000000; font-weight: bold;">border</span>.png<span style="color: #66cc66;">&#41;</span> <span style="color: #993333;">repeat-y</span> <span style="color: #cc66cc;color:#800000;">0</span> <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; border-left<span style="color: #3333ff;">:1px </span>solid #000;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">* html <span style="color: #cc00cc;">#edgeR <span style="color: #66cc66;">&#123;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:<span style="color: #993333;">none</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader<span style="color: #66cc66;">&#40;</span>src=<span style="color: #ff0000;">'images/right-border.png'</span>,sizingMethod=<span style="color: #ff0000;">'scale'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The image gets supplied to IE6 using the star selector hack but an important point to note is that you must remove the original image because it would conflict with the filter image and ruin the effect. That is the reason for the "background:none" in the IE hack. </p>
<p>Note also that the <em>sizingMethod</em> attribute is set to <em>scale</em> so that the image is scaled to the full height of the element it sits in. This filter is not a substitute for the background property and has limited capabilities. Read more about it in the <a href="http://reference.sitepoint.com/css/filter">Ultimate CSS Reference</a>.</p>
<p>Here is a <a href="http://www.pmob.co.uk/search-this/absolute-edges2.htm"><strong>live example</strong></a> with the changes recommended (view source for the full code).</p>
<p><strong>Figure 3</strong><br />
<a href='http://www.search-this.com/wp-content/uploads/2008/06/fb-fig3.gif'><img src="http://www.search-this.com/wp-content/uploads/2008/06/fb-fig3.gif" alt="" title="fb-fig3" width="411" height="179" size-full wp-image-674" /></a></p>
<p>If you want the main wrapper to have a background colour then you need to move the edges outside of the wrapper so that the transparency isn't affected. This can easily be done by adjusting the left and right positions of the absolute elements.</p>
<p>Here is another <a href="http://www.pmob.co.uk/search-this/absolute-edges3.htm"><strong>live example</strong></a> with the background color added and the edges moved outside the main background (view source for the full code).</p>
<p><strong>Figure 4</strong><br />
<a href='http://www.search-this.com/wp-content/uploads/2008/06/fb-fig4.gif'><img src="http://www.search-this.com/wp-content/uploads/2008/06/fb-fig4.gif" alt="" title="fb-fig4" width="415" height="196" size-full wp-image-675" /></a></p>
<p>That about wraps it up for today and I'm sure you can come up with some better examples than me. Hope you find it useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.search-this.com/2008/06/04/css-bordering-on-the-ridiculous/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Easy Vertical Centering with CSS</title>
		<link>http://www.search-this.com/2008/05/15/easy-vertical-centering-with-css/</link>
		<comments>http://www.search-this.com/2008/05/15/easy-vertical-centering-with-css/#comments</comments>
		<pubDate>Thu, 15 May 2008 14:00:28 +0000</pubDate>
		<dc:creator>Paul OB</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[vertical centering]]></category>

		<guid isPermaLink="false">http://www.search-this.com/?p=656</guid>
		<description><![CDATA[It's always good when you learn something that you already knew isn't it? I know that probably doesn't quite make sense but what I mean is that quite often you know how things work but it's how they are applied that can make all the difference. This is the beauty with CSS where you can [...]]]></description>
			<content:encoded><![CDATA[<p>It's always good when you learn something that you already knew isn't it?</p>
<p>I know that probably doesn't quite make sense but what I mean is that quite often you know how things work but it's how they are applied that can make all the difference. This is the beauty with CSS where you can always be surprised at the different ways the same layout can be achieved. This happened to me the other week when I noticed a different way that a site had been centered using simple techniques already known to us all. Indeed, many of you may already have used this method but it seems to have escaped my attention until now.</p>
<p><strong>The Old Way</strong></p>
<p>One of the first things I learned to do in CSS was how to horizontally and vertically center a fixed width and height element. This could be an image for a splash page (god forbid) or a small centered site that some designers love to do. Originally this was accomplished with absolutely positioning an element 50% from the top and 50% from the left of the viewport. This of course only places the top left corner of the element at the center of the viewport and you then need to drag the element back into a central position with a negative margin equal to half the height and half the width of the element.</p>
<p>Let's take a look at the old way of doing this and note what the problems are.</p>
<div class="igBar"><span id="lcss-31"><a href="#" onclick="javascript:showPlainTxt('css-31'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-31">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">html,body<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span>:<span style="color: #cc66cc;color:#800000;">100</span>%;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin</span>:<span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding</span>:<span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">body<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:#eae7d7 <span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span>images/vert-centre.jpg<span style="color: #66cc66;">&#41;</span> <span style="color: #993333;">repeat-x</span> <span style="color: #993333;">center</span> <span style="color: #993333;">center</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">text-align</span>:<span style="color: #993333;">center</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">min-width</span>:626px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; min-<span style="color: #000000; font-weight: bold;">height</span>:400px;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#vert-hoz<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">position</span>:<span style="color: #993333;">absolute</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">top</span>:<span style="color: #cc66cc;color:#800000;">50</span>%;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">left</span>:<span style="color: #cc66cc;color:#800000;">50</span>%;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin-top</span>:-198px;<span style="color: #808080; font-style: italic;">/* half elements height*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin-left</span>:-313px;<span style="color: #808080; font-style: italic;">/* half elements width*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span>:624px;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span>:394px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; border<span style="color: #3333ff;">:1px </span>solid <span style="color: #993333;">silver</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:#666;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">overflow</span>:<span style="color: #993333;">auto</span>;<span style="color: #808080; font-style: italic;">/* allow content to scroll inside element */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">text-align</span>:<span style="color: #000000; font-weight: bold;">left</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">h1 <span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">color</span>:#fff;margin:<span style="color: #cc66cc;color:#800000;">0</span>;padding:<span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div class="igBar"><span id="lhtml-32"><a href="#" onclick="javascript:showPlainTxt('html-32'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-32">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"vert-hoz"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/h1.html"><span style="color: #000000; font-weight: bold;">&lt;h1&gt;</span></a></span>Content goes here<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h1&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>A live version can be found <strong><a href="http://www.pmob.co.uk/search-this/center0.htm">here</a></strong> and the result as shown in the Figure 1 below.</p>
<p>Figure 1<br />
<img src="http://www.search-this.com/wp-content/uploads/2008/05/vert-fig1.jpg" alt="" title="vert-fig1" width="300" height="211" class="alignnone size-full wp-image-657" /></p>
<p>I have added a background image to the body just to make the page look nice so the only part we are really interested in here is the gray centered portion. (As an aside you should note that to get the background image centered in the viewport you need to set html,body to be 100% high.)</p>
<p>As you can see the result is what we wanted and the element is perfectly centered both horizontally and vertically. This is achieved as already mentioned by putting the top left corner of the element at 50% from the top and 50% from the left. Then using a negative top margin and a negative left margin the element is pulled into a central position using half the elements' height and half the elements' width for the appropriate negative margins.</p>
<p>Although at first glance this seems to work well, there are some severe downsides to using this method and they can be seen by closing the browser window both horizontally and vertically. As the window gets smaller than the element's size the element starts sliding out of view at both the top of the window and the left side of the window. The areas that have slid outside the window are now in fact unreachable even by using the scrollbars on the window. This would mean that users with small screen sizes could not access the content at all.</p>
<p>Figure 2 shows what has happened to the one line of text from our example when the window is closed smaller.</p>
<p>Figure 2<br />
<img src="http://www.search-this.com/wp-content/uploads/2008/05/vert-fig2.jpg" alt="" title="vert-fig2" width="300" height="472" class="alignnone size-full wp-image-658" /></p>
<p>The text is half missing at the top and has also disappeared to the left. If we closed the window further the text would disappear completely. In order to try and address these issues a min-height and min-width has been added to the body, but as you can see this has had no effect at all and the element still lies outside the viewport.</p>
<p><strong>Revised Method</strong></p>
<p>In light of these problems another similar version of this centering technique can be used where the element is still placed absolutely from the top but this time the horizontal centering is achieved using auto margins. This also eliminates the element from sliding off the left of the window.</p>
<p>Here is the revised code.</p>
<div class="igBar"><span id="lcss-33"><a href="#" onclick="javascript:showPlainTxt('css-33'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-33">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">html,body<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span>:<span style="color: #cc66cc;color:#800000;">100</span>%;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin</span>:<span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding</span>:<span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">body<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:#eae7d7 <span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span>images/vert-centre.jpg<span style="color: #66cc66;">&#41;</span> <span style="color: #993333;">repeat-x</span> <span style="color: #993333;">center</span> <span style="color: #993333;">center</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">text-align</span>:<span style="color: #993333;">center</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">min-width</span>:626px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; min-<span style="color: #000000; font-weight: bold;">height</span>:400px;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#vertical<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">position</span>:<span style="color: #993333;">absolute</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">top</span>:<span style="color: #cc66cc;color:#800000;">50</span>%;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin-top</span>:-198px;<span style="color: #808080; font-style: italic;">/* half main elements height*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">left</span>:<span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span>:<span style="color: #cc66cc;color:#800000;">100</span>%;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #cc00cc;">#hoz <span style="color: #66cc66;">&#123;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span>:624px;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin-left</span>:<span style="color: #993333;">auto</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin-right</span>:<span style="color: #993333;">auto</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span>:394px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; border<span style="color: #3333ff;">:1px </span>solid <span style="color: #993333;">silver</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:#666;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">overflow</span>:<span style="color: #993333;">auto</span>;<span style="color: #808080; font-style: italic;">/* allow content to scroll inside element */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">text-align</span>:<span style="color: #000000; font-weight: bold;">left</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">h1 <span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">color</span>:#fff;margin:<span style="color: #cc66cc;color:#800000;">0</span>;padding:<span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div class="igBar"><span id="lhtml-34"><a href="#" onclick="javascript:showPlainTxt('html-34'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-34">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"vertical"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"hoz"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/h1.html"><span style="color: #000000; font-weight: bold;">&lt;h1&gt;</span></a></span>Content goes here<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h1&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>A live version can be found <strong><a href="http://www.pmob.co.uk/search-this/center1.htm">here</a></strong>.</p>
<p>This has the desired effect horizontally but still leaves the top disappearing upwards when the height of the window is made smaller as shown in Figure 3.</p>
<p>Figure 3<br />
<img src="http://www.search-this.com/wp-content/uploads/2008/05/vert-fig3.jpg" alt="" title="vert-fig3" width="300" height="290" class="alignnone size-full wp-image-659" /></p>
<p><strong>The Fix</strong></p>
<p>Now to get over this problem (and to get to the point of this post) I have previously <a href="http://www.pmob.co.uk/pob/hoz-vert-center.htm">used more complicated methods</a>  but there is a simpler, more robust solution involving a float instead of the absolute element.</p>
<p>The first element on the page is a float that is set at 50% of the height of the page. Then we drag the float upward by half the height of the element we want centered.</p>
<p>Here are the changes needed:</p>
<div class="igBar"><span id="lcss-35"><a href="#" onclick="javascript:showPlainTxt('css-35'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-35">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#vertical<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">float</span>:<span style="color: #000000; font-weight: bold;">left</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span>:<span style="color: #cc66cc;color:#800000;">50</span>%;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin-top</span>:-198px;<span style="color: #808080; font-style: italic;">/* half vertical height*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span>:<span style="color: #cc66cc;color:#800000;">100</span>%;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div class="igBar"><span id="lhtml-36"><a href="#" onclick="javascript:showPlainTxt('html-36'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-36">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"vertical"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"hoz"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/h1.html"><span style="color: #000000; font-weight: bold;">&lt;h1&gt;</span></a></span>Content goes here<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h1&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Here is the <strong><a href="http://www.pmob.co.uk/search-this/center2.htm">link to a live version</a> </strong> so you can see for yourself.</p>
<p>Figure 4<br />
<img src="http://www.search-this.com/wp-content/uploads/2008/05/vert-fig4.jpg" alt="" title="vert-fig4" width="300" height="305" class="alignnone size-full wp-image-660" /></p>
<p>The important part is that we use a float of 100% width and then also remember to add clear:both to the following element as some browsers will get confused otherwise. If we did not use "float" then the element would still be centred but it would also disappear through the top of the screen unlike the floated method.</p>
<p><strong>Why This Works</strong></p>
<p>This throws up an interesting behavior concerning floats and it's good to understand what's going on here exactly. Why is it that when we use a static element (or an absolute element as in the first example) that the content disappears through the top of the viewport but doesn't do this with a float?</p>
<p>The nature of floats is that they are removed from the flow (although you can regain control by using "clear" on following elements). The content following a float is displaced to make room for the float (usually by the browser increasing the top margin on the static content to clear the float). If the float were not there at all then <strong>the content would occupy its normal position in the page</strong>. Therefore when using a negative top margin on a float, the float will travel outside the confines of any containing block because as we stated previously a float is basically removed from the flow. However if we drag the float far enough outside the containing block so that none of it exists inside, then any following content cannot continue to follow the float upwards but resides inside its containing block allowing the float to float way.</p>
<p>This is in fact what happens in our example as the float is dragged upwards away from the body and the following content has to remain inside the containing block formed by the body element. This may be a little hard to understand straight away but can be seen in a simple demo as follows.</p>
<div class="igBar"><span id="lcss-37"><a href="#" onclick="javascript:showPlainTxt('css-37'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-37">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.<span style="color: #000000; font-weight: bold;">float</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span>:200px;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span>:100px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:<span style="color: #993333;">red</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">float</span>:<span style="color: #000000; font-weight: bold;">left</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.<span style="color: #000000; font-weight: bold;">top</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:<span style="color: #993333;">green</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span>:300px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span>:<span style="color: #cc66cc;color:#800000;">100</span>%;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.follow-on<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">clear</span>:<span style="color: #993333;">both</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:<span style="color: #000000; font-weight: bold;">blue</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; height<span style="color: #3333ff;">:100px</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"></span><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div class="igBar"><span id="lhtml-38"><a href="#" onclick="javascript:showPlainTxt('html-38'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-38">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"top"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>Top<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"float"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>Float<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"follow-on"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>Following content<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The code above sets a static element at the top of the page followed by a float and then followed by more static content which produces the result seen in figure 5 below and in a <strong><a href="http://www.pmob.co.uk/search-this/center3.htm">live example here</a></strong>.</p>
<p>Figure 5<br />
<img src="http://www.search-this.com/wp-content/uploads/2008/05/vert-fig5.jpg" alt="" title="vert-fig5" width="300" height="288" class="alignnone size-full wp-image-661" /></p>
<p>Nothing special there and all working as expected.</p>
<p>If we next <strong><a href="http://www.pmob.co.uk/search-this/center4.htm">add a 100px negative top margin</a> </strong>to the float we <strong><a href="http://www.pmob.co.uk/search-this/center4.htm">get the result</a></strong> as shown in Figure 6.</p>
<div class="igBar"><span id="lcss-39"><a href="#" onclick="javascript:showPlainTxt('css-39'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-39">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.<span style="color: #000000; font-weight: bold;">float</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span>:200px;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span>:100px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:<span style="color: #993333;">red</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">float</span>:<span style="color: #000000; font-weight: bold;">left</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; margin-top<span style="color: #3333ff;">:-100px</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"></span><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Figure 6<br />
<img src="http://www.search-this.com/wp-content/uploads/2008/05/vert-fig6.jpg" alt="" title="vert-fig6" width="300" height="371" class="alignnone size-full wp-image-662" /></p>
<p>Still everything as expected but what happens if we <strong><a href="http://www.pmob.co.uk/search-this/center5.htm">increase the negative top margin</a></strong> to 200px?</p>
<div class="igBar"><span id="lcss-40"><a href="#" onclick="javascript:showPlainTxt('css-40'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-40">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.<span style="color: #000000; font-weight: bold;">float</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span>:200px;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span>:100px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:<span style="color: #993333;">red</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">float</span>:<span style="color: #000000; font-weight: bold;">left</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; margin-top<span style="color: #3333ff;">:-200px</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"></span><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Figure 7 shows the result once again.</p>
<p>Figure 7<br />
<img src="http://www.search-this.com/wp-content/uploads/2008/05/vert-fig71.jpg" alt="" title="vert-fig71" width="300" height="371" class="alignnone size-full wp-image-664" /></p>
<p>As you can see the float has moved away from the following content but the content that was below the float stays at the top of its own containing block (i.e. beneath the green block). This is exactly what happens when we drag the float outside the viewport in our main example.</p>
<p>However if we were to simply <strong><a href="http://www.pmob.co.uk/search-this/center6.htm">remove the float property</a></strong> from our red div then both the red div and the content below would be dragged up over the green element.</p>
<p>Figure 8<br />
<img src="http://www.search-this.com/wp-content/uploads/2008/05/vert-fig8.jpg" alt="" title="vert-fig8" width="300" height="372" class="alignnone size-full wp-image-665" /></p>
<p>With a static element the flow of the page under the element with the negative margin is changed and all the content is dragged upwards accordingly.</p>
<p>I hope you have enjoyed this little tip (even if you already knew about it)  and it shows that there is always something new to learn for all of us. Refer to the <strong><a href="http://www.pmob.co.uk/search-this/center2.htm">original example</a></strong> for the full source code as it is all in the head to be grabbed easily.</p>
<p>If you want to look at some more advanced centering techniques then I have a few other methods documented <a href="http://www.pmob.co.uk/pob/hoz-center-nowidth.htm">here</a>. Have Fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.search-this.com/2008/05/15/easy-vertical-centering-with-css/feed/</wfw:commentRss>
		<slash:comments>65</slash:comments>
		</item>
		<item>
		<title>Why Validate</title>
		<link>http://www.search-this.com/2008/04/24/why-validate/</link>
		<comments>http://www.search-this.com/2008/04/24/why-validate/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 13:51:34 +0000</pubDate>
		<dc:creator>Paul OB</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://www.search-this.com/?p=644</guid>
		<description><![CDATA[This is an old question but worthy of a mention once again especially as I seem to have spent the last few days repeatedly pointing out to posters why their page isn't displaying properly. No matter how good a coder you are no one is perfect and the odd typo or spare character will often [...]]]></description>
			<content:encoded><![CDATA[<p>This is an old question but worthy of a mention once again especially as I seem to have spent the last few days repeatedly pointing out to posters why their page isn't displaying properly. No matter how good a coder you are no one is perfect and the odd typo or spare character will often creep into your code when you aren't looking.</p>
<p><strong>Why Should I Validate?</strong></p>
<blockquote><p>I don’t know the answer “why you should validate” but I certainly know why I validate.
</p></blockquote>
<p>In a recent article on <a href="http://www.search-this.com">Search-This</a> a poster commented that it was unnecessary to validate HTML and CSS and served little benefit so I thought it would be wise to explain why I always validate and why it is good for me. You can then make up your own minds whether you should validate or not.</p>
<p>The usual response of the uninformed is that "validation is not necessary" and while I agree that validation for the sake of validation is not necessary, it most certainly is necessary if you want to keep tight control of your work and limit the chances that something will go wrong.</p>
<p>Probably as many as 5 out of 10 calls for help that I receive are things that could have been solved by simply running CSS and HTML through the <a href="http://jigsaw.w3.org/css-validator/">W3C validation service</a>.</p>
<p>Take the following code for example which is a snippet from a recent call for help.</p>
<div class="igBar"><span id="lcss-43"><a href="#" onclick="javascript:showPlainTxt('css-43'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-43">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">body<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:#fff;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span>:#000;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-family</span>: Verdana, Arial, Helvetica, <span style="color: #993333;">sans-serif</span><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#outer<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span>:300px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span>:200px;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:#ff0;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">p<span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">color</span>:<span style="color: #993333;">green</span><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div class="igBar"><span id="lhtml-44"><a href="#" onclick="javascript:showPlainTxt('html-44'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-44">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"outer"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>testing<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>If you run the above code in Firefox you will see that all the styles for #outer fail to show up. Although the CSS is just a few lines the error is quite hard to spot straight away. Now imagine if the file was hundreds of lines long; the task of finding the problem would be even harder. As soon as you see that something is wrong the first step should be to run the CSS and HTML through the validator to see what it has to say about the code.</p>
<p>Running the above CSS through the <a href="http://jigsaw.w3.org/css-validator/validator">CSS Validator</a> flags an error straight away.</p>
<blockquote><p>Sorry! We found the following errors (1)<br />
URI : file://localhost/TextArea<br />
5 		Parse error - Unrecognized }</p></blockquote>
<p>Straight away we can see that there is a stray closing bracket causing #outer to become unrecognized and the styles to not get applied. For finding errors like this and other errors such as mis-typed properties and values there is no quicker way to spot the exact error than simply running the code through the validator before you start to blame the browser.</p>
<p>More advanced coders can get away with validating their work less frequently during development but for beginners it is a must and should be done frequently. In this way, silly errors are avoided and the beginner is also alerted to the fact that they may be using an incorrect property or value.</p>
<blockquote class="bqr">
<p>It's basically like using a spell checker which will fix your words but doesn't mean that you can write anything sensible. You still need common sense and to have some idea of what you are doing.</p>
</blockquote>
<p>When you've looked through as many sites as I have (over 20,000) you know that validation is necessary to weed out all the silly errors and typos that creep even into the best code.</p>
<p>I never validate my pages just so that I can put a sticker on the page (which I don't do) but I do validate my page to see what errors are on the page and then make a decision to live with them or not. If the errors are missing div tags or typos then I will fix them.</p>
<p>If the error is because I am using a non-standard proprietary CSS then I can live with that as long as I understand the implications. Validating your page regularly will keep the code clean of silly errors and allow you to get on quickly with the job in hand. </p>
<p>It's basically like using a spell checker which will fix your words but doesn't mean that you can write anything sensible. You still need common sense and to have some idea of what you are doing.</p>
<p>Validation for the sake of validation is a different matter but validation for the sake of weeding out silly errors and typos is a must and I strongly recommend doing this to save at least some hair-pulling.</p>
<p>Of course just having valid code does not mean that the page will be rendered correctly but it does at least allow you to look in the correct place for the error when something is not right. Too many times I see the browser blamed for something which was an error in the author's code and not the browser's fault at all. The fact that one browser may display the code OK and another may not does not mean that either browser is wrong but just they may have different procedures for when errors are encountered. Using the correct code in the first place would have avoided the issue at stage one.</p>
<p>However, I will agree that the validators may appear a little unfriendly at first but understanding the validator is another skill that needs to be learned (along with all the other things a web developer has to cope with). It's worth the effort and will pay dividends in the long run.</p>
<p>"Why should I validate" is still therefore a valid question with an easy answer. </p>
<p>"It will save you time and effort and also shows you care about your work".</p>
]]></content:encoded>
			<wfw:commentRss>http://www.search-this.com/2008/04/24/why-validate/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Browser Testing Made Easy</title>
		<link>http://www.search-this.com/2007/06/19/browser-testing-made-easy/</link>
		<comments>http://www.search-this.com/2007/06/19/browser-testing-made-easy/#comments</comments>
		<pubDate>Tue, 19 Jun 2007 15:36:13 +0000</pubDate>
		<dc:creator>ses5909</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Website Design]]></category>
		<category><![CDATA[Website Tools]]></category>

		<guid isPermaLink="false">http://www.search-this.com/2007/06/19/browser-testing-made-easy/</guid>
		<description><![CDATA[Quite often when developers create a website they typically design for the latest version of Firefox and IE. While in general this will cover the majority of the users, there are other browsers you should test the site in to make sure you take into consideration your other users. Unfortunately, with various operating systems and [...]]]></description>
			<content:encoded><![CDATA[<p>Quite often when developers create a website they typically design for the latest version of Firefox and IE. While in general this will cover the majority of the users, there are other browsers you should test the site in to make sure you take into consideration your other users. Unfortunately, with various operating systems and compatibility issues, it's not always that easy. Hopefully this guide can get you started.</p>
<p>With IE7 out, you would <em>think</em> that most people have upgraded their browser, but that just isn't the case. For some people IE6 was good enough for them and they don't want Windows pushing down an update. Also, a lot of people aren't signed up for automatic updates. So how do you handle this? A few months ago I came across this nice little app that lets you <a href="http://tredosoft.com/Multiple_IE">install and run multiple versions of IE</a>. Once I installed IE7 there was no going back to 6, until I found this cool little tool. If you need to test in multiple versions of IE, this is the way to go. You can find the various versions of IE for download at <a href="http://browsers.evolt.org/?ie/32bit/standalone">evolt</a>.</p>
<p>Safari users have always been a unique bunch and a very small minority; one worth considering though. I created an outline for this post a couple of weeks ago, and for testing I was going to recommend <a href="http://try.swift.ws/">swift</a> as it's built on Apple's WebCore engine; since then however, a beta version of Safari 3.0 has been released which includes support for Windows users now! Before this release, developers didn't have a good way of testing websites on Safari without having access to a Mac. Swift worked SOMETIMES but I routinely had issues with it. I know my mac friends just LOVED me bugging them to test a site for me. I have tried several sites out with Safari since downloading it and am pleased with the results. Get the <a href="http://www.apple.com/safari/">latest version of Safari</a> from Apple.</p>
<p>Opera! There is no reason NOT to test your sites in Opera. It is available for *nix platforms as well as Mac and Windows. How they scored this domain I have no idea, but to download the latest version, go to <a href="http://www.opera.com/">Opera.com</a>.</p>
<p>What about all 5623 other browsers? Okay, that may be a slight exaggeration, but you can see a <a href="http://browsers.evolt.org/">full list of browsers</a> at evolt. Something else I use to help me test my sites is a <a href="http://www.browsercam.com">browsercam subscription</a>. You may be quite shocked at some of the pricing but if you find a <a href="http://www.sitepoint.com/forums/showthread.php?t=345568">BrowserCam Groupe Purchase</a> to piggy back on, you can get a year for $25 which is WELL worth it. I use mine quite frequently. You can get screenshots of what your url looks like in various browsers on various operating systems. It's been invaluable to me. Click on the image for a larger size:</p>
<p><a href='http://www.search-this.com/wp-content/uploads/2007/06/browsers-big.gif' title='small browser'><img src="http://www.search-this.com/wp-content/uploads/2007/06/browsers-small.gif" border="0" width="450" height="352" /></a></p>
<p>So do you have any special browsers you test in or special tricks to share? I have given my standard suggestions, but would love to hear more. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.search-this.com/2007/06/19/browser-testing-made-easy/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Web Browser Wednesday &#8211; Going to the Opera (Part 1)</title>
		<link>http://www.search-this.com/2007/03/21/opera-web-browser-part-one/</link>
		<comments>http://www.search-this.com/2007/03/21/opera-web-browser-part-one/#comments</comments>
		<pubDate>Wed, 21 Mar 2007 14:39:25 +0000</pubDate>
		<dc:creator>Dan Schulz</dc:creator>
				<category><![CDATA[Browsers]]></category>

		<guid isPermaLink="false">http://www.search-this.com/2007/03/21/opera-web-browser-part-one/</guid>
		<description><![CDATA[Note: This is merely a product review being provided by the author for educational and informational purposes only. Nothing that is stated in this article is meant, nor shall be used to imply, construe or otherwise hint of a product endorsement. The content of this article is merely the personal opinion of the author, and [...]]]></description>
			<content:encoded><![CDATA[<p><em>Note: This is merely a product review being provided by the author for educational and informational purposes only.  Nothing that is stated in this article is meant, nor shall be used to imply, construe or otherwise hint of a product endorsement.  The content of this article is merely the personal opinion of the author, and should not under any circumstances whatsoever be used to imply, construe, or otherwise hint of an endorsement by <a href="http://www.search-this.com" title="Website Promotion, Internet Marketing and SEO Help">Search-This</a>, its authors or readers.</em></p>
<h2>Overview</h2>
<p>They say that in the land of the blind, the one-eyed man is king.  In the case of the World Wide Web, the blind people are the ones stuck using a single Web browser, usually without even being aware that alternative browsers exist (or against their will, if they are aware that other browsers exist).  This is not a slam against Microsoft’s Internet Explorer (which is installed by default on almost every computer running Windows); not at all.  What I am saying is that sometimes you are stuck using a particular Web browser to browse the Web and get your work done online, and the particular site you are viewing "is best viewed in a browser other than the one you are using" because the person (or team) responsible for that particular Web site is either stuck in 1998, too lazy to code properly (or worse, doesn’t even know how to), or isn’t even aware that your browser exists in the first place (if the latter was the case, I am sure it would have been added to that site’s "browser sniffing" script once they became aware of it).</p>
<p>Now don’t get me wrong, most people are happy to use their computer’s default browser "just because it’s there" and "because it’s good enough for me" (my own brother included).  As a Web developer, I respect the user’s choice, rather than forcing him or her to "Get Browser X" or "Download Browser Y" either out of greed (advertising revenue sharing) or ignorance that the browser doesn’t even exist.  To kick off this article series, I’ll be covering one of these "oft-ignored" browsers: Opera.  I’ll warn you now, this is a long article, and will be broken into two (possibly three) parts; I learned a lot more about Opera and what it can do "out of the box" than what even I thought was possible when I started researching the inner workings of this browser a month ago.  (For the sake of Search-This's readers, I solemnly swear to do my best to ensure that future articles are nowhere near as long.)</p>
<h2>I’m not making this up.  It really is a Web browser.</h2>
<p>Time after time, when helping other Web designers and developers, I see the same "advice" used all the time.  "You’re coding for Internet Explorer.  Internet Explorer is displaying it wrong.  Code for FireFox; then hack for IE."  Not only is this harmful to the health of your Web site (which I’ll cover in a future article), but it also leads people to believe that there are only two browsers on the market (Internet Explorer and FireFox).  I’m sure that Microsoft, Google and the Mozilla Foundation appreciate the free advertising, but I like to keep all the options on the table.  Opera is one of those options.</p>
<h3>A (not so) brief history of the Opera Web browser</h3>
<p>The brain-child of Jon Stephenson von Tetzchner and Geir Ivarsøy, Opera got its start in 1994 as a research project at Telenor, Norway’s largest telecommunications company.  A year later, the project was spun off as an independent development company called Opera Software ASA.  1997 saw the release of the first public version of Opera Software’s desktop browser, Opera 2.1.  Despite being a leader in such technologies as MDI (Multiple Document Interface), which allowed the user to run more than one browser window while using just one instance of the program, managed logins, mouse gestures (introduced in Opera 8.0), integrated search, blocking in-line content, saved sessions, the browser’s own trash can, and tabbed browsing (which was based on MDI), the browser was horrible.  Its rendering engine lagged behind the other desktop browser vendors for years, and thus was quickly regarded as an "also-ran" browser (for example, Opera 3.6 was roughly equal to Netscape Navigator 3.x, and really didn't improve that much until Opera 7 came out in 2003), despite being older than either Netscape Navigator or Microsoft Internet Explorer (both Netscape Navigator and Internet Explorer were originally forks of the NCSA’s Mosaic Web browser).  But given that this was the height of the "browser wars" between Microsoft Corporation and Netscape Communications, I can tell you that nobody really noticed, nor did they probably care.</p>
<p>Nor did people care that Opera Software’s vision of an emerging "Internet device market" materialized in the form of a project to port their browser to multiple platforms (such as Windows PC, Apple Macintosh and Unix/Linux boxes).  This decision would ultimately lead Opera to become the market leader in the mobile and hand-held device industry, with their browser being the dominant software on various Internet-capable devices, such as PDAs (personal digital assistants), Web-enabled cell phones, even Sony’s PSP (PlayStation Portable) and Nintendo’s Wii gaming console.  Not bad for a company that looks towards the future, a future in which they are not only the leaders of the non-standard device market, but also a promising alternative to the traditional device market (your computer) as well.</p>
<p>Fast-forward to 2001.  That year, Opera Software signed an agreement with Symbian Ltd. to incorporate the browser on smart phones.  Later that year, Opera 5 (which is the first version I was exposed to) reached a record 5 million downloads (it reached ten million desktop browser downloads two years later).  You might not think that’s incredible, but it is for the simple fact that at the time, Opera was not free.  It was commercial software, with a $40 price tag.  That’s right folks; if you wanted to use this browser, you had to pay for it.  It was also the first browser to have tabbed browsing (yep, that’s correct; Opera had it first, not Mozilla FireFox).</p>
<p>So, if the browser sucked so much, why wasn’t it relegated to the scrap heap with the other also-rans and has-beens?  Because Opera wasn’t satisfied with just making money on the mobile market, that’s why.  Think about it.  You’re a mobile browser vendor, and you want to be the leader of that market.  Yet when most people hear the word browser, they think of Netscape Navigator or Internet Explorer (nowadays it’s Internet Explorer and FireFox).  So how do you change that?  Give your red-headed stepchild a makeover, that’s how.</p>
<p>And that’s exactly what they did.  They re-wrote the browser from the ground up, starting with a new rendering engine, which they nicknamed "Presto".  The new rendering engine finally supported the W3C DOM Level 2 (though not completely), CSS 1 and 2, ECMAScript (an international client-side scripting standard very similar to JavaScript), and improved HTML 4.01 support, plus complete support for Wireless Markup Language versions 1.3 and 2.0.  Add to that XML, HTTP 1.1, JavaScript 1.3, 128-bit encryption, SSL 2 and 3, and you had one heck of a punch.  Opera 7 also introduced a new email client, M2, which included an integrated spam filter, new features like QuickFind and QuickReply, and automatically sorted and categorized emails by contact.  It also supported POP3, IMAP, ESMTP and threaded displays, plus news servers with password authentication.</p>
<p>Opera 7 also had "The Wand" - and I do not mean the magician’s wand either (thought it might as well be).  Not only did it let you "remember" passwords, but you could also log in to your favorite Web site with one single click of the wand, or by pressing CTRL (Cmd on a Mac) + Enter (Return on a Mac).  Pretty neat, huh?</p>
<p>With a Web browser that had finally caught up with the standards, plus innovative features that everyone and their uncle would soon rip off wholesale, Opera finally had a winner.  But there was still a catch.  The price was not right.  Sorry Bob Barker, but Opera still wasn’t free.  Unless you wanted to put up with ads that were built into the browser chrome, you had to shell out $40 for the "premium" version of the browser (which, in addition to removing the ads also gave you direct access to Opera's help desk).</p>
<p>All that changed on 20 September 2005 with the release of Opera 8.5.  On that day, Opera Software released the first truly free version of their flagship desktop browser.  No longer did you have to pay for it, or put up with the annoying advertisements.  Just download and go.  Opera 9.0 beta was also released around that time; one person I know took one look at it and said <em>"This is a BETA? Seems just as stable (so far) as 8.5 was. You can tell they are appeasing Firefox converts with the addition of opera:config which is functionally identical to about:config... while the addition of support for XSLT, Web Forms 2.0 and Canvas2D puts it back ahead of the curve on innovation."</em>  Enough of the history lesson, though.  You want to see what Opera 9 has under the hood, don’t you?</p>
<h3>A Peek Under the Hood</h3>
<div>
<blockquote><p><strong>Mafia Guy:</strong> "You got the stuff?"<br />
<strong>Customer:</strong> "Yeah, I got the stuff.  You got the money?  I want to see the money!"<br />
<strong>Mafia Guy:</strong> "No, no, no.  You don’t see the money until I see the stuff."<br />
<strong>Stewie Griffin:</strong> "Oh for God’s sake there’s only one way to put an end to this nuisance.  HE’S WEARING A WIRE!"<br />
<strong>Mafia Guy:</strong> "WHAT?  You son of a—" (shots fired)<br />
<strong>Stewie Griffin:</strong> *yawn* (goes back to sleep)</p></blockquote>
</div>
<p>Unlike the above excerpt from "Family Guy" you don’t have to pay anything to use Opera anymore.  It’s free.  Not "free as in freedom" (like with FireFox) but "free as in beer."  So, what does Opera have under the hood?  Good question.  I’m going to start with the basics.</p>
<p>First off, Opera is a browser.  A computer program available as a free download from <a href="http://www.opera.com/download/index.dml?custom=yes">Opera's Web site</a> (yes, it’s free, and no you don’t have to uninstall anything to use it).  Simply download the file, run it, and let it do its thing.  It’ll install itself for you, saving you the hassle of having to hold its hand through the entire installation process.  It’s also relatively small, with the international English version coming in at 6.14 MB.  While not as small as FireFox (4.5 MB last I checked), Opera does have a lot of features built right into the browser that are lacking from the open source Gecko-based browsers currently available (such as FireFox).  Opera is also available for Macintosh and Unix/Linux machines as well.  The standard English installer is only 4.7 MB with the classic English installer weighing in at 3.9 MB (for the record, I downloaded the International English version).</p>
<p>Rather than offering third-party extensions, Opera chooses to integrate the most useful features directly into the browser as a quality assurance measure.  With third party plug-ins, only the developer is responsible (and let’s face it, the "developer" may be some 10 year old kid with a few weeks of programming experience – they’re not called "script kiddies" for nothing).  I don’t know about you, but I prefer to see a vendor hold itself accountable in case it screwed something up.  Opera can be extended with "widgets", but I’ll talk about them once I have covered the basics.</p>
<h4>Basic Training</h4>
<p>No, this isn’t the Army or Marine Corps.  You don’t have to worry about an ornery drill instructor waking you up at 0430 by screaming in your face calling you a filthy greenhorn maggot (or worse).  I’m a nice guy, or so my therapist would say (if I had one).  Let’s get started, shall we?  The first thing to look at is tabbed browsing.  Yes, FireFox has this, and even Internet Explorer 7 has it as well.  But remember, Opera had it first.  Tabbed browsing was introduced with Opera 5, which was based on the browser’s earlier MDI (Multiple Document Interface) technology.  Using it is surprisingly easy.  Just click on the "New Tab" button at the top of the browser (directly below the program menu) and voila, you’re done.  Type the location of a Web page or site into the address bar and you’re off.  Couldn’t be easier, or could it?  Turns out there are other ways to open a new tab as well.  You can press Ctrl T (hold the CTRL button down and press "T" – Mac users need to press CMD instead), right click over a link and choose "Open in New Tab" or "Open in Background Tab" and even press "Ctrl" "Shift" and "Enter" while the mouse is over a link (though this didn’t work on my copy of Opera).  To close a tab, just press Ctrl W.</p>
<p>Importing bookmarks and favorites into Opera is also easy.  All you have to do is go to File &gt; Import and Export, then choose which bookmarks you wish to import into Opera.  You can choose from older versions of Opera, Internet Explorer, Netscape, FireFox, and even Konqueror.  I don’t have a Mac, so I can’t tell you if the Macintosh version of Opera will let you import bookmarks from Safari, Camino and iCab/OmniWeb, but I wouldn’t be surprised if it could.</p>
<p>Another great feature that Opera has is the trash can.  If you ever close a tab (either intentionally or by mistake) you can get it back by clicking on the trash can, which is located near the upper right hand corner of the browser, or by pressing Ctrl+Z (which is the typical "Undo" command found in many computer programs).  Click the little icon and choose the tab you want to bring back.  That’s all there is to it.  Just make sure you don’t close the browser; if you do, you’ll lose the tabs that are stored there.</p>
<p>If you ever close the entire browser, don’t worry.  You won’t lose anything (other than what is in the trash can).  All you have to do is re-start Opera, and it will ask you if you want to continue where you left off, start with a clean slate, or start with Opera’s home page.  I’ve had this happen to me on occasion, and I always choose to pick up where I left off when it happens (in fact, while writing this article, I had two copies of Opera open when the browser crashed on me unexpectedly; not only did the browser ask me where I wanted to continue, but also re-opened both copies and reloaded all the tabs in them as well).  You can also save your "session" with Opera for later.  I’ve never used it, but it’s fairly easy to do.  Just click File &gt; Sessions &gt; Save This Session.  Then give your session a name and save it.  You can have Opera start with your session each and every single time.  I don’t do this, but like I said, I don’t use sessions anyway.</p>
<p>Searching for Web sites and pages is also very easy with Opera.  Next to the address bar is the integrated search bar; it will let you search sites like Google, eBay, Amazon.com and others.  Click on the search field, type in the words you want to search for, then press Enter.  If you want to see multiple search results, right-click and select "Open in Background Tab" to make the link open in a background browser tab (you can also press Ctrl+Shift when clicking).  Not only that, but you can also use the fast-forward button to make Opera go to the next search results page.  If that wasn’t enough, you can also use the address bar, by typing a letter followed by a space and the search term, item or page you want to look for.  For a list of available search field shortcuts, go to Tools  &gt; Preferences  &gt; Search.  You can add new shortcuts by clicking the "Add" button and filling in the details of that site’s search engine.  To make things even easier when adding a search engine to the integrated search bar, right-click in the search field and select Create Search.  Opera will then add the new search engine to its list, allowing you to search that site directly from your browser.</p>
<h4>Not In My Browser (Yuck)</h4>
<h5>The Truth About Browser Security</h5>
<p>A browser is only as secure as the developers who created it and the person who’s using it.  This is a proven fact.  Every browser vendor says their browser is the most secure.  I hate to say it, but unless you’re using Opera, you don’t have the most secure browser.  I use Internet Explorer, FireFox and Opera on a regular basis, along with AVG Anti-Virus, Lavasoft Ad-Aware SE, Spybot Search &amp; Destroy, SpywareBlaster and Microsoft’s Windows Firewall on Windows XP Professional with Service Pack 2.  Each time I update my malware blockers and run my scans, they catch garbage that gets through both IE and FireFox (usually just tracking cookies, but two viruses did manage to slip through FireFox last year).  Nothing has gotten past Opera since I started using it in 2003.  Nothing.  Period.  End of story.</p>
<p>So what makes Opera so secure?  Well, for starters, Opera determines how it handles files based on the MIME-type of the file it’s been told to use (or download).  On top of that, Opera doesn’t support ActiveX or VBScript, instead relying on Sun Microsystems’ Java platform (I recommend that you turn this feature off) and open Internet standards.  However, Opera can still be vulnerable to macro viruses embedded in Microsoft Office applications (Word, Excel, PowerPoint), so don’t use the browser to view those files.  Use the program that was intended to view these types of files instead (this is true regardless of what browser you use).  For more information on browser security (and browsing best practices), please visit Opera’s pages on browser security at <a href="http://www.opera.com/support/tutorials/security">Opera's Security Tutorial page</a>.</p>
<p>Opera supports Secure Socket Layer (SSL) versions 2 and 3, as well as TLS 1.0 and 1.1 (transport layer security).  TLS, a cryptographic protocol which provides secure communication authentication between a client (in this case, the Web browser) and a server over TCP/IP networks, is an enhancement to the latest version of SSL 3, and a proposed Internet standard created by the Internet Engineering Task Force (IETF) which is intended to replace SSL in the near future.  It can also be used to verify the identities of the client and server and exchange encrypted information necessary to create encryption keys that both sides can use.  Each part of the message sent between the client and server contains a signature verifying the authenticity of that part of the message; these signatures are very hard to counterfeit without knowing what the encrypted information was sent between the client and server when the connection was established.  It’s nice to know that TLS has been supported by Opera since version 3.5, but that’s beside the point.  It works, and when combined with other technologies, will help to keep your computer safe from those who wish to compromise your security.  The browser also offers 256-bit encryption, which is the highest available level of security in any Web browser.</p>
<p>On top of that, Opera’s security manager and fraud protection measures help protect you from malicious Web sites.  When viewing a secure Web site, click on the address bar (it’ll be yellow instead of the default color) and you’ll be able to view additional information about the validity of the security certificate in question.   You can also determine if a site may be fraudulent by clicking on the icon directly to the right of the search bar.  Opera will check the domain name against a database of known phishing Web sites and also display even more security information about the site you are visiting.  If it determines the site may be a fake, it will give you the option to report it.  You will also be given a choice of whether to continue on to the possibly fraudulent Web page or to return to the home page.  Fraud protection is enabled by default, and can be turned on and off by going to Tools &gt; Preferences &gt; Advanced &gt; Security and then checking/un-checking the box marked "Enable Fraud Protection."</p>
<p>If that wasn’t enough, Opera’s cookie manager also gives you control over what cookies you want to accept and deny.  Opera handles cookies the same way as the other major browsers; in fact, it uses the exact same file format as Internet Explorer and Mozilla FireFox.  However, Opera saves its cookies in a file called <em>cookies4.dat</em> which is located in the user’s Opera profile folder (Linux users can find it on .opera and Macintosh users can find it on <em>Opera Preferences</em>).  This file cannot be edited by hand; if you want to remove cookies from your hard drive, go to Tools &gt; Advanced &gt; Preferences &gt; Cookies then select "Manage Cookies".</p>
<p>One last thing on the topic of security (you’ll want to know this).  If you ever want to erase all traces of where you have been online, you can clear your browser history and cache at any time.  This is done simply by going to Tools &gt; Delete Private Data.  Piece of cake.</p>
<h5>Cosmetic Surgery: Getting Rid of Advertisements</h5>
<p>I hate ads.  I hate them with a passion.  I hate them more than health nuts hate junk food.  Fortunately I can do something about it.  Once again, Opera comes to the rescue with its pop-up blocker, inline content blocking technology, and even the capability to allow for user style sheets that specifically block advertisements.  It’s like performing cosmetic surgery on a Web page.</p>
<p>Blocking pop-ups is easy.  All you have to do is either press F12 or go to Tools &gt; Quick Preferences and choose how you want to set up the pop-up blocker.  I have mine set to block all unwanted pop-ups, which works very well for me.  Your mileage may vary of course.  These days though almost every browser has a built in pop-up blocker, but the next two options available to you will make any Web designer or online advertiser cringe.</p>
<p>A lot of Web sites rely on advertisements to bring their owners/creators money, and a lot of people don’t want to look at them.  Fortunately Opera agrees, and has provided us with the means to get rid of them.  In-line content blocking is one of them.  This feature can be used either by pressing Ctrl (Cmd on a Mac) and M followed by K, or by right-clicking on a Web page and selecting "Block Content" from the menu that appears.  Unfortunately I couldn’t find a way to block content just by using the keyboard; this may be one of the few features to require the use of a mouse.  What you’ll have to do instead is take the mouse cursor, hover it over the content you want to block (it won’t be faded out, so you can see it clearly) and click on it.  When you are finished, click "Done" and Opera will block the content for you.</p>
<p>If that wasn’t bad enough, someone came up with a unique way to remove (almost) all the advertisements found on Web pages – even Google Ads.  This requires a custom user stylesheet, which I’ll cover in the next installment of this multi-part article.  But suffice to say (for now) it will literally remove advertisements from the Web pages you visit.</p>
<p>Ok, that’s enough for this week.  It’s time for an intermission.  Go take a break, comment on what’s been written so far, play a game, hug your children (if you have them), and relax.  In the next installment, I’ll talk more about some of the intermediate level and advanced browser features, as well as the built-in email client, BitTorrent, IRC client, and even how to extend Opera to suit your needs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.search-this.com/2007/03/21/opera-web-browser-part-one/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Introducing Dan Schulz</title>
		<link>http://www.search-this.com/2007/01/31/introducing-dan-schulz-dan-schulz/</link>
		<comments>http://www.search-this.com/2007/01/31/introducing-dan-schulz-dan-schulz/#comments</comments>
		<pubDate>Wed, 31 Jan 2007 17:20:38 +0000</pubDate>
		<dc:creator>Golgotha</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Search Engine Optimization]]></category>

		<guid isPermaLink="false">http://www.search-this.com/2007/01/31/introducing-dan-schulz-dan-schulz/</guid>
		<description><![CDATA[Search-This welcomes Dan Schulz to the team! Dan is another SitePoint catch and a good one. He draws from a wide area of web expertize, but his passions run deep for CSS, XHTML, usability and standards compliant code. One thing is for sure, with the Search-This team we have assembled, you won't find any crappy [...]]]></description>
			<content:encoded><![CDATA[<p>
<a href="http://www.search-this.com">Search-This</a> welcomes Dan Schulz to the team!
</p>
<p>
Dan is another <a href="http://www.sitepoint.com/forums/forumindex.php">SitePoint</a> catch and a good one. He draws from a wide area of web expertize, but his passions run deep for <a href="http://www.search-this.com/category/css/">CSS</a>, XHTML, usability and standards compliant code.
</p>
<p>
One thing is for sure, with the Search-This team we have assembled, you won't find any crappy code here.
</p>
<p>
Enjoy Dan's bio below:
</p>
<p><strong>User Name:</strong> Dan Schulz</p>
<ul>
<li><strong>childhood ambition:</strong> to get out of the house</li>
<li><strong>fondest memory:</strong> meeting my best friend <img src='http://www.search-this.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li><strong>favorite music:</strong> whatever sounds good. Usually classical, rock, alternative-rock. I don't listen to rap. Record company executives took the "C" off of a certain word to make it marketable.</li>
<li><strong>retreat:</strong> nature</li>
<li><strong>proudest moment:</strong> two of them, getting out on my own, and becoming self-employed</li>
<li><strong>biggest challenge:</strong> staying self-employed</li>
<li><strong>alarm clock:</strong> I have a biological clock (and a 27-hour sleep schedule)</li>
<li><strong>perfect day:</strong> every day I wake up</li>
<li><strong>first job:</strong> bagger at the local Jewel-Osco</li>
<li><strong>indulgence:</strong> sports, reading, table-top warfare gaming, computer games, being with friends</li>
<li><strong>favorite movie:</strong> no favorite movie - there's too many I like</li>
<li><strong>inspiration:</strong> too many to list here</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.search-this.com/2007/01/31/introducing-dan-schulz-dan-schulz/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Tab Effect &#8211; My Favorite New Firefox Extension</title>
		<link>http://www.search-this.com/2007/01/16/tab-effect-my-favorite-new-firefox-extention/</link>
		<comments>http://www.search-this.com/2007/01/16/tab-effect-my-favorite-new-firefox-extention/#comments</comments>
		<pubDate>Tue, 16 Jan 2007 14:34:52 +0000</pubDate>
		<dc:creator>Golgotha</dc:creator>
				<category><![CDATA[Browsers]]></category>

		<guid isPermaLink="false">http://www.search-this.com/2007/01/16/tab-effect-my-favorite-new-firefox-extention/</guid>
		<description><![CDATA[At first this Firefox extension might just seem like eye candy. However, after surfing at home with it for the last few days and then surfing at work without it. You really start to get attached to it. Give it a try for at least a week and see if you don't become attached to [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.search-this.com/wp-content/themes/big-blue/images/tab_effect-2.jpg" alt="Tab Effect" align="left" style="padding-right:15px;"  /></p>
<p>At first this Firefox extension might just seem like eye candy. However, after surfing at home with it for the last few days and then surfing at work without it. You really start to get attached to it. Give it a try for at least a week and see if you don't become attached to it too.</p>
<p>Get it here: <a href="https://addons.mozilla.org/firefox/4258/">Tab Effect - Firefox Add-on</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.search-this.com/2007/01/16/tab-effect-my-favorite-new-firefox-extention/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
