Certain computers are experiencing issues with Safari where the sprites background is not resizing correctly

Currently, I am working on a responsive CSS web design project that involves incorporating various sprites for different button states.

After testing the website in Firefox, Opera, IE (compatible from IE8), Chrome, and Safari, I have ensured that everything displays correctly. The site has also been tested on various mobile phones and tablets with different browsers, all without encountering any issues.

As I am in the final stages of testing, I have had colleagues review the website on screens of different resolutions. Interestingly, a friend who uses a MacBook Pro is the only one experiencing a problem - but only when using Safari. This particular issue has proven quite challenging to pinpoint and resolve. Even after trying to replicate the problem on his screen size and adjusting Safari's settings to mimic those of other Mac users, I have had no success.

Here is a snippet of the code:

.buttons-menu .btn .rules, .buttons-menu .btn .contact , .buttons-menu .btn .tickets , .buttons-menu .btn .profile {  display: block; width: 143px;height: 32.5px;padding-top: 37.5px; background-size: 100% 300%;}
.buttons-menu .btn .rules {background: url(../images/sprite-button-03.png); background-position: 0 -100%;}

The issue lies in this tester seeing approximately 2 pixels of the second part of the sprite where it shouldn't be visible, and this occurs solely in Safari.

Thank you for taking the time to read through my explanation.

EDIT : SOLUTION : After considering ralph.m's suggestion, it became evident that the problem stemmed from how Safari rounds decimals, which varies compared to other browsers.

Answer №1

It's best to steer clear of using values such as .5px. The browser may need to either round it up or down to the nearest whole number, and the outcome is unpredictable.

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

Align a flex item in the center horizontally, even when neighboring items are different sizes

In a section element, I have 3 divs inside, and I am trying to horizontally center 'div 2'. The issue I am facing is that the adjacent divs are not the same size, so using "justify-content:center" is not effective. I came across a solution here ...

The Card Component from Core UI fails to appear in the Print Preview feature

I'm currently experimenting with the Card Component from the Core UI framework. However, I'm facing an issue where the color of the Card component and its associated icon do not appear in the Preview when trying to print the page. I attempted to ...

Position CSS triangles for active hyperlinks

I'm having trouble creating a triangle for hover-over links, as the triangle always shows up in one corner instead of below the links. Can anyone help me pinpoint the exact issue? Fiddle #navcontainer a:hover::after { background: white; ...

Exploring the possibilities of applying CSS to customize the color of various elements

Is there a way to set the color of elements in CSS so that it applies to everything such as fonts, borders, and horizontal rules when applied to the body? How can I accomplish this effectively? ...

What is the best way to select individual containers within a larger container in order to modify their background color?

Hey everyone! I am brand new to the world of HTML and CSS. I am currently developing a website that features 5 unique cards: The first card contains a single container with an image on the left and a paragraph on the right The second card is s ...

Transform HTML entities to an escaped string in CSS content dynamically

I am aware that special html-entities like   or ö or ð cannot be incorporated within a css block like the following: div.test:before { content:"text with html-entities like ` ` or `ö` or `ð`"; } ...

After utilizing the function, the forward and back arrows are no longer visible

After setting up my slideshow, I encountered an issue where clicking the next or previous buttons caused them to shrink down and turn into small grey boxes. Has anyone experienced this before? This relates to PHP/HTML if ($_SERVER['REQUEST_METHOD&ap ...

Enhancing the Appearance of Google Line Charts

Incorporating Google line charts into my upcoming web project has been a goal of mine. I aim to customize them in the style displayed in this image and display dates between months. Can anyone provide guidance on how to achieve this, if it is feasible? ...

Slick.js integrated with 3D flip is automatically flipping after the initial rotation

I'm encountering an issue with my CSS3 carousel and 3D flipping. Whenever I navigate through the carousel and flip to the next slide, the first slide seems to automatically flip/flop after completing the rotation. You can see a visual demonstration o ...

Issue with Bootstrap Navbar-Toggle Functionality in ASP.NET with Visual Studio 2010 Not Resolving

After installing a NuGet package, I proceeded to install Bootstrap which created the following folders: Contents containing Bootstrap CSS files Scripts containing .js files In the header of my Master Page, I included the scripts like this: <scrip ...

Troubleshooting issue with Calendar styling in Bootstrap and SimpleCalendar Rails integration

I am having trouble applying styling to my SimpleCalendar in Rails, using the gem. When I render it, this is what I see: https://i.sstatic.net/kJi7m.png Here is the CSS provided by https://github.com/excid3/simple_calendar: .simple-calendar { table { ...

Elevate the size of the hero section

Is there a way to increase the height of my jumbotron without adding it in the class attribute, as it would affect responsiveness? I want it to look like this, but currently, it appears as this. Below is my code: Html: <div class="container"> ...

When viewed on a mobile device, the page defaults to displaying the NumPad instead of the Text Keyboard in Angular

The email field in my angular app is opening a Key Pad in mobile view and I'm not sure why. <form (ngSubmit)="onSubmit()" #emailForm="ngForm"> <div class="emailaddress" style="text-align:center;" *ngIf="!showEmail"& ...

How can I make the burger icon responsive and centered in my navbar?

Struggling to center the burger icon in the navbar has been a bit of a challenge for me. Although it appears centered on small mobile devices, the icon shifts to the upper side on larger screens like tablets, losing its centered position. I am seeking advi ...

The Safari browser's iframe is stuck in an infinite loop with the service worker, causing the iframe to display as a blank white screen. This issue is unique to Safari and does

I currently have two web applications built in Vue. One of them acts as a wrapper for all the company's applications and loads various projects through an iframe, including the other web application built in Vue. Both projects have the vue-pwa plugin ...

"Having trouble getting `justify-between` to work in a tailwind CSS on an absolute

I'm currently using Tailwind CSS and I'm trying to position my navbar on top of an image. The image is set in a relative position and the navbar is set in an absolute position. Surprisingly, when the navbar is not set in the absolute position, I ...

Using jQuery to animate a div when clicked by the mouse

Here's the scenario: I have 3 block elements arranged in a specific order: Image Hidden Text Block (.hidden) Footer Block (.blockimage) When the page loads, the image is displayed over the hidden text block (which contains further infor ...

Header Stability TransitionAndView

I'm not very experienced with JavaScript, so please bear with me. I'm attempting to create a fixed header that transitions to 50% opacity when scrolled down and returns to full opacity (opacity: 1.0) when scrolled back to the top. Here is my cur ...

Remove unnecessary margins from grid layout

I'm looking to create a grid display using divs with inline-block display and margin-right. However, I'm facing an issue where the last item on each row also has a redundant margin-right. Here's a snippet of my CSS: .item{ height:20px; ...

Is there a bug in Safari 8.0 related to jQuery and backslashes?

I am using Mac OS 10.10 Yosemite and Safari 8.0. Attempting to read an XML (RSS) file: <content:encoded>bla bla bla</content:encoded> The Javascript Ajax method I am using is: description:$(valeur).find('content\\:encoded&apo ...