IE8 is showing incorrect portion of the CSS sprite

After researching countless issues related to sprites and IE8 online, I have encountered a common problem where sprites do not show up at all. However, in my case, the sprite is displayed but showing the incorrect piece of it. Surprisingly, it functions perfectly on all other web browsers.

Here is the CSS:

div.searchForm input[type=text] {
border: 0;
padding: 0 10px;
margin: 0;
background: url(../img/sprite.png) 0 -125px no-repeat;
background-size: 115% 235px;
width: 600px;
height: 30px;
float: left;
font-size: 12px;
color: #fff;
-webkit-appearance: none;
-webkit-border-radius: 0;
}

And here is the HTML:

    <section id="secondary6">
    <h1 class="hidden">Search</h1>
    <div class="clearfix">
        <div class="grid_4">
            <nav class="grid_2 secondary">
                <h1 class="hidden">Search Secondary Navigation</h1>
            </nav>
            <div class="searchForm">
                <input type="text" placeholder="search">
                <input type="button">
                <input type="submit" class="hidden" >
            </div>
        </div>
    </div>
</section>

Essentially, when clicking the search button, a hidden search bar should appear. This feature works flawlessly on other browsers except for IE8 which displays the incorrect part of the sprite.

Answer №1

Unfortunately, IE8 does not support background-size functionality, which can be a challenge when designing for this browser. One workaround is to consider using IE7.js or implementing a conditional comment to address image positioning specifically for IE8. Alternatively, you may opt to use raw images that do not require resizing to avoid compatibility issues.

Answer №2

What happens when you assign a class or ID to a specific text input field?

For instance...

 div.searchForm input.classInput {
   /* CSS code goes here */
 }

Also...

...where is the wrapper element for the form tag, the form name, and the form action?

The input fields should not be placed in a document as you have shown, without a form tag.

Which software actually generated this code for you? Was it Dreamweaver?


A basic and proper example of a valid HTML input form...

<form id="formID" name="formName" method="post" action="#">
 <input type="text" name="textOne" value="" />
 <input type="text" name="textTwo" value="" />
 <button type="submit" name="process_data"> Go! </button>
</form>

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

Rearranging the @use directive in Sass

Here are some style snippets: tokens.scss .text-center { text-align:center; } .bold { font-weight: bold; } @mixin text-style-1 { font-size: 1.2rem; font-weight: bold; } component/card.scss @use "../token.scss" as tokens; .card { @i ...

What is the best way to create clickable <tr> elements that function as links rather than cells?

Although it seems simple, I am struggling to achieve this task. I have a list of rows with 6 columns that display data from MySQL. I want to make each row clickable instead of just a cell, which will open a new URL in a new tab. Below is the structure I ...

Using jQuery to define active or hover background images

I'm currently working on a list containing 5 items, with the first one active by default (thanks to jQuery adding a 'active' class). Each item has its own background image. When I click on any of the list items, another div gets updated with ...

Unusual behavior encountered while attempting to reset input text using AngularJS

I'm encountering an issue with what I assumed would be a straightforward scenario. Here is the form in question: <form class="form-inline" role="form"> <div class="form-group"> <input type="text" ng-model="customerInput" size="80 ...

Update $(img).offset() upon clicking and dragging the image

Whenever I click on an image, it moves to a random position. I want different sounds to play based on where the click occurs: Directly on the image Within 50px of the image More than 50px away from the image. To achieve this, I need to constantly updat ...

Conceal information within a label

I am encountering an issue with a wordpress plugin and I am attempting to conceal (or alternatively, replace which would be fantastic) the terms "DD", "MM" and "YYYY" in the provided code: <div class="smFormInlineFormCont"> <div class="smInli ...

Having Trouble with Cascading Style Sheets (CSS) for Docked Menu

Click here for the code snippet It seems like everything should be functioning correctly... right? The CSS provided in the sample is pretty straightforward: command,a {float:left;border:1px solid blue;} And the HTML code is just as simple: <menu> ...

What is the best way to set a specific image as the initial image when loading 'SpriteSpin'?

I'm currently working on creating a 360-degree view using the SpriteSpin API. Everything is functioning as expected, but I have an additional request. I need to specify a specific image to be the initial landing image when the page loads. The landing ...

I need to access a webpage using VBA without relying on Internet Explorer for logging in

I need to access the website by logging in. However, I am facing difficulty in using it. Unfortunately, I am unable to share the username and password due to confidentiality reasons. Below is the code snippet that I have: Sub checkdownload() Dim u ...

Implement a callback function to dynamically generate variables and display them within an HTML element

Apologies in advance for any errors I may make as I am a beginner when it comes to javascript, jquery, and json. I have a script that retrieves data from a json file and displays it on a webpage using javascript, jquery, ajax (I believe), and json. When ...

What is the best way to keep tab content fixed when switching?

I've successfully implemented tab switching, but I need to make the content fixed. How can I achieve this so that no matter the length of the content, it remains fixed in its position when switching tabs? The current issue is that when the content is ...

Tips for effectively implementing grids within bootstrap modal dialogs?

Exploring the functionality of the bootstrap-5 grid system within a modal popup has raised a puzzling issue. To investigate further, I began by incorporating the grid example into the main modal template sourced from https://getbootstrap.com/docs/5.0/compo ...

What is the best way to display all values in the class when no selection is made in the drop-down menu?

I need assistance as I am facing an issue where all files are not appearing at the same time. It seems that the problem lies with the year option in my code. The year option requires at least one year to be chosen for it to work properly. I want to impleme ...

Add a container element resembling a div inside a table without implementing the table layout

I am working with a table that is rendered by DataTable, and I have the requirement to dynamically append new elements inside the table like this: The dark grey area represents the new DOM elements that need to be inserted dynamically. The first row cont ...

What are the steps for retrieving values from list boxes?

I'm exploring the use of a two-sided multiselect box, also known as list boxes, within a Shiny app. After some research, I came across a jQuery multiselect library that looks promising: . I have integrated this library into my Shiny app. While the fu ...

implementing a fixed header in HTML

I am facing a challenge where I have a header with dynamic height and fixed position. My goal is to position the container div right below the header. However, since the header height varies, using a fixed value for margin-top is not feasible. Any sugges ...

Is there a way to change "display:inline-block" to "display: block" specifically for IE7?

Below is a code snippet that showcases the issue I'm currently facing. jsFiddle Demo <div class="normal"> <a href="#">Test</a> <a href="#">Test longer</a> </div> <div class="ib blockbyclass"> < ...

What advantages does em have over px in the Zurb Foundation's responsive grid system?

The Zurb Foundation Media Queries are specified in em units: $small-range: (0em, 40em); /* 0, 640px */ $medium-range: (40.063em, 64em); /* 641px, 1024px */ $large-range: (64.063em, 90em); /* 1025px, 1440px */ $xlarge-range: (90.063em, 120em); /* 1441px, 1 ...

Leveraging the power of Required (html5) feature in Internet Explorer

What should I do if I want to make a textbox required on my webpage, but the issue is that it uses an HTML5 attribute? Is there a solution or alternative available? This is how I create my TextBox: @Html.TextBoxFor(model => model.SubChoiceText, new { ...

Should I use margin-top, padding-top, or top?

I often mix up padding-top, margin-top, and top. My issue arises when I need to create a space of 15px. Using margin-top: 15px seems to work, but I suspect it might be incorrect? .subtitles{ font-size:13px; font-family: "Open Sans","Helvetica Neue", ...