When an element has the transform property set to translate and is positioned next to another element with an animation, the text becomes blurry

There seems to be an issue with a DIV in Text example A, where the text gets slightly blurred when applying a transform: translate CSS.

In contrast, Text example B maintains sharp fonts.

This problem only occurs on Google Chrome; FireFox 46.0.1 displays it correctly. I have observed this issue on:

  • Google Chrome Version 51.0.2704.84 m
  • Google Chrome Version 53.0.2768.0 canary (64-bit)

I am unsure if there is an error in my code or if it is a bug specific to Chrome.

If anyone has suggestions on how to resolve this while still using transform: translate, especially for the latest versions of Chrome and FireFox, please share.

Here are some observations related to this issue:

  • The blurring effect varies with different font sizes.
  • Applying webkit-font-smoothing : none; does not solve the problem.
  • This issue persists regardless of the font type used (system default or custom).
  • I am operating on Windows 8.1.

For a live demonstration, you can view the example here:

#test {
  position: fixed;
  font-size: 20px;
  top: 60%;
  left: 40%;
}

#splashScreen__spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -90px);
  width: 50px;
  height: 50px;
}

#splashScreen__infos {
  position: fixed;
  font-size: 20px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -webkit-font-smoothing: none;
}

.loadingSpinner {
  width: inherit;
  height: inherit;
  border: 5px solid #3498db;
  border-top-color: rgba(0, 0, 0, 0);
  border-left-color: rgba(0, 0, 0, 0);
  border-radius: 50%;
  animation: spinnerAnimation 0.7s infinite linear;
}

@keyframes spinnerAnimation {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
<body>
  <div data-ntv-type="Spinner" class="spinner" id="splashScreen__spinner" widgetid="splashScreen__spinner">
    <div id="splashScreen__spinner__spinner" class="loadingSpinner"></div>
  </div>
  <div id="splashScreen__infos">A) - We are loading your website. Please wait.</div>
  <div id="test">B) - We are loading your website. Please wait.</div>
</body>

Answer №1

This issue is not a result of your code, but rather a known bug in the Webkit rendering engine. For more information, you can refer to resources such as: (among other discussions on FF support forums).

In Chrome and Firefox, there is an option in advanced browser settings to disable "hardware acceleration". This feature allows hardware to assist in rendering complex graphics on web pages. Hardware acceleration is automatically enabled for elements utilizing features like translate. While this can enhance visual output in some cases, it may also lead to issues, as seen in your case.

Unfortunately, there is no direct code-based solution to override hardware acceleration for specific elements. We are reliant on the Webkit developers to address this rendering problem. In the meantime, you may need to experiment with workarounds such as adjusting font sizes or positioning without using translate. Wishing you success in resolving this issue.

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

Can Python be used to determine if a website is responsive?

I am currently utilizing Python3 alongside BeautifulSoup. I am interested in determining whether a website is responsive or not. Initially, I considered checking the meta tags of a website to see if it contains something like this: content="width=device- ...

Prevent span/button clicks by graying them out and disabling the ability to click using HTML and JQuery

