Detailed explanation of the solution to font blur when using transform in CSS3

Detailed explanation of the solution to font blur when using transform in CSS3

This question is very strange, so I will go straight to the code without saying much:

.g-dialog-wrapper {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    display: flex;
    flex-direction: column;
    width: 405px;
    background-color: #ffffff;
    height: 226px;
    -webkit-box-shadow: 0 0 2em #5191f1;
    -moz-box-shadow: 0 0 2em #5191f1;
    box-shadow: 0 0 2em #5191f1;
    border-radius: 3px;
    z-index: 9999;
  }

The above CSS style makes the font of the page so blurry:

這里寫圖片描述

I checked online and it seems that there is a problem with browser rendering. The value in transform cannot be set as the base, but I clearly stated that it is not the base:

transform: translate(-50%, -50%);

Later I made some changes and changed the width and height to even numbers.

width: 404px;
height: 226px; 

這里寫圖片描述

This is the end of this article on how to solve the problem of blurred fonts when using transform in CSS3. For more information about blurred fonts when using transform in CSS3, please search previous articles on 123WORDPRESS.COM or continue to browse the related articles below. We hope that you will support 123WORDPRESS.COM in the future!

<<:  Differences in the hr separator between browsers

>>:  JavaScript event delegation principle

Recommend

How to use the concat function in mysql

As shown below: //Query the year and month of the...

Implementation of positioning CSS child elements relative to parent elements

Solution Add position:relative to the parent elem...

Description of the execution mechanisms of static pages and dynamic pages

1. A static page means that there are only HTML ta...

Using jQuery to implement the carousel effect

This article shares the specific code for impleme...

Vue project realizes paging effect

The paging effect is implemented in the vue proje...

How to modify Ubuntu's source list (source list) detailed explanation

Introduction The default source of Ubuntu is not ...

JavaScript Basics: Scope

Table of contents Scope Global Scope Function Sco...

How to add Nginx to system services in CentOS7

Introduction After compiling, installing and solv...

Vue+Vant implements the top search bar

This article example shares the specific code of ...

Sample code using vue-router in html

Introducing vue and vue-router <script src=&qu...

Solution for mobile browsers not supporting position: fix

The specific method is as follows: CSS Code Copy ...

How to reset the root password in Linux mysql-5.6

1. Check whether the MySQL service is started. If...