The key is:
Background: transparent URL ("../images/logo.png"); no-repeat top ;! Important;
Background-repeat: No-Repeat;
_ Background: none;
_ Filter: progid: DXImageTransform. Microsoft. alphaimageloader (src = './images/logo.png', sizingmethod = 'Scale ');
Note:
In IE6, you can easily use the src attribute of IMG to preview local images. However, in IE7, this method does not work. RequiredAlphaimageloader.
Note:
Within the boundary of the object container, an image is displayed between the background and content of the object. You can also cut and change the size of the image. If the file is loaded in PNG (Portable Network Graphics) format, the transparency between 0% and 100% is also provided.
Syntax:
Filter: progid: DXImageTransform. Microsoft. alphaimageloader (Enabled = benabled, sizingmethod = ssize, src = Surl)
Enabled:Optional. Boolean ). Set or retrieve whether the filter is activated.
True: default value. Filter activation.
False: the filter is disabled.
Sizingmethod:Optional. String ). Sets or retrieves the display mode of the image of the object to which the filter applies within the boundary of the object container.
Crop: Cut the image to fit the object size.
Image: default value. Increase or decrease the size boundary of an object to fit the image size.
Scale: scale the image to adapt to the size boundary of the object.
SRC:Required. String ). Specify the background image using an absolute or relative URL. If this parameter is ignored, the filter will not work.
Note: The image path of IE./images Firefox is ../Images
Example:
<HTML>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> untitled document </title>
<Style>
Body {
Margin: 0px;
Font-family: Arial, sans-serif;
Font-size: 100%;
Background: URL (http://shared.youdao.com/images/skins/movie/hzz/preview.jpg)
}
. LOGO {
Clear: both;
Margin-top: 18px;
Background: transparent URL (http://shared.youdao.com/images/logos/youdao-logo-s.png) No-repeat top;
* Margin-left:-5px;
_ Background: none;
_ Filter: progid: DXImageTransform. Microsoft. alphaimageloader (src = 'HTTP: // shared.youdao.com/images/logos/youdao-logo-s.png', sizingmethod='scale ');
Height: 139px;
Width: 362px;
}
</Style>
</Head>
<Body>
<Div class = logo> </div>
</Body>
</Html>