IE6 Only CSS. Also make IE6 use PNG backgrounds


/ Published in: CSS
Save to your folder(s)

Since there are still many people using IE6, we have to cater for them :-(
Anyway, this CSS statement shows a declaration for a PNG Logo. Most browsers will understand the first 5 lines. Sadly, IE6 will not be able to use the transparent PNG from line 4 and we override the background declaration by using the "_" at the beginning of line 7 (all other browsers ignore the "_"). Then we use the MS filter in lie 8 to insert the PNG image.


Copy this code and paste it in your HTML
  1. #Logo{
  2. Width: 100px;
  3. Height: 100px;
  4. Background-Image: URL("Logo.png");
  5. Background-Repeat: No-Repeat;
  6. /*---IE6 Only--*/
  7. _Background-Image: URL("");
  8. Filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='Logo.png', sizingMethod='scale');
  9. /*-/-IE6 Only--*/
  10. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.