Thursday, May 26, 2011

CSS: overflow:visible Doesn't Always Work IE8 and maybe less than IE8

As most of you reading this know, browsers are pretty picky about how they display style sheets. I just found out, through trial and error, that there was a conflict with styles that was disrupting my layout.

I wanted to have an image within a div tag. The image was to extend beyond the div and be visible. (This was for AJAX reasons).

The encompassing div tag had a translucent background, shadow and curved corners.

This was working on FF4 and IE9. But IE8 cut off the image that extended beyond the div, even with "overflow:visible !important;"

The conflicting style was "filter:alpha(opacity=85);". So I had to remove that from the main CSS and put it in one of those stupid tags specifically for IE8 and less.

<!--
[if gt IE 8]>
<style>
.featured {filter:alpha(opacity=85) !important;}
</style>
<![endif]

[if !IE]>
<style>
.featured {filter:alpha(opacity=85) !important;}
</style>
<![endif]
-->


Why can't everybody play nice together? Isn't that what W3C is for?


1 comment:

  1. Hola!, soy de honduras.
    Tengo como 2 semanas de estar buscando información sobre este problema y no había podido encontrarla, hasta que dí con tu post!
    T lo agradezco me sirvio muchisimo. hice los mismo q tu y funciono de maravilla, quite las declaraciones: "FILTER" y listo!

    ReplyDelete