<?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>JasonCypret.com &#187; CSS browser bugs</title>
	<atom:link href="http://jasoncypret.com/tag/css-browser-bugs/feed/" rel="self" type="application/rss+xml" />
	<link>http://jasoncypret.com</link>
	<description>I am a designer, developer, photographer, and filmmaker based in Dallas, Texas. I create clean websites that get noticed!</description>
	<lastBuildDate>Mon, 06 Feb 2012 03:30:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>My CSS Techniques for working with browser bugs</title>
		<link>http://jasoncypret.com/my-css-techniques-for-working-with-browser-bugs/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=my-css-techniques-for-working-with-browser-bugs</link>
		<comments>http://jasoncypret.com/my-css-techniques-for-working-with-browser-bugs/#comments</comments>
		<pubDate>Fri, 09 May 2008 16:12:55 +0000</pubDate>
		<dc:creator>Jason Cypret</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS browser bugs]]></category>
		<category><![CDATA[ie6]]></category>

		<guid isPermaLink="false">http://jasoncypret.com/?p=228</guid>
		<description><![CDATA[<p>Posted in <a href="http://jasoncypret.com/category/web-design/" title="Web Design">Web Design</a></p><p>I have been wanting to write a post for some time now over CSS. I started to think about what I could write about that has not already been said. I mean there is already so much documentation, tutorials, and beautiful examples already. What more could I bring? So I will take this in another  ... <a href="http://jasoncypret.com/my-css-techniques-for-working-with-browser-bugs/">Read more</a>]]></description>
			<content:encoded><![CDATA[<p>Posted in <a href="http://jasoncypret.com/category/web-design/" title="Web Design">Web Design</a></p><p><img width="586px" src="http://jasoncypret.com/wp-content/uploads/2008/05/css.gif" alt="" title="css" />I have been wanting to write a post for some time now over CSS. I started to think about what I could write about that has not already been said. I mean there is already so much documentation, tutorials, and beautiful examples already. What more could I bring? So I will take this in another direction, and let you know what have been some of the struggles I have faced with CSS and how I was able to work around them.</p>
<p>First off let me say I am not a CSS guru. I work creating CSS sites on a daily basis, however I will be the first to admit that I do not know 1/5th of everything that can an can&#8217;t be done through CSS. With that begin said if you see an easier or better method, then post a comment below or email me. I will do my best to include and update on this post.</p>
<h3>PNG Image Transparency &#8211; Cross Browser Problem</h3>
<p><img style="float:right; margin-left:10px;" src="http://jasoncypret.com/wp-content/uploads/2008/05/pngproblem.jpg" alt="pngproblem" />Having PNG images in CSS designers arsenal very beneficial as it can cut down on the amount of images used as well and some of the code that its use. PNG images can also open up design possibilities that you never knew were possible. See example below.</p>
<p><a class="link-block" href="http://www.levelopacity.com/">http://www.levelopacity.com/</a><br />
Check out the use of the PNG image in the footer.</p>
<p><a class="link-block" href="http://www.alexbuga.com/">http://www.alexbuga.com/</a><br />
Alex uses transparency throughout his page.</p>
<p><a class="link-block" href="http://silverbackapp.com/">http://silverbackapp.com/</a><br />
When you resize your browser the PNG background images give a sense of depth of field.</p>
<p>PNG&#8217;s are awesome, however, if you are designing your sites to work correctly in IE6 (as you should be) then you know that PNG&#8217;s don&#8217;t work correctly. There are several ways of getting your PNG images to work in IE, however depending where and how you want to display your images will depend on what fix you will put in place.</p>
<p>If you have an image much like my logo in which uses an image tag, then you can go with the AlphaImageLoader fix. Target IE using *html. It is best to include you IE <span style="text-decoration: line-through;">hacks</span> fixes in a separate style sheet. Be aware, if you decide to use this method on repeating backgrounds, it will make any text un-selectable and any links un-clickable in the target element.</p>
<p><code>* html img#swoop {<br />
	background: none;<br />
	filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='navCorner.png', sizingMethod='scale');</code></p>
<p>The next methods are great for deploying fixes site-wide if you have lots of PNG&#8217;s. First Twin Helix iepngfix.htc. This one is considered a hack, and will un-validate your css. However it works great and if you place it in a second stylesheet for IT your valid code will not be affected. There are some limitations though. For 100% dependability, your elements should not have any auto-widths or heights. Sometimes you’ll get flickering. It’ll display the broken png for a second before the script kicks in. Can’t be used on repeating background images. You can get the script here: <a href="http://www.twinhelix.com/css/iepngfix/">http://www.twinhelix.com</a></p>
<p><code>img{<br />
	behavior: url(iepngfix.htc);<br />
}<br />
/* or you can target specific elements and their backgrounds /*</p>
<p>#header{<br />
	width: 800px;<br />
	height: 200px;<br />
	background: url(path/to/image.png);<br />
	behavior: url(iepngfix.htc);<br />
}</code></p>
<p>The last is a Jquery method. With the jquery.ifixpng plugin you can replace all the images on the page or you can target certain elements on the page. For this fix you will need a blank or one pixel gif, Jquery and of course the ifixpng plugin. This fix also has its limitations. Always defaults to &#8220;background-position:top left&#8221; and you cannot reposition it. Also doesn’t work on repeated backgrounds.</p>
<p>   <code> Example - applying filters to .png for correct ie6 display</p>
<p>    $(document).ready(function() {<br />
    	// apply to all images<br />
    	$(’img[@src$=.png]’).ifixpng(); </p>
<p>    	// apply to target elements<br />
    	$(’img[@src$=.png], div#header’).ifixpng();<br />
    });</code></p>
<p>If you still have questions, here is a <a href="http://www.dedestruct.com/2008/01/13/cross-browser-transparency-with-png/">good resource</a> to start with.</p>
<h3>min-width Property and IE</h3>
<p>Always something with IE, huh? Say you wanted to have your page be scalable, but once the user rescaled the page to a certain width, the page would stop scaling. This property s called min-width and is used by most of the current browsers today. Again, min-width wont work in IE6. Thanks again Microsoft. You can make it work by using an IE Dynamic Expression to set the width. </p>
<p><code>div.something {<br />
width: 100%;<br />
min-width: 900px;</p>
<p>/* IE Dynamic Expression to set the width */<br />
width: expression(document.body.clientWidth < 910 ? "900px" : "100%" );<br />
}</code></p>
<h3>IE6 Double Margin Bug &#038; Clearing Floats</h3>
<p><a href='http://jasoncypret.com/wp-content/uploads/2008/05/float-problem.jpg'><img style="float:right; margin-left:10px;" src="http://jasoncypret.com/wp-content/uploads/2008/05/float-problem-300x232.jpg" alt="" title="float-problem" width="300" height="232" /></a>First lets get the easy one out of the way. If you have a floated element such as a div and you place margin-right or margin-left on that element, our most beloved IE6 will double that margin value. To fix this simply add display:inline; to your floating element. Thanks <a href="http://www.jaymeblackmon.com/ie6-double-margin-bug-fix">Jamye</a></p>
<p>Clearing floats is a whole other issue in itself. There are some many do's and don't of clearing floats. I remember when I used to clear floats by adding an empty div and add a clear element to it. Don't try that by they way. Most of the time the problem with a float is the containing div. The containing div does not cover the floated element, thus resulting in pages that look so jacked up you want to go back to table design (j/k). When ever you float an element add an overflow:hidden property to it. Suddenly that div is now seeing the floating div. Also adding a hard width and height can fix this as well, but who works in absolutes (pun intended).</p>
<p>I know some people who just stay away from floats because they can't get them to work. If you uses this simple method you will get your floats to work like you want them. After you have implemented both of these methods you will have some code kinda like this:</p>
<p><code>div.right-well-container {<br />
overflow:hidden;<br />
}</p>
<p>div.right-well {<br />
margin: 10px 4px 0px 4px;<br />
float: left;<br />
display: inline;<br />
}</code></p>
<h3>Background Images on Empty Elements</h3>
<p><a href='http://jasoncypret.com/wp-content/uploads/2008/05/broken-font-size.gif'><img style="float:right; margin-left:10px;" src="http://jasoncypret.com/wp-content/uploads/2008/05/broken-font-size-300x177.gif" alt="" title="broken-font-size" width="300" height="177"/></a>From time to time I will be in the need to add a extra element or rounded corners on to existing code. Sometimes it is just easier to add an empty div to accommodate this change rather than recoding the bulk of your already finished code. However you may run into another IE6 bug that will add margin around the element. After multiple tests to see what is exactly causing the problem I found that it was the font size. My workaround has been to change the font size to 1px. This seems to get rid of the problem. I am sure there is a better explanation for what is going on, but I don't have it. Feel free to comment below.</p>
<p><code>div#profile-top {<br />
	font-size: 1px;<br />
	height: 3px;<br />
	background: url(details_top.gif) no-repeat;<br />
}</code></p>
<div style="overflow:hidden;">
<h3>Ordered List Background Mystery</h3>
<p><a href='http://jasoncypret.com/wp-content/uploads/2008/05/broken-ol.gif'><img style="float:right; margin-left:10px;" src="http://jasoncypret.com/wp-content/uploads/2008/05/broken-ol-219x300.gif" alt="" title="broken-ol" width="219" height="300" class="alignnone size-medium wp-image-234" /></a>This last one is a mystery. I was not able to solve this one, and I was also under a time crunch so I restyled it without using ordered lists. However I would still like to figure out what the problem was and what could be done to solve it.</p>
<p>Basically this is an IE6 &#038; 7 problem. When you have a background image on a numbered list, the list does not recognize the padding as well as fails to actually number in order. You know how CSS designers love styling lists, and I really wonder what the problem is, and if there is an easy way to fix it. If you know comment or email me.</p>
<p><a href="http://jasoncypret.com/wp-content/uploads/2008/05/browser-issue.zip">Download Sample Files</a></div>
<h3>CSS links for beginners and experts</h3>
<p>if you are getting into CSS it can be dawning at first, however once it clicks with you,you'll have no problem tackling the hardest projects. I found out that the best program for a beginner to learn on is <a href="http://macrabbit.com/cssedit/">CSSEdit</a>. While it is not a program for beginners, it helps you understand code and view items that cane be styled. Everybody has his or her own method to try to solve things and we all have our favorite tools. CSSEdit's Preview feature in combination with the XRay can allow you to pull any site and look at the CSS and see how they set it up. When you are in XRay mode you simply select an element, and you'll see its margins and padding (if any) and the space this element takes. At the top of the Preview page you see the all the parent elements with classes and id naming etc. Very kool stuff. Below are some links for you to get started.</p>
<p><a href="http://veerle.duoh.com/blog/comments/starting_with_css_and_bug_fixing_tips/">http://veerle.duoh.com</a><br />
She knows her CSS and has tons of links to CSS tutorials, examples, and more.</p>
<p><a href="http://www.blog.spoongraphics.co.uk/freebies/five-free-css-sliding-door-tab-menus">http://www.blog.spoongraphics.co.uk</a><br />
A great site for anything design related. Here is a free CSS menu for you to dissect and understand.</p>
<p>For those experts out there check out the links below. See what other creative people like your self are doing with CSS.</p>
<p><a href="http://www.noupe.com/css/using-css-to-do-anything-50-creative-examples-and-tutorials.html">50 Creative CSS Examples</a></p>
<p><a href="http://www.cssartillery.com/">http://www.cssartillery.com/</a><br />
Is becoming one of my favorite CSS gallery sites</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

