Mobile Friendly Website

CSSPLAY

Doing it with style

OPACITYIE6 AlphaImageLoader with links error

14th March 2008

For all browsers

The problem...

IE6 does not recognise the links when placed over an absolute positioned background .png image.



The solution...

Use an outer 'positioner' div for the absolute positioning, give the ul no positioning, and finally give the links a relative position.





Information

This is a very old demo that is kept on site for those starting out with CSS.

Whilst working on a menu for a client I had need to use a background image in an absolute positioned <ul> in .png format which required the use of Microsoft's AlphaImageLoader filter to render this correctly. Unfortunately this screwed up the list of links that were contained within the <ul> and made then unselectable.

After much trial and error I found that the only way to get this to function correctly was to have the containing <ul> with no positioning and the links with relative positioning, and the easiest way to do this was to have an extra container to hold the <ul> which was absolutely positoned thus removing the need to have an absolutely positioned <ul>.

If you are viewing in IE6 you can see the problem in the first image above where the links are not selectable and do not have a :hover state.

The second image has been restyled with an extra containing div and now the links have a :hover state and are slectable.

The special css for IE6 has been placed in its own stylesheet within conditional comments to hide it from other browsers and also the w3.org validator.


Support CSSPLAY

Your donations keep CSS PLAY running.
If your donation is for the use of a demo then please email me with the demo url after making your donation.


CUSTOM SEARCH

Facebook Twitter rss feed Facebook Fan Page