BUG: WinXP: DHTML CSS Background-Image Property Does Not Work with BUTTON Elements (322240)



The information in this article applies to:

  • Microsoft Internet Explorer version 6 for Windows XP

This article was previously published under Q322240

SYMPTOMS

The DHTML cascading style sheet (CSS) background-image property does not work with BUTTON elements in Microsoft Windows XP when the Windows display is set to use Windows XP style.

RESOLUTION

Use one of the following methods to resolve this problem:
  • Change the Windows style from XP to Classic:
    1. Click Start, click Control Panel, and then double-click Display.
    2. In the Display Properties dialog box, click the Appearance tab.
    3. For Windows and buttons, click to select Windows Classic style.
  • Internet Explorer 6.0 uses the new Windows XP themes to render its controls. Add a meta tag to disable themes on the page:
    <meta http-equiv="msthemecompatible" content="no">
    					
  • Use the background property instead of the background-image property:
    <button style="background='url(image.gif)';">show background image</button>
    					

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Create a new HTML file, and then paste the following code in the file:
    <HTML> 
    <HEAD> 
    <TITLE></TITLE> 
    </HEAD> 
    <BODY> 
    <button style="background-Image='url(image.gif)';">show background image</button><br><br> 
    </BODY> 
    </HTML>
    					
  2. Save the HTML page and make that sure a .gif file named Image.gif exists in the same directory as the HTML page.
  3. Make sure that Windows XP style is selected:
    1. Click Start, click Control Panel, and then double-click Display.
    2. In the Display Properties dialog box, click the Appearance tab.
    3. For Windows and buttons, click to select Windows XP style.
  4. Open the HTML page.

Modification Type:MajorLast Reviewed:11/5/2003
Keywords:kbbug kbnofix KB322240