CSS: Scaling an element based on page/element width

  Kiến thức lập trình

I’m trying to scale the page elements based on the width of the parent element OR page width, up to 50% scale.

So far I’ve gotten to

@container (min-width: 0) {
    .container-main {
        transform:scale(clamp(0.5,calc(100cqw /1),1));
    }
}

However, I get the error message 0.5 is not compatible with 100cqw.

Any advice on how to achieve this?

LEAVE A COMMENT