How to calculate the transform-origin? of proportional scaling

clipboard.png

<div class="red">
    <div class="black">
        <div class="blue"></div>
    </div>
</div>

Red is the parent container, blue is the child element in black, and the position remains the same.

ask for:

when the black is enlarged, the blue width is filled with red and the top is aligned, the black scaling base point coordinates x code y .

that is, transform:scale (a certain multiple) transform-origin attribute value

Mar.28,2021

if the top is aligned, it is the crossing point of the line (green line) of the top two points

  • Some problems of css attribute drag dragging

    1, there is a need to drag the icon, put it in one place, and generate a shortcut. I used the drag attribute in CSS to drag 2. The problem is: drag with the background color before dragging. I don t want this background color. here s what happens w...

    Jun.23,2022
Menu