×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
1
Language: CSS
Posted by: Philip Rehberger
Added: Sep 14, 2016 12:08 AM
Views: 1
Tags: no tags
  1. .bg {
  2.     width:200px;
  3.     height:100px;
  4.     background: url(/folder/yourimage.png) no-repeat;
  5.     _background:none;
  6.     _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/folder/yourimage.png',sizingMethod='crop');
  7. }
  8.  
  9.  
  10. /* 1px gif method */
  11. img, .png {
  12.     position: relative;
  13.     behavior: expression((this.runtimeStyle.behavior="none")&&(this.pngSet?this.pngSet=true:(this.nodeName == "IMG" && this.src.toLowerCase().indexOf('.png')>-1?(this.runtimeStyle.backgroundImage = "none",
  14.        this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "', sizingMethod='image')",
  15.        this.src = "images/transparent.gif"):(this.origBg = this.origBg? this.origBg :this.currentStyle.backgroundImage.toString().replace('url("','').replace('")',''),
  16.        this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.origBg + "', sizingMethod='crop')",
  17.        this.runtimeStyle.backgroundImage = "none")),this.pngSet=true));
  18. }