Switch image upon hover within a sprite

I have a sprite that I utilize for displaying various images. Currently, my aim is to change the sprite image upon hovering using solely CSS.

.sprE {
background-color: transparent;
background-image: url(/i/fW.png);
background-repeat: no-repeat;
height: 30px;
width: 30px
}
.sprE:hover {
background-image: url(/i/fC.png);
cursor: pointer
}
.comply {
background-position: 0 0
}

<span class="sprE comply"></span>

The code works perfectly fine on FireFox but unfortunately, it doesn't function properly on Internet Explorer. While I know I could potentially resolve this issue by utilizing jQuery, I would like to explore all the possible CSS solutions first.

Answer №1

Absolutely, the issue stemmed from the DOCTYPE declaration. Upon switching it to strict mode, the problem was immediately resolved.

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

What causes AJAX to disrupt plugins?

I am facing a challenge with my webpage that utilizes AJAX calls to load content dynamically. Unfortunately, some plugins are encountering issues when loaded asynchronously through AJAX. I have attempted to reload the JavaScript files associated with the ...

Employing jQuery for adding a class to the initial TD in every table row

Currently, I am dealing with a table structured like this: <table width="100%" border="0" cellspacing="0" cellpadding="0" id="tablecontent"> <tr class="tablerow"> <td>This is the td I want to add a class to.</td> <td c ...

Printing Strings in JavaScript IF Conditional Block

Hello there! I am looking for assistance with a JavaScript concept. Recently, I created some code where in the HTML file, there is a div element with an id of "GetID" where the string outputs are meant to be displayed. The JavaScript code looks something ...

Unable to choose an input form within a CSS div

Just installed a jQuery responsive menu tab but encountering issues with selecting forms to input values. It seems like a CSS problem that I cannot identify. Please assist me in resolving this issue. Below is the HTML code snippet: <div class="contai ...

Transforming JSP style tags into CSS declarations

Within my JSP file, I have various tags that look like this: <style type="text/css"> #mask { display: none; cursor: wait; z-index: 99999; position: absolute; top: 0; left: 0; height: 100%; ...

The steps to triggering a button click after e.preventDefault()

When attempting to prevent a click() event of a button by using preventDefault() after unbinding the button with unbind(), I encountered an issue where it did not work as expected. <script> $("#update2FAButton").on("click",function(e){ e.pre ...

display the designated image as a priority

I am designing a loading screen for my website that includes the loading of multiple images, scripts, and other elements. While the HTML and CSS part is working well, I need to ensure that the "loading..." image is loaded before anything else on the page. ...

Ways to prevent the jQuery simple slider from transitioning slides while it is in an invisible state

There is a jQuery slider on my website that behaves strangely when I navigate away from the Chrome browser and return later. It seems to speed through all pending slides quickly when it was not visible. Now, I want the slider to pause when it becomes invi ...

Is there a way to retrieve JSON data for a specific category of an item?

I have some data that includes categories and items stored in JavaScript arrays: var category = [ {id:0, name : "category_1"} , {id:2, name : "category_2"}, ]; var items = [ {id:0, name : "a", category_id : 0} , {id:1, name : "b", categ ...

unable to modify the content within a div by clicking on a link

Lately, I've been experimenting with a code snippet I found on this fiddle: http://jsfiddle.net/unbornink/LUKGt/. The goal is to change the content of a div when clicking on links to see if it will work on my website. However, no matter which link I c ...

Using Ajax to send data to a model within another model in ASP.NET Core MVC

I'm new to this platform and I'm curious about sending model data within another model from ajax to controller. Here are my models: public class mfItems { [Key] [Display(Name = "Item ID")] public string ItemID { get; set; } ...

Modify URL parameters using history.pushState()

Utilizing history.pushState, I am adding several parameters to the current page URL after performing an AJAX request. Now, based on user interaction on the same page, I need to update the URL once again with either the same set of parameters or additional ...

Is there a way to display a condition in Blade using jQuery through AJAX?

I am attempting to create a conditional statement using AJAX in my code that will display a button when the user is an 'admin'. While it is simple in Blade, I am encountering issues when trying to print it from jQuery. -- JavaScript Code -- cod ...

Activate anchor classes in several anchor link menus simultaneously

I have a one-page website with multiple menus filled with anchor links. Here is an example of what they look like: <ul> <li><a href="#home" class="active" onclick="closeNav();">Home</a></li> <li><a href="#abo ...

Tips on making sure video player controls are always visible on an HTML5 video player

Can anyone help me with my HTML video player? I am trying to make the control bar display always, instead of just when hovered over. Any suggestions? ...

What is the best way for me to locate and access the initial element that has been assigned the

How do I reference the first element with the "myabilities" class in the code snippet below? <div class="span6"> <h3 class="srvc-title">Responsive Design</h3> <p class="srvc-detail">Crafting great experie ...

Refreshing an HTML table with new data using jQuery and Ajax after a different selection

Currently, I have a piece of code that allows me to select two players and display some statistics about them. The data is presented using a regular table (image1). The issue I am facing is that when I select a new player, instead of updating the informat ...

Click the button to reset all selected options

<form method="post" action="asdasd" class="custom" id="search"> <select name="sel1" id="sel1"> <option value="all">all</option> <option value="val1">val1</option> <option value="val2" selected="selected"> ...

Tips on correctly determining font size

I'm attempting to style a span element with a specific height (in this case, 23px). However, the browser is automatically adding some extra pixels to the element. There are no additional styles like padding or margin affecting it, just the size of th ...

Styling with CSS 3: Adding Shadows and Rounded Edges

Encountered an intriguing discovery and I'm hoping you can shed some light on it. Here's the code in question: width:940px; margin:0 auto; padding:13px 29px 39px 31px; background:#fff; -webkit-border-radius:10px; -moz-border-radius:1 ...