Microsoft Knowledge Base Email Alertz

(322240) - 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.

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

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

Article ID: 322240 - View products that this article applies to.
This article was previously published under Q322240

On This Page

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.

Properties

Article ID: 322240 - Last Review: September 22, 2011 - Revision: 5.0
APPLIES TO
  • Microsoft Internet Explorer 6.0, when used with:
    • Microsoft Windows XP Home Edition
    • Microsoft Windows XP Professional
    • Microsoft Windows XP Media Center Edition 2005 Update Rollup 2
    • Microsoft Windows XP Tablet PC Edition
Keywords: 
kbbug kbnofix KB322240
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Anonymous User Report As Irrelevant  
Written: 9/8/2008 7:10 AM
Still doesn't work in IE7 either!