What exactly does transform's scale say?

in the recent project, a student who did the refactoring left, then wrote the refactoring himself, and then encountered the common ios one-pixel problem. Although there is already an answer to this question on the Internet, I encountered some questions in the process of finding the answer. After Baidu failed, I came here to find a solution to Daniel.

there are many solutions on the Internet, but the one that most people use is to reset viewport with js or use css to scale. I adopted the second option. However, I found that I still don"t know anything about the attribute transform. Generally speaking, this attribute is written as follows:

transform:scale(0.5);

but I found that one pixel is written like this:

transform(scale(0.5));

I hope Daniel can give me an answer. This is to find an one-pixel way to write

.
        .radius-border{
            position: relative;
        }
        .radius-border:after{
            content: "";
            box-sizing: border-box;
            position: absolute;
            width: 85px;
            height: 26px;
            left: 0;
            top: 0;
            border-radius: 50px;
            border:1px solid rgba(42, 146, 235,0.3);
            -webkit-transform(scale(0.5));
            -webkit-transform-origin: 0 0;
            transform(scale(0.5));
            transform-origin: 0 0;
        }
        .radius-border .txt{
            position: absolute;
            left: 13px;
            top: 3px;
            font-size: 14px;
            color: -sharp2A92EB;
        }
        
        <div class="radius-border">
            <span class="txt">Ta</span>
        </div>
Mar.28,2021

how come the focus of concern upstairs is all wrong. (knock on the blackboard!

what the subject wants to ask is why the method I found transform can be called like a function. This way of eating has never been seen before.
in fact, as long as the subject puts it in the browser to test it, it will know the result-- transform (scale (0.5)); doesn't work on the browser at all (because it doesn't standardize)..

).

then two results are obtained:

  1. the original author made a mistake
  2. it is possible that the original author actually used css preprocessing, so there is such a syntax.

this is the practice of dealing with 2 times the screen, reducing the border to 0.5 times the size, and if it is 3 times the screen, it is scale (0.3333).


on the split screen, if you do not zoom at the viewport level, then one css pixel will correspond to two physical pixels. But the browser's' understanding'of '0.5px' is unstable. It may be rendered as 1 physical pixel, or as 0. Transfrom can be seen as the second drawing of elements, which is more accurate in graphics and images. The scale property, which is a deformation. Scale draws an image of 2 2 physical pixels as 1 1 physical pixel.


looks like a preprocessor function, but I didn't find such a way to write the standard CSS.

Menu