Z-Index Not Working In Firefox
Even though I've been using Firefox a lot more than IE lately (especially with the speediness of Firefox 3.5), I finally made Firefox my default browser today to assist in doing more proper (i.e. standards-friendly) web development. Firefox is stricter when it comes to standards, whereas IE is more like the parent that lets you stay up past your bedtime or eat junk food after brushing your teeth -- it's lenient and more flexible -- but this isn't a good thing.
Anyway, my decision to make Firefox the default browser was justified today when I encountered an issue with z-indexes: certain elements were appearing underneath others, and even though I set the z-index of these elements, there was no change. Then I realized that it worked in IE -- because IE is lenient.
According to the CSS spec, z-index only applies to positioned elements (i.e. those whose position property has a value other than static). IE was lenient with this, but Firefox was not -- it was requiring the position property to be set. Once I did this, the elements displayed properly.
Even though IE made this easier, it's better to do it the right way like Firefox wants. This way, the code meets standards and will likely display correctly in more browsers.
Anyway, my decision to make Firefox the default browser was justified today when I encountered an issue with z-indexes: certain elements were appearing underneath others, and even though I set the z-index of these elements, there was no change. Then I realized that it worked in IE -- because IE is lenient.
According to the CSS spec, z-index only applies to positioned elements (i.e. those whose position property has a value other than static). IE was lenient with this, but Firefox was not -- it was requiring the position property to be set. Once I did this, the elements displayed properly.
Even though IE made this easier, it's better to do it the right way like Firefox wants. This way, the code meets standards and will likely display correctly in more browsers.
Comments
IE8 is a huge step in the right direction but I won't do anything but test against IE for the foreseeable future.
Post a Comment