I am facing a challenge with my two spans that reveal specific information when clicked. I want to make one span appear as a disabled button (greyed out) when the other span is clicked. I tried using $("#toggle-odd").attr("disabled", tr ...

What is the method for creating a URL (link) that simulates entering text into a text box and then pressing a button?

There is a button on a 3rd party homepage that goes by the code: <INPUT class="widget-content" TYPE="TEXT" onchange="javascript:document.foo.submit();" NAME="RegExRef"> I am looking to automate the task of populating the text box and clicking the b ...

Using Postgres array or JSON to display separate Bootstrap badges within an HTML document

Here is a snapshot from my live server: https://i.sstatic.net/sq83x.png In the image attached, I have been working on extracting information from arrays and JSON using Bootstrap. My goal is to display each value from the array or JSON in separate badges. ...

Does CSS media query "@media only screen" only work when I am resizing the window?

I recently encountered an issue with the code found on this website (the repository can be viewed on Github here): @media only screen and (max-width: 600px) { img {width: 100%; height: 100%; margin: 0; padding: 0; } a.box { width: 100%; pa ...

No more CSS/JS code left standing after combining Flask with Ajax

This question is being opened to address a problem that arose from a previous query found here: Dynamically update HTML images from Flask+Ajax. To summarize, I needed to refresh my HTML view after receiving a response via AJAX from a Flask endpoint. HTML ...

Conceal a list item based on its specific value with the help of

I have a code snippet below where I need to hide the 'li' element by its value that is in the middle using JQuery. Here is the HTML: <ul id="tagCloud"> <li>Item1</li> <li>Item2</li> <li> ...

How can I create a full screen button in WebGL with HTML and JavaScript?

How can I create a WebGL full screen button using HTML and JavaScript? I've done multiple searches on this topic but couldn't find a suitable solution. However, I did manage to find a button that works for putting my page in full screen mode. &l ...

Styling your Kendo grid in ASP.NET MVC with custom CSS styling

I am facing a challenge with displaying two kendo grids side by side on a single view page. To modify the CSS style of a kendo grid using ASP.NET, I typically use: .HtmlAttributes(new { style="width:50%"}) However, when attempting to change more than one ...

Identifying a selection field problem post implementation of jquery mobile

I recently started using Phonegap and ventured into web development. I was able to successfully implement the HTML select tag in my project, but when I introduced jQuery Mobile, I encountered an issue where the select tag displayed two boxes - one resembli ...

What is the proper method for integrating the next.js Image component with the HTML <picture> element?

When it comes to optimizing images, Next.js offers an Image component that lazy loads images and includes a srcset for a particular image. However, there are instances where we need to serve different images based on the device being used (art redirection ...

What could be causing the failure of this web component using shadow DOM when the HTML code includes multiple instances of the component?

Recently, a question was raised on this platform regarding the use of Selenium to access the shadow DOM. Curious about this topic, I delved into the MDN article Using shadow DOM and decided to replicate the code on my local machine. Surprisingly, it worked ...

Error loading custom Javascript in MVC 4 view during the first page load

I'm working on an MVC 4 application that utilizes jQuery Mobile. I have my own .JS file where all the functionality is stored. However, when I navigate to a specific view and check the page source, I notice that all scripts files are loaded except fo ...

Include HTML code with the scripts that need to be executed

When this app receives HTML from the server that contains live content, it's easy to display it using the ng-bind-html-unsafe="expression" directive in Angular 1.0.2. However, if the HTML includes JavaScript functions that need to run, the directive ...

Overflow issue with Bootstrap 4 cards on small screens

When working on my application, I find myself using the bootcard .card class quite frequently. However, I've noticed that when switching to mobile view, there is a significant overflow issue that causes a display bug and shifts my entire page out of ...

Adjust the navigation text and logo color as you scroll on the page

I am new to HTML and CSS and I am working on a website with PagePiling.js scrolling feature. I want to change the color of my logo image and navigation text dynamically as I scroll to the next section. Specifically, I only want the part of the logo and tex ...

Struggling with Input Padding Across Different Browsers?

I am facing an issue with my search form that is supposed to look like this: </p> This is the sample HTML code for the search form: <form method="post" action="#" class="search-form"> <input type="text" class="nav-search-input input ...

Error message: Laravel 8 and Ajax - 405 Error - Method Not Allowed

Whenever I try to input something into the form, it keeps showing an error message saying "405 Method not allowed". How can I resolve this issue? This is my route: Route::get('/search' , [HomeController::class, 'searchPost']) ...

Is the property in Angular not being initialized within the constructor?

Currently, I am implementing the Google Maps API in my latest project and encountered an undefined error within my code: export class AppComponent { startLocation: string; endLocation: string; maneuvers: any[]; constructor(private mapQuestService: ...

Leveraging the amplify/reduce function with radio button selection

Please select from the following options: Using the up/down buttons in the main input should adjust the value accordingly. Clicking on any of the radio buttons below will update the price with the selected value. .priceBlock { width: 80%; border-r ...