Having trouble with a background image not showing in IE8 on a button?

My submit button has the following CSS styling:

  .button{
    border:1px solid #015691;
    background-image:url('http://boundsblazer.com/pkg/pics/
         buttons/small-button.png');
    color:#ffffff;
    height:18px;
    font-size:8pt;
    font-family:sans-serif, verdana;
    cursor:pointer;
    line-height:14px;
    margin-bottom:-5px;
    border-bottom-color:#222222;

    -webkit-border-radius: 3px 3px 3px 3px;
    -moz-border-radius: 3px 3px 3px 3px;
    border-radius: 3px 3px 3px 3px;
    behavior: url("http://boundsblazer.com/pkg/plugins/PIE.htc");
  }

As for my JQuery...

$(".button").mousedown(function(){
    $(this).css('border-bottom-width', '0px');
    $(this).css('background-image', 'url(\'http://boundsblazer.com/pkg/pics/buttons/small-button-pressed.png\')');

    $(this).mouseout(function(){
          $(this).css('border-bottom-width', '1px');
          $(this).css('background-image', 'url(\'http://boundsblazer.com/pkg/pics/buttons/small-button.png\')');
    });
    $(this).mouseup(function(){
          $(this).css('border-bottom-width', '1px');
          $(this).css('background-image', 'url(\'http://boundsblazer.com/pkg/pics/buttons/small-button.png\')');
    });
});

In an unexpected turn of events, this setup works perfectly in IE7 and IE9, but encounters issues in IE8. Specifically, the button images fail to display. The functionality is flawless in Safari, Chrome, Firefox, Opera, IE7, and IE9, except for IE8. Feel free to visit http://boundsblazer.com to see the problem firsthand. Any assistance would be greatly appreciated!

Additionally, attempting a "border solution" has proven ineffective, despite already defining the border in the CSS.

Resolution:

The behavior attribute is not compatible with IE8, hence using PIE CSS3 for rounded borders in IE8 is unachievable. Removing:

background-image:url()

and replacing it with:

background:transparent url()

proved to be the workaround solution.

Answer №1

To make a simple adjustment, modify the following:

background-image:url('http://boundsblazer.com/pkg/pics/buttons/small-button.png');

Change it to:

background:transparent url('http://boundsblazer.com/pkg/pics/buttons/small-button.png');

Don't forget to update the jquery accordingly.

Open this in IE8

Al

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Having trouble with the CSS `not` selector?

Below is the code snippet I experimented with XHTML <div> <span>Span1</span> <span>Span12</span> <span>Span13</span> </div> <div> <span>Span1</span> <span> ...

Adding both days and months to the current date with JavaScript: A helpful guide

Existing script utilizing date.js library <script> var futureDate=Date.today().addMonths(3); </script> ...

Incorporate interactive click buttons into your Telegram bot

Currently working on a telegram bot using node.js with the telegram-bot API by yagop. https://github.com/yagop/node-telegram-bot-api My goal is to allow users to stop typing messages and instead just click on buttons that will trigger actions. When a user ...

Changing the name of a file using NPM

Is there a way to change the name of a specific file in npm scripts? I need to modify files for distribution, but they must have different names than the original... I attempted using orn, however it only works on the command line and not as an npm script ...

Issue with Angular 6 where data is not binding to the UI on initialization

I am struggling with binding dynamic data to the UI and Data tables on my website. Despite trying various methods, I have not been able to achieve success. Currently, I am using the smart admin latest theme for development. When I make a call to the API, ...

Automatically initiate a click event when the page is loaded

I'm having trouble getting a click event to trigger on my controller when the page loads. I really just want the checkboxes to be clicked automatically. <!DOCTYPE html> <html > <head> <link rel="stylesheet" type="text/css" ...

Encountering a 'ModuleNotFoundError' in Webpack due to a missing module import

The issue at hand Within my yarn monorepo project, there is a NextJS app and a configuration package shared with the server and a react-native application. In the configuration module, I export production keys for the production environment and developmen ...

Is Firefox preventing the running of asynchronous JavaScript code?

My experience with writing tests for my web application in the Selenium Framework has been smooth sailing with both Chrome and Edge. However, I've encountered a problem specifically with Firefox - the asynchronous script keeps timing out. I suspect i ...

When utilizing a Slick carousel with three slides and setting autoPlay to true, the slider-nav behaves as if there are five slides

I am currently using the Slick carousel plugin and I want to feature a display of 3 photos. The issue is that when I set slidesToShow=2, everything works perfectly fine, but when I try to set slidesToShow=3, which equals the total number of slides, the bot ...

Circle that is hollow and divided into segments based on percentage colors

I am currently working on creating a hollow graph circle where each division corresponds to a specific percentage. Issue: The three colors forming the circle should occupy a certain percentage of the circle. For example, if color 1 = 33%, color 2 = 33% an ...

The issue with CSS3 flex-wrap not functioning properly on Safari and Chrome in IOS 10.1.1

My goal is to create a dynamic grid layout using flex wrap and min-width: 50%, where each cell should occupy the entire width. However, I'm encountering an issue in iOS 10.1.1 (iPhone 5c) Safari and Chrome where the display is not grid-like but rather ...

How does CSS affect the size and performance of a website?

Examining the content of this css file (focusing on the last 5 lines specifically): #page section .s_1 { overflow:hidden; width:435px; float:left;} #page section .s_1 h1 { font-size:36pt; color:#001744; line-height:1.1; margin-bottom:64px;height:107px;} # ...

Is there a way to change the color of just the most recently clicked anchor element <a>?

I have a sidebar with anchor elements (Link 1,2,3 in my HTML). I want the text color of these anchors to change when clicked. Additionally, I need only one anchor element to be colored at a time, meaning the previous one should return to its normal color. ...

Stripe: The process of linking a debit card for receiving payouts

After extensive research on the stripe documentation for the past couple of days, I am still unable to find guidance on how to add a card to an "account" in stripe. Question: Is there a way to attach a debit-card for payouts to stripe.accounts.create? st ...

Update the color of buttons after being clicked - Bootstrap

If I want to change the class "btn-success" to "btn-warning" or update the color code to "#ffc107" upon a successful process, how can I achieve that? Button ; <button type="submit" name="teklifver" value="Teklif Ver" class="btn btn-block btn-success" ...

Tips for ensuring a checkbox is ticked before submitting in Bootstrap

I am in the process of creating a form using Bootstrap. I want to ensure that users can only submit the form once they have checked the checkbox.https://i.sstatic.net/piBRA.png <form> <div class="form-group"> <label for=&qu ...

JSON Serialization of numeric data types

It came to my attention that the website generates the same Base64 string for payloads containing numerical values written in different notations. An interesting example is the output for these two payloads: { "value": 0.000001 } { "val ...

What is the best way to send an array of numbers by utilizing e.target.value and React useState Hooks?

Trying to update the numbers array by passing it into submitNumbers() and using an onChange event. Issue arises when trying to use useState() to handle the array. When attempting to log these constants while the code is running, they are returning as not ...

Dealing with errors when making HTTP requests in AngularJS using the `then`

What is the best way to tackle an HTTP error like 500 when utilizing AngularJS "http get then" construct (promises)? $http.get(url).then( function(response) { console.log('get',response) } ) The issue here is that for any non-20 ...

What steps can I take to ensure that ajax/jquery requests complete before an html page is fully loaded?

$(function() { var $items = $('#items'); $.ajax({ type: "GET", url: 'some-other-url', data: {}, success: function(data) { $.each(data, function(index, element){ item_polygons.p ...