CSS fix for IE6 Double Margin Bug
When most web developers have nightmares, they usually consist of some scenario or other involving Internet Explorer. Even with the release of IE7, Microsoft still hasn’t produced a standards compliant browser, but hey, it’s a step in the right direction and for that we are truly grateful Mr Gates.
One of the more common bugs found in Internet Explorer is the dreaded ‘double-margin’, which IE6 (and earlier) would apply to a floated element. The problem will only occur when the margin and float are in the same direction. That is, a left margin is applied to a left floated element or a right margin is applied to a right floated element.
If for example a 10px left margin is applied to a left floated element, IE6 will double it to . . . yes you’ve guessed it, 20px.
Luckily, there is a simple solution to this problem (well it’s simple when you know how to do it). To ensure that IE6 displays the correct margin value just add - display: inline; to the CSS style of the floated element. Doing so will not change anything other than fix the IE6 bug because floated elements are always block level elements, and changing the display property to inline won’t change that.
Even though this won’t adversely affect other browsers it would be good practice to keep any IE specific fixes in a separate style sheet or put it in an IE only style using the handy * html hack which would appear like so:
*html #sidebar { display: inline; }
Source: Free Articles from ArticlesFactory.com
Related Tags: css, for, margin, fix, double, bug, ie6
Gary Owen is the Technical Director at Red e Creations, a Gold Coast Web Design company based in Queensland, Australia. Your Article Search Directory : Find in Articles
Recent articles in this category:
- How to Capitalize on Free Content From Podcasts
One of the major challenges for every website owner is generating compelling content that will - Looking for a Niche? 40 Keyword Suggestions
One of the most important steps foraffiliate marketing and Internet marketing is finding a go - 5 Benefits Of Having Your Own Home Business
There is no secret to why millions of people are flocking to the internet to start their own h - Optimized Articles Drive Traffic to Websites
Benefits of SEO ArticlesSEO Articles can help move websites up in the search engines and are o - Why You Should Be Using an Online Backup Service
Online BackupOnline backup services are relatively new but they are gaining popularity at the - FREEDOM1-PACKAGE.COM/ YOUR TOP MONEY ONLINE BUSINESSES Presents:
FREEDOM1-PACKAGE.COM/ YOUR TOP MONEY ONLINE BUSINESSES!Presents:Evaluating Your Website Traffi - 3 Bonuses To Success University's Already Stellar Program
It is not very often that you will come across a program to the likes of Success University. - Do You Like Being On Top? A Global Domains International Position.
If you like to be on top then you are just like millions of other web site owners trying to po - How to Optimize Your Website For Better Visitor Experience and More Traffic
This article describes in simple terms, practical and effective tactics used to optimize your - Internet Marketer's Dream: 8 Productivity Tips for Firefox Browser Users
Here are 8 productivity tips specifically for Mozilla Firefox users:1) SearchStatus. Set your
Most viewed articles in this category:
- The Webmaster's Assistant
There are many tools available to a webmaster to analyse website traffic allowing them to monitor th - Free Webmaster Resources
The overall importance of Quality Web Development or Web Design Tools is a factor among webmast - Web Analytics - Getting It Right
Understanding and using web analytics.In recent years, website marketers were concerned with increas - 6 Steps to a More Successful Website in 2006
Another year has passed and a new one has dawned. It's an exciting time to have an online business. - Webmaster Staff Leasing
Some of you might be wondering what webmaster staffing means? So just to make it clear for everyone - Easy Content Management with Server Side Includes (part 1)
I honestly see very few websites that can really say they don’t need some sort of Content Mana - 4 Nearly FREE Ways for a Web Designer to Establish a Local Presence
Everyone seems to be a web designer these days. From your uncle’s neighbor’s nephe - Want Your Website Visitors to Return?
If your like me you have searched on every search engine any possible way to advertise your website. - HTML Editors
If you're the typical non professional user then you are probably familiar with the more popular one - Reasons why you should have a Weblogger installed on your web site.
Radhika Venkata (c).I don't know about you, but when I built my first web site threeyears back I don