<?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>Paul.Bagosy.Com &#187; CSS</title>
	<atom:link href="http://paul.bagosy.com/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://paul.bagosy.com</link>
	<description></description>
	<lastBuildDate>Sun, 25 Jul 2010 13:42:20 +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>New WordPress Widgets</title>
		<link>http://paul.bagosy.com/2010/07/25/new-wordpress-widgets/</link>
		<comments>http://paul.bagosy.com/2010/07/25/new-wordpress-widgets/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 13:42:20 +0000</pubDate>
		<dc:creator>Paul Bagosy</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Plugins]]></category>

		<guid isPermaLink="false">http://paul.bagosy.com/?p=894</guid>
		<description><![CDATA[Having been kicking around the exciting world of installing and customizing WordPress, I felt it was high time I launched myself into the even more exciting world of developing for WordPress.  And here&#8217;s what I&#8217;ve come up with: Recent User Posts Recent Category Posts Both of these are widgets that do basically the same thing, [...]]]></description>
			<content:encoded><![CDATA[<!-- wp-jquery-lightbox, a WordPress plugin by ulfben --> <p>Having been kicking around the exciting world of installing and customizing WordPress, I felt it was high time I launched myself into the even more exciting world of developing for WordPress.  And here&#8217;s what I&#8217;ve come up with:</p>
<p><a href="http://paul.bagosy.com/files/2010/07/recent-user-posts.1.0.zip" >Recent User Posts</a></p>
<p><a href="http://paul.bagosy.com/files/2010/07/recent-category-posts.1.0.zip" >Recent Category Posts</a></p>
<p>Both of these are widgets that do basically the same thing, so I&#8217;ll describe them together here.</p>
<p>In developing the new Wharton Magazine blog, we needed a widget to display the Editor&#8217;s most recent post.  I poked around for a bit, and realized that there really wasn&#8217;t a plugin to handle this, so the need for one was obvious.  After getting the basics down, I decided that it actually had more applications than just a single post, and started adding features.</p>
<p>So, the end result is two widgets.  Enter a title, select the user/category you want to display, enter the number of posts to display, and select if you want to display a link to the user/category and the time and date.  Not complicated to use and does just what it says it does.</p>
<p>Before I release it to the WordPress Plugins Codex, I&#8217;d like to see if anyone wants a shot at debugging or can offer any tips or suggestions.  Files are at the links above, and thanks in advance!</p>
<div id="crp_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://paul.bagosy.com/2010/07/25/new-wordpress-widgets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Content Swapping Portfolio</title>
		<link>http://paul.bagosy.com/2009/12/13/jquery-content-swapping-portfolio/</link>
		<comments>http://paul.bagosy.com/2009/12/13/jquery-content-swapping-portfolio/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 15:15:05 +0000</pubDate>
		<dc:creator>Paul Bagosy</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://paul.bagosy.com/?p=786</guid>
		<description><![CDATA[jQuery Swapping Portfolio Here&#8217;s a demo of everything I&#8217;m about to discuss. Recently, a number of clients have asked for an complex dynamic image-gallery-like page for a few different applications like portfolios and staff directories. The CMS I work with allows me to build a complex page for the client to load up with content, [...]]]></description>
			<content:encoded><![CDATA[<!-- wp-jquery-lightbox, a WordPress plugin by ulfben --> <p>jQuery Swapping Portfolio</p>
<p><a href="/jquery_portfolio/" target="_blank">Here&#8217;s a demo of everything I&#8217;m about to discuss.</a></p>
<div class="wp-caption aligncenter" style="width: 610px"><a href="http://paul.bagosy.com/jquery_portfolio/index.htm"  target="_blank"><img title="the musical stylings of Eerwyrm will revolt you." src="http://paul.bagosy.com/jquery_portfolio/images/main_thumbnail.jpg" alt="the musical stylings of Eerwyrm will revolt you." width="600" height="215" /></a><p class="wp-caption-text">the musical stylings of Eerwyrm will revolt you.</p></div>
<p>Recently, a number of clients have asked for an complex dynamic image-gallery-like page for a few different applications like portfolios and staff directories.  The CMS I work with allows me to build a complex page for the client to load up with content, but the front end is where all the magic happens.</p>
<p>The first of these sites featured an artistic design and required a portfolio for landscape projects, so I wanted to go with an elegant flowing effect. There are two primary element to this concept:  the navigation and the content.  The content itself can be further divided to images and text, both of which are important elements for this particular layout.</p>
<p>The navigation consits of two columns of thumbnails down the side (or wherever you need them &#8211; for this example they&#8217;re on the side).  They live in a div that&#8217;s floated to the right.  Here&#8217;s what that code looks like:</p>
<p>Each thumbnail is tied to a div which is given a different ID. (link_1, link_2, etc.).  In the script, we bind each of those IDs to a click event:</p>
<pre>	$('#link_1').bind('click', {id:'1'} ,clickHandler);
	$('#link_2').bind('click', {id:'2'} ,clickHandler);
	etc.</pre>
<p>When anything in that div is clicked, it fires the click event, aptly named clickHandler:</p>
<pre>	var clickHandler = function(link){
		$('.main').fadeOut().pause(250);
		$('#content').animate({"height": $('#main_' + link.data.id).height() + 20}, {duration: "slow"});
		$('#main_' + link.data.id).pause(250).fadeIn("slow");
	}</pre>
<p>Important safety tip: That pause() function is there to slow things down so fadeouts don&#8217;t cross:</p>
<pre>	$.fn.pause = function(duration) {
	    $(this).animate({ dummy: 1 }, duration);
	    return this;
	};</pre>
<p>Now, on the content side, it&#8217;s just a matter of stacking up DIVs with your content in them and giving each div a unique (and patterned with the same id structure as your thumbnail IDs) ID (main_1, main_2, etc.).  Granted, if you&#8217;ve got a lot of data, you&#8217;re probably better off with a system to import it via AJAX, but for this instance, we&#8217;re going to cover a smaller data set.</p>
<p>So, we&#8217;ve got our sidebar:</p>
<pre>&lt;div id="sidebar"&gt;
 &lt;div id="link_1"&gt;&lt;img src="images/thumb_1.jpg" alt="" /&gt;&lt;/div&gt;
 &lt;div id="link_2"&gt;&lt;img src="images/thumb_1.jpg" alt="" /&gt;&lt;/div&gt;
&lt;/div&gt;</pre>
<p>And we have our content:</p>
<pre> &lt;div id="content"&gt;
  &lt;div id="main_1" class="content_div"&gt;Content div 1&lt;/div&gt;
  &lt;div id="main_2" class="content_div"&gt;Content div 2&lt;/div&gt;
 &lt;/div&gt;</pre>
<p>Now we just need a little styling on the content divs to hide them:</p>
<pre> .content_div { display:none; }</pre>
<p>Then it&#8217;s just a matter of displaying your first div when the page loads:</p>
<pre>	$(window).load(function(){
		$('#content').animate({"height": $('#main_1').height() + 20}, {duration: "slow"});
		$('#main_1').pause(250).fadeIn("slow");
	});</pre>
<p>The $(window).load call is important.  You don&#8217;t want this to fire right on (document).ready if there are any images in your first div, because they will likely not be completely loaded and the code won&#8217;t know how big that div is going to be.</p>
<p>so, here&#8217;s the simple code:</p>
<pre>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
 &lt;head&gt;
  &lt;title&gt;&lt;/title&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
  &lt;style type="text/css"&gt;
   #sidebar { width:230px; float:left; }
   #sidebar div { float:left; margin-left:5px; }
   #content { width:500px; float:left; }
   .content_div { display:none; }
  &lt;/style&gt;
  &lt;script language="javascript" type="text/javascript" src="js/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script language="javascript" type="text/javascript"&gt;
   &lt;!--
    $(document).ready(function(){

     $.fn.pause = function(duration) {
      $(this).animate({ dummy: 1 }, duration);
      return this;
     };

     var clickHandler = function(link){
      $('.content_div').fadeOut().pause(250);
      $('#content').animate({"height": $('#main_' + link.data.id).height() + 20}, {duration: "slow"});
      $('#main_' + link.data.id).pause(250).fadeIn("slow");
     }

     $(window).load(function(){
      $('#content').animate({"height": $('#main_1').height() + 20}, {duration: "slow"});
      $('#main_1').pause(250).fadeIn("slow");
     });

     $('#link_1').bind('click', {id:'1'} ,clickHandler);
     $('#link_2').bind('click', {id:'2'} ,clickHandler);
    });
   --&gt;
  &lt;/script&gt;
 &lt;/head&gt;
 &lt;body id="top"&gt;
  &lt;div id="sidebar"&gt;
   &lt;div id="link_1"&gt;&lt;img src="images/thumbnail.jpg" alt="" /&gt;&lt;/div&gt;
   &lt;div id="link_2"&gt;&lt;img src="images/thumbnail.jpg" alt="" /&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div id="content"&gt;
   &lt;div id="main_1" class="content_div"&gt;Content div 1&lt;/div&gt;
   &lt;div id="main_2" class="content_div"&gt;Content div 2&lt;/div&gt;
  &lt;/div&gt;
 &lt;/body&gt;
&lt;/html&gt;</pre>
<div id="crp_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://paul.bagosy.com/2009/12/13/jquery-content-swapping-portfolio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vertically centering images in a DIV</title>
		<link>http://paul.bagosy.com/2009/12/13/vertically-centering-images-in-a/</link>
		<comments>http://paul.bagosy.com/2009/12/13/vertically-centering-images-in-a/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 15:05:51 +0000</pubDate>
		<dc:creator>Paul Bagosy</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://paul.bagosy.com/?p=756</guid>
		<description><![CDATA[Have you ever needed to vertically center and image in a div only to realize that it&#8217;s nowhere near as easy as it is in a table with vertical-align:middle? Horizontal centering is easy, but that damnable vertical is always just out of reach. Sure, there are ways to make it look centered, but that flies [...]]]></description>
			<content:encoded><![CDATA[<!-- wp-jquery-lightbox, a WordPress plugin by ulfben --> <p>Have you ever needed to vertically center and image in a div only to realize that it&#8217;s nowhere near as easy as it is in a table with vertical-align:middle?  Horizontal centering is easy, but that damnable vertical is always just out of reach.  Sure, there are ways to make it <em>look</em> centered, but that flies out the window when you&#8217;re talking about dynamic sizes.</p>
<p>The work-around I use for this problem is to head a different route.  I know I can&#8217;t center horizontally with a DIV, so I stop trying and learn to love the space.  I just use a blank .gif the same height as my div and then use the style tag right on the IMG to set the background to my image with a position of center center.  <em>Viola</em>, instant centered image!</p>
<pre>&lt;div style="height:200px; width:200px;"&gt;&lt;img src="images/blank.gif" style="background:url(images/thumbnail.jpg) center center no-repeat;" alt="" /&gt;&lt;/div&gt;</pre>
<div style="border: 1px solid #999999;height: 200px;width: 200px;margin:0px auto"><img src="/jquery_portfolio/images/blank.gif" alt="blank Vertically centering images in a DIV"  title="Vertically centering images in a DIV" /></div>
<div id="crp_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://paul.bagosy.com/2009/12/13/vertically-centering-images-in-a/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Streamlined graphical navigation</title>
		<link>http://paul.bagosy.com/2009/12/10/streamlined-graphical-navigation/</link>
		<comments>http://paul.bagosy.com/2009/12/10/streamlined-graphical-navigation/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 15:15:05 +0000</pubDate>
		<dc:creator>Paul Bagosy</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://paul.bagosy.com/?p=716</guid>
		<description><![CDATA[After covering the long and short of using CSS for mouseover graphical navigation, I was clued into a similar but vastly more efficient way of doing the same thing with less overhead. Why cut up all those images when we can just use one? Here&#8217;s what I&#8217;m talking about: Notice the second line of navigation [...]]]></description>
			<content:encoded><![CDATA[<!-- wp-jquery-lightbox, a WordPress plugin by ulfben --> <p>After covering the long and short of <a href="http://paul.bagosy.com/2009/04/horizontal-rollover-navigation-for-fun-and-profit/" >using CSS for mouseover graphical navigation</a>, I was clued into a similar but vastly more efficient way of doing the same thing with less overhead.  Why cut up all those images when we can <strong>just use one</strong>?</p>
<p>Here&#8217;s what I&#8217;m talking about:</p>
<div class="wp-caption alignnone" style="width: 610px"><img title="Look familiar?" src="http://paul.bagosy.com/wp-content/themes/paul.bagosy.com/images/header.jpg" alt="Look familiar?" width="600" /><p class="wp-caption-text">Look familiar?</p></div>
<p>Notice the second line of navigation there mirroring the first?  That&#8217;s all the mouseovers.  The trick is simply to position this image as we need it.</p>
<p>So, here&#8217;s the HTML:</p>
<pre>   &lt;div id="header"&gt;
    &lt;ul&gt;
     &lt;li id="nav_01"&gt;&lt;a href="http://paul.bagosy.com"&gt;Home&lt;/a&gt;&lt;/li&gt;
     &lt;li id="nav_02"&gt;&lt;a href="/about/"&gt;Home&lt;/a&gt;&lt;/li&gt;
     &lt;li id="nav_03"&gt;&lt;a href="/resume/"&gt;Resumé&lt;/a&gt;&lt;/li&gt;
     &lt;li id="nav_04"&gt;&lt;a href="/portfolio/"&gt;Portfolio&lt;/a&gt;&lt;/li&gt;
     &lt;li id="nav_05"&gt;&lt;a href="/contact/"&gt;Contact&lt;/a&gt;&lt;/li&gt;
     &lt;li id="nav_06"&gt;&lt;a href="/feed/"&gt;Subscribe to Feed&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
   &lt;/div&gt;</pre>
<p>Pretty much the same concept as before.</p>
<p>Now, we get into the CSS:</p>
<pre>#header                  { width:946px; height:172px; background:url(images/header.jpg) top center no-repeat; position:relative; }
  #header ul             { width:946px; height:172px; margin:0px; padding:0px; list-style:none; }
  #header ul li          { margin:0px; padding:0px; list-style:none; position:absolute; }
  #header ul li a        { text-indent:-9009px; display:block; width:100%; height:100%; }
  #header ul li a:hover  { background-image:url(images/header.jpg); background-repeat:no-repeat; }</pre>
<p>What&#8217;s important here is that we&#8217;re defining the background-image and background-repeat separately in the a:hover declaration, and they&#8217;re going to be the same for every link.  Granted, you probably don&#8217;t need the background-repeat, but it&#8217;s good to be thorough.</p>
<p>Now that we&#8217;ve defined the overarching styles, let&#8217;s do the individual links:</p>
<pre>  #nav_01          { width:103px; height:57px; left:45px; top:100px; }
  #nav_01 a:hover  { background-position:-45px -172px; }
  #nav_02          { width:113px; height:57px; left:148px; top:100px; }
  #nav_02 a:hover  { background-position:-148px -172px; }
  #nav_03          { width:122px; height:57px; left:261px; top:100px; }
  #nav_03 a:hover  { background-position:-261px -172px; }
  #nav_04          { width:154px; height:57px; left:383px; top:100px; }
  #nav_04 a:hover  { background-position:-383px -172px; }
  #nav_05          { width:136px; height:57px; left:537px; top:100px; }
  #nav_05 a:hover  { background-position:-537px -172px; }
  #nav_06          { width:227px; height:57px; left:673px; top:100px; }
  #nav_06 a:hover  { background-position:-673px -172px; }</pre>
<p>With each of the list items, we&#8217;re just telling them how big to be (width, height) and where to be (left, top).  We&#8217;ve already told the anchor tags to fill their space above, so we just need to worry about the hover.  Since we&#8217;ve already told them what image to use (the same as the header background), all we need to do is tell them where to put it.  We set the background-position to show the mouseover portion of the image by defining it in negative terms (x first, y second).</p>
<p>For this example, we&#8217;ve got an image that&#8217;s 229 pixels tall, 172 pixels of which will be visible as our header.  So, the y part starts at 172 pixels, which means we need to drag it -172 pixels up for each of our mouseovers.  Then, it&#8217;s as simple as grabbing our left positions for the list item and moving it that far to the left.</p>
<p>Bingo, instant mouseovers with one image.  Instead of seven server calls and the need to preload (header BG and six mouseover images), we&#8217;re doing one server call and as soon as the header shows, your mouseovers are already preloaded!</p>
<div id="crp_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://paul.bagosy.com/2009/12/10/streamlined-graphical-navigation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Go-Live: Indian Valley Dental</title>
		<link>http://paul.bagosy.com/2009/11/25/go-live-indian-valley-dental/</link>
		<comments>http://paul.bagosy.com/2009/11/25/go-live-indian-valley-dental/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 16:56:19 +0000</pubDate>
		<dc:creator>Paul Bagosy</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[FireFox]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://paul.bagosy.com/?p=651</guid>
		<description><![CDATA[I&#8217;ve decided to start cataloging the sites that I&#8217;ve done recently, big or small. So, here we go: Indian Valley Dental What the client wanted: This was a redesign of an existing CMS site that had a lot of Flash-based elements, including the navigation. What I delivered: The design kept the header flash from the [...]]]></description>
			<content:encoded><![CDATA[<!-- wp-jquery-lightbox, a WordPress plugin by ulfben --> <p>I&#8217;ve decided to start cataloging the sites that I&#8217;ve done recently, big or small. So, here we go:</p>
<p><strong><a href="http://www.indianvalleydental.com" >Indian Valley Dental</a></strong></p>
<p><strong> </strong></p>
<p style="text-align: center"><strong><strong></p>
<div id="attachment_656" class="wp-caption aligncenter" style="width: 610px"><strong><strong><img class="size-full wp-image-656" title="Indian Valley Dental" src="http://paul.bagosy.com/wp-content/uploads/2009/11/indianvalley1.jpg" alt="Indian Valley Dental" width="600" height="400" /></strong></strong><p class="wp-caption-text">Indian Valley Dental</p></div>
<p></strong></strong></p>
<p style="text-align: left"><strong><strong>What the client wanted:</strong></strong><br />
This was a redesign of an existing CMS site that had a lot of Flash-based elements, including the navigation.</p>
<p style="text-align: left"><strong>What I delivered:</strong><br />
The design kept the header flash from the old site, and I brought over the little Flash page title flourish.</p>
<p>I reworked the existing CMS to provide data is much more search-engine friendly and a lot more streamlined.  The header navigation uses a CSS hover effect with a jQuery dropdown.  The bottom navigation uses a quick server-side element to generate a style that underlines the page that you&#8217;re currently on, and the Contact Us page uses jQuery form validation and an AJAX spam-catcher.</p>
<p>The site is identical in IE 6, 7 and 8, Firefox 3, Chrome 3, Safari 4PB and Opera 10 (aside from a few form elements that resist styling).</p>
<p>Simple from the ground up, but that&#8217;s the way I like them.</p>
<div id="crp_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://paul.bagosy.com/2009/11/25/go-live-indian-valley-dental/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE6 &#8211; is there nothing it can’t make complicated?</title>
		<link>http://paul.bagosy.com/2009/11/11/ie6-is-there-nothing-it-can%e2%80%99t-make-complicated/</link>
		<comments>http://paul.bagosy.com/2009/11/11/ie6-is-there-nothing-it-can%e2%80%99t-make-complicated/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 15:43:22 +0000</pubDate>
		<dc:creator>Paul Bagosy</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://paul.bagosy.com/?p=566</guid>
		<description><![CDATA[Here&#8217;s some info on PNGs in IE6 that will hopefully save you from throwing yourself out a window sometime between now and 2014: We all know that PNGs are not natively supported in the browser that time (but not all of humanity) forgot, but PNGs are so wonderfully useful as to make them indispensable. What [...]]]></description>
			<content:encoded><![CDATA[<!-- wp-jquery-lightbox, a WordPress plugin by ulfben --> <p>Here&#8217;s some info on PNGs in IE6 that will hopefully save you from throwing yourself out a window sometime between now and 2014:</p>
<p>We all know that PNGs are not natively supported in the browser that time (but not all of humanity) forgot, but PNGs are <i>so wonderfully useful</i> as to make them indispensable. What to do?</p>
<p>Well, some brave soul made a <a href="http://www.twinhelix.com/css/iepngfix/"  target="_blank">fix for this very problem</a> that works very well once you have it set up correctly.  There are two very very important things to note (I&#8217;m sure there are more, but these are the two I&#8217;ve encountered):</p>
<p>1) <b>background-position:bottom</b> absolutely positively does not work with this.  If you&#8217;re trying to do a neat drop shadow effect over a textured background using an alpha-layered PNG, throw yourself out that window now (or just deal with the fact that IE6 isn&#8217;t going to support it).  Don&#8217;t waste hours agonizing over why it appears to load and then disappears, just know that you&#8217;re not going to fix it and move on to different ways to make your effect work.  I suggest getting as close a match possible with a GIF or scrapping it altogether in IE6.  Don&#8217;t agonize over making it perfect in IE6 if this is what you&#8217;re trying to accomplish, because people should be punished for using IE6 anyway.</p>
<p>2) <b>Google Maps uses its own PNG fixing</b> that is completely derailed by iepngfix.htc.  You&#8217;ll notice that your Google Map appears for a second and then disappears once the page has finished loading. So once you&#8217;ve got your style set up like so:</p>
<pre>
img, div, a, input  { behavior:url(/iepngfix.htc); }
</pre>
<p>it&#8217;s going to completely hose your Google Map.  How does one fix this, you ask?</p>
<pre>
#map img, #map div, #map a, #map input  { behavior:none !important; }
</pre>
<p>Of course!  But could it be that simple?</p>
<p>We&#8217;re talking IE6 here, so I think that answers itself.  You see, if you&#8217;re using the neat <a href="/2009/09/browser-checking-blood-on-the-information-superhighway/">browser checking</a> information I wrote about a while ago to put all that into a CSS file behind an IE include tag, you&#8217;re in for a nasty shock.  Apparently, this doesn&#8217;t work (at least it didn&#8217;t for me).  So, we need to revert to server-side checking:</p>
<pre>
&lt;?
	$useragent = $_SERVER["HTTP_USER_AGENT"];
	if(preg_match("|MSIE ([0-9].[0-9]{1,2})|", $useragent, $matched)){
		if($matched[1] &lt;= 6){;
?&gt;
  &lt;link rel="stylesheet" type="text/css" media="screen" href="/css/ie6.css" /&gt;
&lt;?
		}
	}
?&gt;
</pre>
<p>Of course, you could always use an iframe, but you&#8217;re better off just throwing yourself out a window at that point. I must also point out that if you&#8217;re using jQuery, you&#8217;re going to want to include this css file <i>after</i> your jQuery include.  Why?  IE6 &#8211; did you need a better answer?</p>
<p>It&#8217;s also worth noting that IE6 has a strange relationship with the !important tag.  It will normally accept it, say if you&#8217;ve got a structure like so:</p>
<pre>
.tag  { width:500px; height:500px; color:#FFF; }
#tag2 .tag { color:#000 !important; }
</pre>
<p>That&#8217;s useful for a ton of applications.  However, if you happen to put two declarations on one line:</p>
<pre>
.tag  { width:500px; height:500px;  color:#000 !important; color:#FFF; }
</pre>
<p>IE6 will ignore the !important tag in favor of the last declaration it finds.  So, in this case, it will revert to color:#FFF; whereas every other browser will assume you meant color:#000; (because, you know, you said <i>!important</i>).</p>
<p>This is a useful bug, though, and it can be used to your advantage.  Say you&#8217;re trying to add a min-height to a div.  We all know that min-height is new and IE6 screams at it and its friend max-height to get off its lawn, because height was good enough in IE6&#8242;s day and it doesn&#8217;t need newfangled tags.  So, we just use the !important tag to confuse it:</p>
<pre>
.tag { min-height: 250px; height: auto !important; height: 250px; }
</pre>
<p>This tells most browsers that your div needs to be at least 250 pixels tall, or however tall it needs to be beyond that.  It also tells IE6 to make the div 250 pixels tall &#8211; but IE6 is kind of sloppy, so if the content in that div takes up more than 250 pixels, IE6 will expand to compensate &#8211; but won&#8217;t go below 250 pixels.  This is coding Aikido &#8211; use your enemy against itself!</p>
<p>And I don&#8217;t think it&#8217;s unfair to call a nine-year-old browser that still enjoys a ridiculous market share despite its overwhelming flaws <b>the enemy</b>.</p>
<p>-pb</p>
<div id="crp_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://paul.bagosy.com/2009/11/11/ie6-is-there-nothing-it-can%e2%80%99t-make-complicated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Browser Checking: Blood on the Information Superhighway</title>
		<link>http://paul.bagosy.com/2009/09/28/browser-checking-blood-on-the-information-superhighway/</link>
		<comments>http://paul.bagosy.com/2009/09/28/browser-checking-blood-on-the-information-superhighway/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 13:04:06 +0000</pubDate>
		<dc:creator>Paul Bagosy</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[FireFox]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://paul.bagosy.com/?p=537</guid>
		<description><![CDATA[Yes, I know I don&#8217;t update here as often as I should, but hey, I do this, I just don&#8217;t frequently write about it. So, let&#8217;s say you&#8217;ve coded a beautiful site, and you&#8217;re really proud of it, and you check it in IE6 and it looks like someone wrapped the entire thing in marquee [...]]]></description>
			<content:encoded><![CDATA[<!-- wp-jquery-lightbox, a WordPress plugin by ulfben --> <p>Yes, I know I don&#8217;t update here as often as I should, but hey, I <em>do</em> this, I just don&#8217;t frequently <em>write</em> about it.</p>
<p>So, let&#8217;s say you&#8217;ve coded a beautiful site, and you&#8217;re really proud of it, and you check it in IE6 and it looks like someone wrapped the entire thing in marquee and blink tags and then had their dog recode it for you.  The natural inclination is to scream and toss your monitor out the window, and then hire Tom Clancy to write you into a Rainbow Six novel where you take out Microsoft Headquarters.  While that would be an exciting read, what&#8217;s really going to solve your problem is to simply write a new CSS file to compensate for IE6 not being a real browser and a large (but slowly shrinking) segment of the browsing population not understanding that.</p>
<p>So, here&#8217;s how you handle adding a new CSS file in the most painless way possible:</p>
<p>You&#8217;ll already have your css declaration, which should look like this:</p>
<pre>  &lt;link rel="stylesheet" type="text/css" media="screen" href="/css/style.css" /&gt;</pre>
<p>So, all you do is create your new CSS file, name it something like ie6.css, and throw that in there too.</p>
<pre>  &lt;link rel="stylesheet" type="text/css" media="screen" href="/css/ie6.css" /&gt;</pre>
<p>But you don&#8217;t want Firefox (or Opera, or Safari, or even IE7) to see this web-based atrocity, so we&#8217;ve got to tell them to just move along, nothing to see here, folks:</p>
<pre>  &lt;!--[if IE 6]&gt;&lt;link rel="stylesheet" type="text/css" media="screen" href="/css/style.css" /&gt;&lt;![endif]--&gt;</pre>
<p>That&#8217;s right, that&#8217;s all there is to it!  Now, only IE6 will see it that CSS file.</p>
<p>BUT WAIT THERE&#8217;S MORE!  This little trick is actually a bit more powerful.</p>
<p>You can wrap whole sections of code in this block:</p>
<pre>&lt;!--[if...]&gt;

...

&lt;[endif]--&gt;</pre>
<p>And, it&#8217;s not just for IE6.  You can check for any IE version or even a range of versions with this syntax:</p>
<p><strong>if IE 5.5</strong> Single version specific<br />
<strong>if gt IE 5.5</strong> all versions greater than the specified version<br />
<strong>if gte IE 6</strong> all version greater than or equal to the specified version<br />
<strong>if lt IE 7</strong> all versions lower than<br />
<strong>if lte IE 6</strong> all versions lower than or equal to the specified version</p>
<p>So, if your problem exists in IE6 <em>and</em> IE7, but not IE 8, you&#8217;d just add</p>
<pre>  &lt;!--[if lte IE 7]&gt;&lt;link rel="stylesheet" type="text/css" media="screen" href="/css/style.css" /&gt;&lt;![endif]--&gt;</pre>
<p>to capture anything equal to or lower than IE7.</p>
<p>Now, a quick note on crafting your CSS files.  In my IE .css files, I just take the line that&#8217;s not working in IE, copy it to my IE6 css, and beat it until it complies.  The problem with this method is that you&#8217;ve now got two lines crashing into each other, fighting a bloody struggle for dominance (and submission!).  How, you ask, do you get the desired line to be the one that works?  Give it an inflated sense of importance.</p>
<p>Say you&#8217;ve got this line:</p>
<pre> .page_content { background:#0CF; padding:10px 15px 10px 297px; }</pre>
<p>but IE6 doesn&#8217;t understand pixels (or turquose), so you need to change it to:</p>
<pre> .page_content { background:#FC0; padding:11px 16px 12px 15px; }</pre>
<p>the way to make sure that the line from your IE css is to add <strong>!important</strong> to the end of every statement, before the semicolon:</p>
<pre> .page_content { background:#FC0 !important; padding:11px 16px 12px 15px !important; }</pre>
<p>That will guarantee that those declarations are the ones that are recognized when there&#8217;s the possibility for confusion.</p>
<h3>It&#8217;s not enough!  I need more!  IE checking doesn&#8217;t seem to satisfy.</h3>
<p>Do you need more advanced browser checking?  Are you encountering a 1-pixel variance in Chrome?  Do you want to have your website make fun of backwards Safari users?  Well, simply checking for IE6 isn&#8217;t going to help you.  You need <em>more power (ah! ah! ah!)</em>:</p>
<pre>&lt;?
	if(preg_match("|Opera/([0-9].[0-9]{1,2})|", $useragent, $matched)){
		$browser_version = $matched[1];
		$browser = "Opera";
	}elseif(preg_match("|MSIE ([0-9].[0-9]{1,2})|", $useragent, $matched)){
		$browser_version = $matched[1];
		$browser = "IE";
	}elseif(preg_match("|Firefox/([0-9\.]+)|", $useragent, $matched)){
		$browser_version = $matched[1];
		$browser = "Firefox";
	}elseif(preg_match("|Chrome/([0-9\.]+)|", $useragent, $matched)){
		$browser_version = $matched[1];
		$browser = "Chrome";
	}elseif(preg_match("|Safari/([0-9\.]+)|", $useragent, $matched)){
		$browser_version = $matched[1];
		$browser = "Safari";
	}else{
		$browser_version = 0;
		$browser = "Other";
	}
?&gt;</pre>
<p>The output of this will get you down to the very version number, so if you&#8217;ve got some philosophical disagreement with anyone running Firefox 3.0.12, you can pick that version out specifically (but why?  <em>WHY?!</em>).</p>
<p>It&#8217;s a good idea to leave this whole code chunk intact an in order, because Opera can masquerade as IE if you&#8217;re just checking for IE, and Chrome will pretend it&#8217;s Safari if you&#8217;re just checking for Safari.</p>
<p>-pb</p>
<div id="crp_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://paul.bagosy.com/2009/09/28/browser-checking-blood-on-the-information-superhighway/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rollover Navigation for fun and profit.</title>
		<link>http://paul.bagosy.com/2009/04/21/horizontal-rollover-navigation-for-fun-and-profit/</link>
		<comments>http://paul.bagosy.com/2009/04/21/horizontal-rollover-navigation-for-fun-and-profit/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 14:54:37 +0000</pubDate>
		<dc:creator>Paul Bagosy</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Sites]]></category>

		<guid isPermaLink="false">http://paul.bagosy.com/?p=292</guid>
		<description><![CDATA[Gone are the days when a nicely-styled text link was sufficient for main navigation. Heck, designs are even sporting graphical sub navigation these days. While this is a pain in the proverbial backside for easy updating, it&#8217;s what life has given us. And when life gives us graphics and demands SEO compatibility and semantically correct [...]]]></description>
			<content:encoded><![CDATA[<!-- wp-jquery-lightbox, a WordPress plugin by ulfben --> <p>Gone are the days when a nicely-styled text link was sufficient for main navigation.  Heck, designs are even sporting graphical <em>sub navigation</em> these days. While this is a pain in the proverbial backside for easy updating, it&#8217;s what life has given us. And when life gives us graphics and demands SEO compatibility and semantically correct HTML, we make lemonade. And then we charge $125/cup.</p>
<p>So, how do we tackle this without all of that pesky JavaScript which is likely to break on any given browser (I&#8217;m glaring at you, IE6. And IE7. And IE8. And Firefox. And particularly Safari.) More to the point, how do we do this in a way that&#8217;s not just images and can actually be picked up by search engines? We say <strong>Screw the JavaScript</strong>! (I say that a lot.) The W3C has given us all the tools we need with HTML and CSS! We just need to find new and interesting ways to <span style="text-decoration: line-through">ab</span>use them.<span id="more-292"></span></p>
<p>The root of the issue here is that we have an image that we want to change when we mouse over it, AND we want text to show up for spiders. The Spider isn&#8217;t going to understand nav_contact.gif as well as it will understand Contact Doylestown Web Design, so we need to scrap the image tag altogether. We also need to put that text in there and not have it display. These two things are not quite intuitive, but hey, we&#8217;re left brain geniuses, are we not?</p>
<p>So, here&#8217;s our HTML construct:</p>
<blockquote>
<pre>  &lt;div id="navigation"&gt;
   &lt;ul&gt;
    &lt;li id="nav_01"&gt;&lt;a href="/item_1.htm" title="Top Item 1"&gt;Top Item 1&lt;/a&gt;&lt;/li&gt;
    &lt;li id="nav_02"&gt;&lt;a href="/item_2.htm" title="Top Item 2"&gt;Top Item 2&lt;/a&gt;&lt;/li&gt;
    &lt;li id="nav_03"&gt;&lt;a href="/item_3.htm" title="Top Item 3"&gt;Top Item 3&lt;/a&gt;&lt;/li&gt;
    &lt;li id="nav_04"&gt;&lt;a href="/item_4.htm" title="Top Item 4"&gt;Top Item 4&lt;/a&gt;&lt;/li&gt;
    &lt;li id="nav_05"&gt;&lt;a href="/item_5.htm" title="Top Item 5"&gt;Top Item 5&lt;/a&gt;&lt;/li&gt;
   &lt;/ul&gt;
  &lt;/div&gt;</pre>
</blockquote>
<p>What we have here is a container &lt;div&gt;, an unordered list, and list tags with links inside. Now, that&#8217;s not going to look very good if we leave it like that, so off to the CSS we go.</p>
<p>First, we need to set the stage with the width, height, and background:</p>
<blockquote>
<pre>#navigation {
	width:740px;
	height:30px;
	background:url(/images/navigation.jpg) top left no-repeat;
}</pre>
</blockquote>
<p>For that background image, you want to have your entire navigation as it looks normally. No need to cut up individual images for your default state!</p>
<p>Next, we need to whip that list into shape:</p>
<blockquote>
<pre>#navigation ul {
	width:740px;
	height:30px;
	margin:0px;
	padding:0px;
	list-style:none;
}</pre>
</blockquote>
<p>We make sure that the &lt;ul&gt; tag is the same exact dimensions as our containing div, and then strip all the margins, padding, and bullets from it. Viola, no more list! Just a happy semantic construct.</p>
<p>Now, we need to trim the &lt;li&gt; tags:</p>
<blockquote>
<pre>#navigation ul li {
	height:30px;
	margin:0px;
	padding:0px;
	list-style:none;
	float:left;
	display:block;
}</pre>
</blockquote>
<p>Define the height (because this is horizontal, and they&#8217;ll all be the same, right?), strip the margins, padding and bullets again, and finally, make it sit horizontally instead of vertically like it wants to. That&#8217;s what the float:left and display:block achieve.</p>
<p>Moving right along!  We need to get that pesky text out of there, don&#8217;t we?</p>
<blockquote>
<pre>#navigation ul li a {
	text-indent:-9009px;
	display:block;
	height:30px;
}</pre>
</blockquote>
<p>So, we take it and shoot it 9009 pixels to the left. Unless someone&#8217;s on a 10,280 x 7,680 screen, that&#8217;s text is not showing up. But they&#8217;ll have other problems, too. Anyway, an important thing to note is that you cannot use &lt;br /&gt; tags inside those links or everything after it will still show up. text-indent only affects the first line.</p>
<p>Now, we are almost done. We just need to tackle the individual cells (hence the unique IDs on the &lt;li&gt; tags). Every &lt;li&gt; tag is going to have two lines in the CSS: one for the tag, and one for the link inside it.</p>
<blockquote>
<pre>#nav_01 {
	width:148px;
}
#nav_01 a:hover {
	width:148px;
	background:url(/images/nav_01.jpg) no-repeat 0px 0px;
}</pre>
</blockquote>
<p>In the first line, we declare the width of the &lt;li&gt; tag. We&#8217;ve already defined the heights before. This ensures that we&#8217;re filling the space of the &lt;ul&gt; tag. In the second line, we make sure that the link is constraining to the same width, and we set the hover property to change the background image. This is the big payoff here. When the user mouses over, instead of doing some fancy JavaScript image swap, we&#8217;re using the native CSS functionality to simply change the background to what we need. When they mouse out, the hover expires. Easy as changing the color.</p>
<p>So that&#8217;s it for horizontal navigation. Easy, right? But wait! you say. What about dropdowns? Dropdowns require an ID tag, which we&#8217;ve already defined. But what if you&#8217;ve got a nav parent that has no page? What if nav_02 doesn&#8217;t go anywhere? Well, that&#8217;s easy. Let&#8217;s change the construct a bit:</p>
<blockquote>
<pre>  &lt;div id="navigation"&gt;
   &lt;ul&gt;
    &lt;li id="nav_01"&gt;&lt;a href="/item_1.htm" title="Top Item 1"&gt;Top Item 1&lt;/a&gt;&lt;/li&gt;
    &lt;li id="nav_02"&gt;&lt;a href="/item_2.htm" title="Top Item 2"&gt;Top Item 2&lt;/a&gt;&lt;/li&gt;
    &lt;li id="nav_03"&gt;&lt;a href="" title="Top Item 3" onclick="return false;"&gt;Top Item 3&lt;/a&gt;&lt;/li&gt;
    &lt;li id="nav_04"&gt;&lt;a href="/item_4.htm" title="Top Item 4"&gt;Top Item 4&lt;/a&gt;&lt;/li&gt;
    &lt;li id="nav_05"&gt;&lt;a href="/item_5.htm" title="Top Item 5"&gt;Top Item 5&lt;/a&gt;&lt;/li&gt;
   &lt;/ul&gt;
  &lt;/div&gt;</pre>
</blockquote>
<p>See nav_03? We take out the URL altogether and add an onclick event. Return false; tells the browser that when the link is clicked, just don&#8217;t do anything at all. Effectively makes it a non-link. Then, we change the CSS slightly.</p>
<blockquote>
<pre>#nav_03 {
	width:148px;
}
#nav_03 a {
	cursor:default;
}</pre>
</blockquote>
<p>This tells the link to keep the same happy pointer you get for any other element that&#8217;s not a hyperlink. So now your link not only doesn&#8217;t act like a link, it doesn&#8217;t look like a link. But you keep all of your functionality (and the dropdown beneath it).</p>
<p>-pb</p>
<div id="crp_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://paul.bagosy.com/2009/04/21/horizontal-rollover-navigation-for-fun-and-profit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Firefox 2.0 Madness with floats</title>
		<link>http://paul.bagosy.com/2008/10/28/firefox-20-madness-with-floats/</link>
		<comments>http://paul.bagosy.com/2008/10/28/firefox-20-madness-with-floats/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 15:51:13 +0000</pubDate>
		<dc:creator>Paul Bagosy</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[FireFox]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Web Sites]]></category>

		<guid isPermaLink="false">http://paul.bagosy.com/?p=226</guid>
		<description><![CDATA[After bashing my head against a wall for a while trying to figure out why one page in a site was dropping my floated sidebar div to the bottom of the page, I came across this: http://www.davidbisset.com/2007/12/20/drop-down-list-breaks-float-layout-in-firefox/ Say you have two divs &#8211; both have floats so that they can end up being two columns [...]]]></description>
			<content:encoded><![CDATA[<!-- wp-jquery-lightbox, a WordPress plugin by ulfben --> <p>After bashing my head against a wall for a while trying to figure out why one page in a site was dropping my floated sidebar div to the bottom of the page, I came across this:</p>
<p>http://www.davidbisset.com/2007/12/20/drop-down-list-breaks-float-layout-in-firefox/</p>
<blockquote><p>Say you have two divs &#8211; both have floats so that they can end up being two columns on your site. But sometimes when you add a dropdown menu (&lt;select&gt; tag) to one div) it will break the layout… usually meaning that the other div will be pushed down. And this usually happens only in Firefox. IE sees it just fine.</p></blockquote>
<p>The solution to this?  Instead of the nice linear coding that you&#8217;re used to where the sidebar, to the right of the main area, comes <em>after </em>the main area code, it needs to be <em>before </em>the main area code.</p>
<p>Because apparently, in FireFox 2 seems to have a problem with floated divs, option tags, and SIMPLE COMMON SENSE.</p>
<div id="crp_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://paul.bagosy.com/2008/10/28/firefox-20-madness-with-floats/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
